Ignore:
Timestamp:
Dec 12, 2016, 1:46:45 PM (9 years ago)
Author:
[email protected]
Message:

REGRESSION(r209653): speedometer crashes making virtual slow path tailcalls
https://bugs.webkit.org/show_bug.cgi?id=165748

Reviewed by Filip Pizlo.

JSTests:

New regression test.

  • stress/regress-165748.js: Added.

(sum1):
(sum2):
(sum3):
(sum4):
(sum5):
(sum6):
(tailCaller):
(test):

Source/JavaScriptCore:

The virtual slow path for tailcalls always passes arguments on the stack.
The fix here is to link to the stack argument entrypoint instead of a register
argument entrypoint.

While fixing this bug, I found that we weren't clearing the code origin when
shuffling the call frame for a register argument tailcall.

Also rolling back in r209653, r209654, r209663, and r209673.

  • jit/CallFrameShuffler.cpp:

(JSC::CallFrameShuffler::prepareAny):

  • jit/ThunkGenerators.cpp:

(JSC::virtualThunkFor):

Source/WTF:

Rolling back in r209653, r209654, r209663, and r209673.

  • wtf/Platform.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGOSREntrypointCreationPhase.cpp

    r209678 r209725  
    113113        origin = target->at(0)->origin;
    114114       
    115         for (int argument = 0; argument < baseline->numParameters(); ++argument) {
     115        for (unsigned argument = 0; argument < static_cast<unsigned>(baseline->numParameters()); ++argument) {
    116116            Node* oldNode = target->variablesAtHead.argument(argument);
    117117            if (!oldNode) {
    118                 // Just for sanity, always have a SetArgument even if it's not needed.
    119                 oldNode = m_graph.m_arguments[argument];
     118                // Just for sanity, always have an argument node even if it's not needed.
     119                oldNode = m_graph.m_argumentsForChecking[argument];
    120120            }
    121             Node* node = newRoot->appendNode(
    122                 m_graph, SpecNone, SetArgument, origin,
    123                 OpInfo(oldNode->variableAccessData()));
    124             m_graph.m_arguments[argument] = node;
     121            Node* node;
     122            Node* stackNode;
     123            if (argument < NUMBER_OF_JS_FUNCTION_ARGUMENT_REGISTERS) {
     124                node = newRoot->appendNode(
     125                    m_graph, SpecNone, GetArgumentRegister, origin,
     126                    OpInfo(oldNode->variableAccessData()),
     127                    OpInfo(argumentRegisterIndexForJSFunctionArgument(argument)));
     128                stackNode = newRoot->appendNode(
     129                    m_graph, SpecNone, SetLocal, origin,
     130                    OpInfo(oldNode->variableAccessData()),
     131                    Edge(node));
     132            } else {
     133                node = newRoot->appendNode(
     134                    m_graph, SpecNone, SetArgument, origin,
     135                    OpInfo(oldNode->variableAccessData()));
     136                stackNode = node;
     137            }
     138
     139            m_graph.m_argumentsForChecking[argument] = node;
     140            m_graph.m_argumentsOnStack[argument] = stackNode;
    125141        }
    126142
Note: See TracChangeset for help on using the changeset viewer.