Bug 161729

Summary: We should inline operationConvertJSValueToBoolean into JIT code
Product: WebKit Reporter: Saam Barati <saam>
Component: JavaScriptCoreAssignee: Saam Barati <saam>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, benjamin, commit-queue, fpizlo, ggaren, gskachkov, jfbastien, keith_miller, kling, mark.lam, msaboff, oliver, rniwa, sukolsak, ticaiolima, ysuzuki
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
WIP
none
patch
none
patch
fpizlo: review-
patch none

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.