diff --git a/Source/JavaScriptCore/dfg/DFGPreciseLocalClobberize.h b/Source/JavaScriptCore/dfg/DFGPreciseLocalClobberize.h index 704ebe7115b8..122ad3998196 100644 --- a/Source/JavaScriptCore/dfg/DFGPreciseLocalClobberize.h +++ b/Source/JavaScriptCore/dfg/DFGPreciseLocalClobberize.h @@ -191,13 +191,19 @@ class PreciseLocalClobberizeAdaptor { case CreateRest: { bool isForwardingNode = false; bool isPhantomNode = false; + bool mayReadArguments = false; switch (m_node->op()) { case ForwardVarargs: + // This is used iff allInlineFramesAreTailCalls, so we will + // actually do a real tail call and destroy our frame. + case TailCallForwardVarargs: + isForwardingNode = true; + break; case CallForwardVarargs: case ConstructForwardVarargs: - case TailCallForwardVarargs: case TailCallForwardVarargsInlinedCaller: isForwardingNode = true; + mayReadArguments = true; break; case PhantomDirectArguments: case PhantomClonedArguments: @@ -209,7 +215,10 @@ class PreciseLocalClobberizeAdaptor { if (isPhantomNode && m_graph.m_plan.isFTL()) break; - + + if (mayReadArguments) + readWorld(m_node); + if (isForwardingNode && m_node->hasArgumentsChild() && m_node->argumentsChild() && (m_node->argumentsChild()->op() == PhantomNewArrayWithSpread || m_node->argumentsChild()->op() == PhantomSpread)) { if (m_node->argumentsChild()->op() == PhantomNewArrayWithSpread)