Bug 148559 - Add noDFG() to jsc to prevent DFG compilation of a specified function
Summary: Add noDFG() to jsc to prevent DFG compilation of a specified function
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-27 21:57 PDT by Mark Lam
Modified: 2015-08-27 23:02 PDT (History)
6 users (show)

See Also:


Attachments
the fix. (10.33 KB, patch)
2015-08-27 22:03 PDT, Mark Lam
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2015-08-27 21:57:57 PDT
Just like noInline() allows us to prevent inlining of a function, noOptimize() allows us to prevent optimization of a function.
Comment 1 Mark Lam 2015-08-27 22:03:57 PDT
Created attachment 260120 [details]
the fix.
Comment 2 Geoffrey Garen 2015-08-27 22:27:26 PDT
Comment on attachment 260120 [details]
the fix.

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

> Source/JavaScriptCore/jsc.cpp:635
> +        addFunction(vm, "noOptimize", functionNeverOptimizeFunction, 1);

Let's call this noDFG and functionNoDFG. "noOptimize" implies no baseline JIT, which is not the case.
Comment 3 Saam Barati 2015-08-27 22:28:21 PDT
Comment on attachment 260120 [details]
the fix.

r=me
Comment 4 Saam Barati 2015-08-27 22:30:13 PDT
(In reply to comment #2)
> Comment on attachment 260120 [details]
> the fix.
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=260120&action=review
> 
> > Source/JavaScriptCore/jsc.cpp:635
> > +        addFunction(vm, "noOptimize", functionNeverOptimizeFunction, 1);
> 
> Let's call this noDFG and functionNoDFG. "noOptimize" implies no baseline
> JIT, which is not the case.

I also like the name "dontDFGCompile"
Comment 5 Mark Lam 2015-08-27 22:35:33 PDT
(In reply to comment #2)
> Comment on attachment 260120 [details]
> the fix.
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=260120&action=review
> 
> > Source/JavaScriptCore/jsc.cpp:635
> > +        addFunction(vm, "noOptimize", functionNeverOptimizeFunction, 1);
> 
> Let's call this noDFG and functionNoDFG. "noOptimize" implies no baseline
> JIT, which is not the case.

I think fpizlo has always used the term “optimize” (in our code base) to mean DFG and higher, and precludes baseline.  For example, in JITCode.h, he distinguished between isOptimizingJIT() and isBaselineCode().  And he suggested the term “noOptimize” when he asked me to implement this.

But sure, I’ll change it to noDFG().
Comment 6 Mark Lam 2015-08-27 22:45:54 PDT
(In reply to comment #5)
> But sure, I’ll change it to noDFG().

I just realized that you meant for me to only change the function in jsc.cpp and not elsewhere in the patch.  Will do.
Comment 7 Mark Lam 2015-08-27 23:02:06 PDT
Thanks for the reviews.  I opted to go with noDFG() instead of dontDFGCompile() because noDFG() is shorter and adequately conveys the purpose.

Landed in r189086: <http://trac.webkit.org/r189086>.