Changeset 213876 in webkit


Ignore:
Timestamp:
Mar 13, 2017 3:52:41 PM (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.

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.

Relanding after I fixed the special cases for CreateArguments-style nodes.

  • dfg/DFGPreciseLocalClobberize.h:

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

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r213873 r213876  
     12017-03-13  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        Relanding after I fixed the special cases for CreateArguments-style nodes.
     12
     13        * dfg/DFGPreciseLocalClobberize.h:
     14        (JSC::DFG::PreciseLocalClobberizeAdaptor::readTop):
     15
    1162017-03-13  Devin Rousso  <webkit@devinrousso.com>
    217
  • trunk/Source/JavaScriptCore/dfg/DFGPreciseLocalClobberize.h

    r213860 r213876  
    11/*
    2  * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    138138        };
    139139
    140         bool isForwardingNode = false;
    141140        switch (m_node->op()) {
    142141        case ForwardVarargs:
     
    145144        case TailCallForwardVarargs:
    146145        case TailCallForwardVarargsInlinedCaller:
    147             isForwardingNode = true;
    148             FALLTHROUGH;
    149146        case GetMyArgumentByVal:
    150         case GetMyArgumentByValOutOfBounds: {
    151 
     147        case GetMyArgumentByValOutOfBounds:
     148        case CreateDirectArguments:
     149        case CreateScopedArguments:
     150        case CreateClonedArguments:
     151        case PhantomDirectArguments:
     152        case PhantomClonedArguments:
     153        case GetRestLength:
     154        case CreateRest: {
     155            bool isForwardingNode = false;
     156            bool isPhantomNode = false;
     157            switch (m_node->op()) {
     158            case ForwardVarargs:
     159            case CallForwardVarargs:
     160            case ConstructForwardVarargs:
     161            case TailCallForwardVarargs:
     162            case TailCallForwardVarargsInlinedCaller:
     163                isForwardingNode = true;
     164                break;
     165            case PhantomDirectArguments:
     166            case PhantomClonedArguments:
     167                isPhantomNode = true;
     168                break;
     169            default:
     170                break;
     171            }
     172           
     173            if (isPhantomNode && isFTL(m_graph.m_plan.mode))
     174                break;
     175           
    152176            if (isForwardingNode && m_node->hasArgumentsChild() && m_node->argumentsChild() && m_node->argumentsChild()->op() == PhantomNewArrayWithSpread) {
    153177                Node* arrayWithSpread = m_node->argumentsChild().node();
     
    195219            break;
    196220        }
    197 
    198221           
    199222        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));
     223            // All of the outermost arguments, except this, are read in sloppy mode.
     224            if (!m_graph.m_codeBlock->isStrictMode()) {
     225                for (unsigned i = m_graph.m_codeBlock->numParameters(); i-- > 1;)
     226                    m_read(virtualRegisterForArgument(i));
     227            }
    203228       
    204229            // The stack header is read.
     
    208233            // Read all of the inline arguments and call frame headers that we didn't already capture.
    209234            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()));
     235                if (!inlineCallFrame->isStrictMode()) {
     236                    for (unsigned i = inlineCallFrame->arguments.size(); i-- > 1;)
     237                        m_read(VirtualRegister(inlineCallFrame->stackOffset + virtualRegisterForArgument(i).offset()));
     238                }
    212239                if (inlineCallFrame->isClosureCall)
    213240                    m_read(VirtualRegister(inlineCallFrame->stackOffset + CallFrameSlot::callee));
Note: See TracChangeset for help on using the changeset viewer.