Ignore:
Timestamp:
Nov 29, 2017, 9:31:54 AM (8 years ago)
Author:
[email protected]
Message:

The recursive tail call optimisation is wrong on closures
https://bugs.webkit.org/show_bug.cgi?id=179835

Reviewed by Saam Barati.

JSTests:

  • stress/closure-recursive-tail-call.js: Added.

(makeClosure):

PerformanceTests:

This new benchmark is a very close variant of the merge-sort benchmark, that writes mergeSorted in a kinda CPS style,
to stress the use of closures, and of polymorphic calls.

  • TailBench9000/merge-sort-cps.js: Added.

(createRNG):
(mergeSorted):
(checkSorted.check):
(add):
(build):
(compare):
(checkSpectrum):
(buildArray):
(test):

Source/JavaScriptCore:

The problem is that we only check the executable of the callee, not whatever variables might have been captured.
As a stopgap measure this patch just does not do the optimisation for closures.

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::handleRecursiveTailCall):

Tools:

This just includes merge-sort-cps.js to the list of benchmarks ran by run-jsc-benchmarks --tail-bench

  • Scripts/run-jsc-benchmarks:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r225263 r225270  
     12017-11-29  Robin Morisset  <[email protected]>
     2
     3        The recursive tail call optimisation is wrong on closures
     4        https://bugs.webkit.org/show_bug.cgi?id=179835
     5
     6        Reviewed by Saam Barati.
     7
     8        The problem is that we only check the executable of the callee, not whatever variables might have been captured.
     9        As a stopgap measure this patch just does not do the optimisation for closures.
     10
     11        * dfg/DFGByteCodeParser.cpp:
     12        (JSC::DFG::ByteCodeParser::handleRecursiveTailCall):
     13
    1142017-11-28  Joseph Pecoraro  <[email protected]>
    215
Note: See TracChangeset for help on using the changeset viewer.