Bug 148559

Summary: Add noDFG() to jsc to prevent DFG compilation of a specified function
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, fpizlo, ggaren, keith_miller, msaboff, saam
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
the fix. ggaren: review+

Mark Lam
Reported 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.
Attachments
the fix. (10.33 KB, patch)
2015-08-27 22:03 PDT, Mark Lam
ggaren: review+
Mark Lam
Comment 1 2015-08-27 22:03:57 PDT
Created attachment 260120 [details] the fix.
Geoffrey Garen
Comment 2 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.
Saam Barati
Comment 3 2015-08-27 22:28:21 PDT
Comment on attachment 260120 [details] the fix. r=me
Saam Barati
Comment 4 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"
Mark Lam
Comment 5 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().
Mark Lam
Comment 6 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.
Mark Lam
Comment 7 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>.
Note You need to log in before you can comment on or make changes to this bug.