Bug 164357 - EvalCodeCache should not give up in strict mode and other cases
Summary: EvalCodeCache should not give up in strict mode and other cases
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Geoffrey Garen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-02 21:48 PDT by Geoffrey Garen
Modified: 2016-11-08 12:58 PST (History)
6 users (show)

See Also:


Attachments
Patch (8.75 KB, patch)
2016-11-02 21:54 PDT, Geoffrey Garen
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews116 for mac-yosemite (1.89 MB, application/zip)
2016-11-03 06:37 PDT, Build Bot
no flags Details
Patch (11.69 KB, patch)
2016-11-03 16:42 PDT, Geoffrey Garen
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews113 for mac-yosemite (1.87 MB, application/zip)
2016-11-03 18:44 PDT, Build Bot
no flags Details
Patch (12.26 KB, patch)
2016-11-04 14:48 PDT, Geoffrey Garen
msaboff: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffrey Garen 2016-11-02 21:48:14 PDT
EvalCodeCache should not give up in strict mode and other cases
Comment 1 Geoffrey Garen 2016-11-02 21:54:14 PDT
Created attachment 293745 [details]
Patch
Comment 2 Build Bot 2016-11-03 06:37:17 PDT
Comment on attachment 293745 [details]
Patch

Attachment 293745 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/2454760

New failing tests:
js/dom/domjit-accessor-polymorphic.html
Comment 3 Build Bot 2016-11-03 06:37:20 PDT
Created attachment 293759 [details]
Archive of layout-test-results from ews116 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews116  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 4 Saam Barati 2016-11-03 10:25:50 PDT
Is that failure real? The patch makes sense to me.
Comment 5 Saam Barati 2016-11-03 10:36:55 PDT
Can you add some microbenchmarks that shows a speed up with block scoping? Maybe also some correctness tests for block scoping/with scoping
Comment 6 Geoffrey Garen 2016-11-03 16:42:39 PDT
Created attachment 293827 [details]
Patch
Comment 7 Geoffrey Garen 2016-11-03 16:43:33 PDT
New patch includes a micro benchmark and correctness test.
Comment 8 Saam Barati 2016-11-03 16:48:37 PDT
Comment on attachment 293827 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=293827&action=review

r=me

> JSTests/ChangeLog:8
> +        * microbenchmarks/eval-cached.js: Added. 45x faster now.

lol, nice

> Source/JavaScriptCore/bytecode/EvalCodeCache.h:90
> +            uint32_t m_callSiteIndex;

Why not use an actual CallSiteIndex instead of a uint32_t?
Comment 9 Geoffrey Garen 2016-11-03 16:55:17 PDT
> Why not use an actual CallSiteIndex instead of a uint32_t?

I'm a CallSiteIndex noob. It looked to me like CallSiteIndex is a way to represent "CallSiteIndex or NULL". Is that right? I don't every want the NULL variant, so I thought uint32_t was the more specific type.
Comment 10 Saam Barati 2016-11-03 17:20:55 PDT
(In reply to comment #9)
> > Why not use an actual CallSiteIndex instead of a uint32_t?
> 
> I'm a CallSiteIndex noob. It looked to me like CallSiteIndex is a way to
> represent "CallSiteIndex or NULL". Is that right? I don't every want the
> NULL variant, so I thought uint32_t was the more specific type.

It's true that some CallSiteIndex can be empty, however, just because that's allowed, I don't think making the field a CallSiteIndex makes it a less specific type. I actually think it's still a more specific type because not all uint32_t are a CallSiteIndex, but all CallSiteIndex are backed by a single uint32_t. I think it's OK to just mandate that no empty CallSiteIndex is passed to the cache. To me as a reader of the code, it's easier to understand a field shaped like:

CallSiteIndex m_callSiteIndex;

instead of

uint32_t m_callSiteIndex;
Comment 11 Build Bot 2016-11-03 18:44:37 PDT
Comment on attachment 293827 [details]
Patch

Attachment 293827 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/2457558

New failing tests:
js/dom/domjit-accessor-polymorphic.html
Comment 12 Build Bot 2016-11-03 18:44:41 PDT
Created attachment 293845 [details]
Archive of layout-test-results from ews113 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews113  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 13 Geoffrey Garen 2016-11-04 10:35:06 PDT
Looks like some of the original EWS failures were fake, but the hang in js/dom/domjit-accessor-polymorphic.html is real.
Comment 14 Geoffrey Garen 2016-11-04 14:48:53 PDT
Created attachment 293934 [details]
Patch
Comment 15 Michael Saboff 2016-11-04 15:06:42 PDT
Comment on attachment 293934 [details]
Patch

r=me

NIT - It looks like some functions have the evalSource as the first argument and the callSiteIndex as the second argument, while others have the order flipped.  I think it would be cleaner if all functions used the same order.
Comment 16 Geoffrey Garen 2016-11-04 15:52:16 PDT
> NIT - It looks like some functions have the evalSource as the first argument
> and the callSiteIndex as the second argument, while others have the order
> flipped.  I think it would be cleaner if all functions used the same order.

Fixed.
Comment 17 Geoffrey Garen 2016-11-04 16:05:18 PDT
Committed r208404: <http://trac.webkit.org/changeset/208404>
Comment 18 Chris Dumez 2016-11-08 12:16:25 PST
There was a 10% Sunspider regression in the range r208404-r208416, could it be caused by this patch?
Comment 19 Chris Dumez 2016-11-08 12:21:14 PST
(In reply to comment #18)
> There was a 10% Sunspider regression in the range r208404-r208416, could it
> be caused by this patch?

This really seems like the most likely candidate in the range. Also note that the most regressed subtest is date-format-tofte which is 160% regressed :)
Comment 20 Chris Dumez 2016-11-08 12:24:05 PST
(In reply to comment #19)
> (In reply to comment #18)
> > There was a 10% Sunspider regression in the range r208404-r208416, could it
> > be caused by this patch?
> 
> This really seems like the most likely candidate in the range. Also note
> that the most regressed subtest is date-format-tofte which is 160% regressed
> :)

rdar://problem/29164133
Comment 21 Chris Dumez 2016-11-08 12:32:20 PST
(In reply to comment #20)
> (In reply to comment #19)
> > (In reply to comment #18)
> > > There was a 10% Sunspider regression in the range r208404-r208416, could it
> > > be caused by this patch?
> > 
> > This really seems like the most likely candidate in the range. Also note
> > that the most regressed subtest is date-format-tofte which is 160% regressed
> > :)
> 
> rdar://problem/29164133

Likely a 5% JetStream regression as well.
Comment 22 Geoffrey Garen 2016-11-08 12:58:18 PST
Yes, this patch caused a performance regression. Tracked here: https://bugs.webkit.org/show_bug.cgi?id=164499.