Bug 179765

Summary: Provide a runtime option for disabling the optimization of recursive tail calls
Product: WebKit Reporter: Robin Morisset <rmorisset>
Component: JavaScriptCoreAssignee: Robin Morisset <rmorisset>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, keith_miller, mark.lam, msaboff, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Robin Morisset
Reported 2017-11-16 06:58:15 PST
This should make benchmarking and debugging this optimization a bit less painful. Name of the option: optimizeRecursiveTailCalls
Attachments
Patch (4.87 KB, patch)
2017-11-16 06:59 PST, Robin Morisset
no flags
Patch for landing (4.88 KB, patch)
2017-11-16 07:17 PST, Robin Morisset
no flags
Robin Morisset
Comment 1 2017-11-16 06:59:36 PST
Mark Lam
Comment 2 2017-11-16 07:04:07 PST
Comment on attachment 327060 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=327060&action=review r=me > Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:1318 > + if (Options::optimizeRecursiveTailCalls()) { I suggest making this: if (LIKELY(Options::optimizeRecursiveTailCalls())) { > Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:1425 > + if (!Options::optimizeRecursiveTailCalls()) I suggest making this: if (UNLIKELY(!Options::optimizeRecursiveTailCalls()))
Robin Morisset
Comment 3 2017-11-16 07:17:10 PST
Created attachment 327062 [details] Patch for landing
WebKit Commit Bot
Comment 4 2017-11-16 07:48:15 PST
Comment on attachment 327062 [details] Patch for landing Clearing flags on attachment: 327062 Committed r224918: <https://trac.webkit.org/changeset/224918>
WebKit Commit Bot
Comment 5 2017-11-16 07:48:16 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 6 2017-11-16 07:49:27 PST
Saam Barati
Comment 7 2017-11-16 08:18:41 PST
Comment on attachment 327062 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=327062&action=review > Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:1425 > + if (UNLIKELY(!Options::optimizeRecursiveTailCalls())) Why reference this option anywhere else? Isn’t it only here that we care?
Robin Morisset
Comment 8 2017-11-16 08:42:39 PST
(In reply to Saam Barati from comment #7) > Comment on attachment 327062 [details] > Patch for landing > > View in context: > https://bugs.webkit.org/attachment.cgi?id=327062&action=review > > > Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:1425 > > + if (UNLIKELY(!Options::optimizeRecursiveTailCalls())) > > Why reference this option anywhere else? Isn’t it only here that we care? The other two places where we reference this option take care of splitting the entry block for functions that have at least one tail call, so the optimisation has somewhere to jump to. I decided to also make them conditional on the option, to make it easier to benchmark cleanly the cost incurred by this.
Saam Barati
Comment 9 2017-11-16 09:16:49 PST
(In reply to Robin Morisset from comment #8) > (In reply to Saam Barati from comment #7) > > Comment on attachment 327062 [details] > > Patch for landing > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=327062&action=review > > > > > Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:1425 > > > + if (UNLIKELY(!Options::optimizeRecursiveTailCalls())) > > > > Why reference this option anywhere else? Isn’t it only here that we care? > > The other two places where we reference this option take care of splitting > the entry block for functions that have at least one tail call, so the > optimisation has somewhere to jump to. > I decided to also make them conditional on the option, to make it easier to > benchmark cleanly the cost incurred by this. 👍🏼
Note You need to log in before you can comment on or make changes to this bug.