Changeset 213856 in webkit


Ignore:
Timestamp:
Mar 13, 2017 11:00:25 AM (7 years ago)
Author:
fpizlo@apple.com
Message:

FTL should not flush strict arguments unless it really needs to
https://bugs.webkit.org/show_bug.cgi?id=169519

Reviewed by Mark Lam.

JSTests:

This benchmark runs 3.5x faster thanks to this patch.

  • microbenchmarks/strict-arguments-no-escape.js: Added.

(foo):
(bar):
(baz):

Source/JavaScriptCore:

This is a refinement that we should have done ages ago. This kills some pointless PutStacks
in DFG SSA IR. It can sometimes unlock other optimizations.

  • dfg/DFGPreciseLocalClobberize.h:

(JSC::DFG::PreciseLocalClobberizeAdaptor::readTop):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r213850 r213856  
     12017-03-11  Filip Pizlo  <fpizlo@apple.com>
     2
     3        FTL should not flush strict arguments unless it really needs to
     4        https://bugs.webkit.org/show_bug.cgi?id=169519
     5
     6        Reviewed by Mark Lam.
     7       
     8        This benchmark runs 3.5x faster thanks to this patch.
     9
     10        * microbenchmarks/strict-arguments-no-escape.js: Added.
     11        (foo):
     12        (bar):
     13        (baz):
     14
    1152017-03-13  Caio Lima  <ticaiolima@gmail.com>
    216
  • trunk/Source/JavaScriptCore/ChangeLog

    r213850 r213856  
     12017-03-11  Filip Pizlo  <fpizlo@apple.com>
     2
     3        FTL should not flush strict arguments unless it really needs to
     4        https://bugs.webkit.org/show_bug.cgi?id=169519
     5
     6        Reviewed by Mark Lam.
     7       
     8        This is a refinement that we should have done ages ago. This kills some pointless PutStacks
     9        in DFG SSA IR. It can sometimes unlock other optimizations.
     10
     11        * dfg/DFGPreciseLocalClobberize.h:
     12        (JSC::DFG::PreciseLocalClobberizeAdaptor::readTop):
     13
    1142017-03-13  Caio Lima  <ticaiolima@gmail.com>
    215
  • trunk/Source/JavaScriptCore/dfg/DFGPreciseLocalClobberize.h

    r209764 r213856  
    198198           
    199199        default: {
    200             // All of the outermost arguments, except this, are definitely read.
    201             for (unsigned i = m_graph.m_codeBlock->numParameters(); i-- > 1;)
    202                 m_read(virtualRegisterForArgument(i));
     200            // All of the outermost arguments, except this, are read in sloppy mode.
     201            if (!m_graph.m_codeBlock->isStrictMode()) {
     202                for (unsigned i = m_graph.m_codeBlock->numParameters(); i-- > 1;)
     203                    m_read(virtualRegisterForArgument(i));
     204            }
    203205       
    204206            // The stack header is read.
     
    208210            // Read all of the inline arguments and call frame headers that we didn't already capture.
    209211            for (InlineCallFrame* inlineCallFrame = m_node->origin.semantic.inlineCallFrame; inlineCallFrame; inlineCallFrame = inlineCallFrame->getCallerInlineFrameSkippingTailCalls()) {
    210                 for (unsigned i = inlineCallFrame->arguments.size(); i-- > 1;)
    211                     m_read(VirtualRegister(inlineCallFrame->stackOffset + virtualRegisterForArgument(i).offset()));
     212                if (!inlineCallFrame->isStrictMode()) {
     213                    for (unsigned i = inlineCallFrame->arguments.size(); i-- > 1;)
     214                        m_read(VirtualRegister(inlineCallFrame->stackOffset + virtualRegisterForArgument(i).offset()));
     215                }
    212216                if (inlineCallFrame->isClosureCall)
    213217                    m_read(VirtualRegister(inlineCallFrame->stackOffset + CallFrameSlot::callee));
Note: See TracChangeset for help on using the changeset viewer.