WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
157510
Web Inspector: Eliminate the crazy code for evaluateOnCallFrame
https://bugs.webkit.org/show_bug.cgi?id=157510
Summary
Web Inspector: Eliminate the crazy code for evaluateOnCallFrame
Joseph Pecoraro
Reported
2016-05-10 01:37:29 PDT
* SUMMARY Eliminate the crazy code for evaluateOnCallFrame. While ingenious, it was very complex and difficult and confusing. Move to using a global scope extension and unify as much of the code for Debugger.evaluateOnCallFrame and Runtime.evaluate as possible.
Attachments
[PATCH] Proposed Fix
(36.08 KB, patch)
2016-05-10 01:44 PDT
,
Joseph Pecoraro
timothy
: review+
bburg
: commit-queue-
Details
Formatted Diff
Diff
[PATCH] For Landing
(36.09 KB, patch)
2016-05-10 11:21 PDT
,
Joseph Pecoraro
commit-queue
: commit-queue-
Details
Formatted Diff
Diff
Archive of layout-test-results from webkit-cq-02 for mac-yosemite
(860.34 KB, application/zip)
2016-05-10 12:04 PDT
,
WebKit Commit Bot
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2016-05-10 01:38:18 PDT
<
rdar://problem/26191332
>
Joseph Pecoraro
Comment 2
2016-05-10 01:44:24 PDT
Created
attachment 278484
[details]
[PATCH] Proposed Fix One very interesting bit is that in non-strict call frames I'm able to create local variables `var local = 1`, but in strict call frames I'm not. Probably an optimization difference? Or maybe based on the number of locals in the function? In any case, the test discovers this, but the behavior could go either way and I would be fine with it.
Blaze Burg
Comment 3
2016-05-10 07:42:28 PDT
Comment on
attachment 278484
[details]
[PATCH] Proposed Fix View in context:
https://bugs.webkit.org/attachment.cgi?id=278484&action=review
> LayoutTests/inspector/debugger/evaluateOnCallFrame-CommandLineAPI-expected.txt:40 > +PASS: Script evaluation. Should not be able to access arguments.callee.
Nit: 'strict'
> LayoutTests/inspector/debugger/evaluateOnCallFrame-CommandLineAPI-expected.txt:43 > +PASS: Local variable `keys` should be shadowed by CommandLineAPI `keys` function in call frame for `foo`.
This description does not match the test case name.
> LayoutTests/inspector/debugger/evaluateOnCallFrame-CommandLineAPI.html:82 > + testEvaluateOnStrictCallFrame("a", (x) => { InspectorTest.expectThat(x === 6, "`a` should be 5 in `bar`."); });
Assertion message doesn't match the condition.
Blaze Burg
Comment 4
2016-05-10 07:56:37 PDT
Comment on
attachment 278484
[details]
[PATCH] Proposed Fix View in context:
https://bugs.webkit.org/attachment.cgi?id=278484&action=review
Looks like a big win to me. I would like Tim or Mark to look at this too.
> LayoutTests/inspector/debugger/evaluateOnCallFrame-CommandLineAPI.html:170 > + InspectorTest.expectThat(resultValue === 123, "Local variable `keys` should be shadowed by CommandLineAPI `keys` function in call frame for `foo`.");
See above, this seems wrong.
> Source/JavaScriptCore/ChangeLog:19 > + DebuggerCallFrame::evaluteWithScopeExtension. When evaluating globally
Typo: evaluateWithScopeExtension
> Source/JavaScriptCore/inspector/InjectedScriptSource.js:-490 > - "var __originalEval = global.eval; global.eval = __eval;" +
I had no idea this nasty stuff was being done. I wonder if it was hurting performance by doing weird things to globals/builtins.
> Source/JavaScriptCore/inspector/JSJavaScriptCallFramePrototype.cpp:-93 > - ASSERT_GC_OBJECT_INHERITS(castedThis, JSJavaScriptCallFrame::info());
The changelog didn't say anything about this change. What's it for?
Saam Barati
Comment 5
2016-05-10 08:47:06 PDT
(In reply to
comment #2
)
> Created
attachment 278484
[details]
> [PATCH] Proposed Fix > > One very interesting bit is that in non-strict call frames I'm able to > create local variables `var local = 1`, but in strict call frames I'm not. > Probably an optimization difference? Or maybe based on the number of locals > in the function? In any case, the test discovers this, but the behavior > could go either way and I would be fine with it.
This sounds like how strict mode eval works in general. In strict mode eval you can not inject variables into your parent var environment. The eval itself creates its own var environment. In sloppy mode eval, all vars declared in the eval are injected into the parent var environment because the eval doesn't have a local var environment.
Timothy Hatcher
Comment 6
2016-05-10 10:11:47 PDT
Comment on
attachment 278484
[details]
[PATCH] Proposed Fix View in context:
https://bugs.webkit.org/attachment.cgi?id=278484&action=review
So awesome!
>> Source/JavaScriptCore/inspector/InjectedScriptSource.js:-490 >> - "var __originalEval = global.eval; global.eval = __eval;" + > > I had no idea this nasty stuff was being done. I wonder if it was hurting performance by doing weird things to globals/builtins.
It was all for science…
Joseph Pecoraro
Comment 7
2016-05-10 11:18:40 PDT
> > Source/JavaScriptCore/inspector/JSJavaScriptCallFramePrototype.cpp:-93 > > - ASSERT_GC_OBJECT_INHERITS(castedThis, JSJavaScriptCallFrame::info()); > > The changelog didn't say anything about this change. What's it for?
This is just asserting the object inherits from JSJavaScriptCallFrame. However the code above it (in all these functions) does a dynamicCast and returns if it isn't that type. So the assert will never fail.
Joseph Pecoraro
Comment 8
2016-05-10 11:21:45 PDT
Created
attachment 278516
[details]
[PATCH] For Landing
WebKit Commit Bot
Comment 9
2016-05-10 12:03:56 PDT
Comment on
attachment 278516
[details]
[PATCH] For Landing Rejecting
attachment 278516
[details]
from commit-queue. New failing tests: accessibility/meter-element.html Full output:
http://webkit-queues.webkit.org/results/1299711
WebKit Commit Bot
Comment 10
2016-05-10 12:04:00 PDT
Created
attachment 278518
[details]
Archive of layout-test-results from webkit-cq-02 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the commit-queue. Bot: webkit-cq-02 Port: mac-yosemite Platform: Mac OS X 10.10.5
Joseph Pecoraro
Comment 11
2016-05-10 12:15:50 PDT
<
http://trac.webkit.org/changeset/200634
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug