Bug 161729 - We should inline operationConvertJSValueToBoolean into JIT code
Summary: We should inline operationConvertJSValueToBoolean into JIT code
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-07 19:23 PDT by Saam Barati
Modified: 2016-09-08 16:21 PDT (History)
16 users (show)

See Also:


Attachments
WIP (26.20 KB, patch)
2016-09-07 19:26 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
patch (26.45 KB, patch)
2016-09-08 14:43 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
patch (25.55 KB, patch)
2016-09-08 14:44 PDT, Saam Barati
fpizlo: review-
Details | Formatted Diff | Diff
patch (26.96 KB, patch)
2016-09-08 14:59 PDT, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2016-09-07 19:23:40 PDT
Speedometer spends around 1% of its time in this function. Lets inline it to not pay for the overhead of the call.
Comment 1 Saam Barati 2016-09-07 19:26:49 PDT
Created attachment 288226 [details]
WIP

This patch has some other stuff for HasOwnProperty that I was experimenting with.
The interesting bits related to this bug are the AssemblyHelpers function: convertValueToBoolean
Comment 2 Saam Barati 2016-09-07 19:27:09 PDT
I still need to make masqueradesAsUndefined work as expected.
Comment 3 Saam Barati 2016-09-08 14:43:10 PDT
Created attachment 288327 [details]
patch
Comment 4 Saam Barati 2016-09-08 14:44:24 PDT
Created attachment 288329 [details]
patch
Comment 5 WebKit Commit Bot 2016-09-08 14:46:04 PDT
Attachment 288329 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/jit/AssemblyHelpers.h:1530:  The parameter name "value" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Filip Pizlo 2016-09-08 14:47:20 PDT
Comment on attachment 288329 [details]
patch

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

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:1694
> +        bool shouldCheckMasqueradesAsUndefined = !masqueradesAsUndefinedWatchpointIsStillValid();

Where do you register the MasqueradesAsUndefined watchpoint?

Hint: everyone else seems to do it in FixupPhase.

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:1840
> +        bool shouldCheckMasqueradesAsUndefined = !masqueradesAsUndefinedWatchpointIsStillValid();

Ditto.

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:1843
> +        bool shouldCheckMasqueradesAsUndefined = !masqueradesAsUndefinedWatchpointIsStillValid();

Ditto.

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:2002
> +            bool shouldCheckMasqueradesAsUndefined = !masqueradesAsUndefinedWatchpointIsStillValid();

Ditto.
Comment 7 Saam Barati 2016-09-08 14:59:42 PDT
Created attachment 288332 [details]
patch

Nice catch. Fixed.
Comment 8 WebKit Commit Bot 2016-09-08 15:01:41 PDT
Attachment 288332 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/jit/AssemblyHelpers.h:1530:  The parameter name "value" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 10 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 WebKit Commit Bot 2016-09-08 16:21:39 PDT
Comment on attachment 288332 [details]
patch

Clearing flags on attachment: 288332

Committed r205675: <http://trac.webkit.org/changeset/205675>
Comment 10 WebKit Commit Bot 2016-09-08 16:21:45 PDT
All reviewed patches have been landed.  Closing bug.