Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (118101 => 118102)
--- trunk/Source/_javascript_Core/ChangeLog 2012-05-23 02:30:58 UTC (rev 118101)
+++ trunk/Source/_javascript_Core/ChangeLog 2012-05-23 02:34:13 UTC (rev 118102)
@@ -1,3 +1,33 @@
+2012-05-07 Filip Pizlo <[email protected]>
+
+ DFG should support op_tear_off_arguments
+ https://bugs.webkit.org/show_bug.cgi?id=85847
+
+ Reviewed by Michael Saboff.
+
+ Merged r116378 from dfgopt.
+
+ * dfg/DFGAbstractState.cpp:
+ (JSC::DFG::AbstractState::execute):
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::parseBlock):
+ * dfg/DFGCapabilities.h:
+ (JSC::DFG::canCompileOpcode):
+ (JSC::DFG::canInlineOpcode):
+ * dfg/DFGNodeType.h:
+ (DFG):
+ * dfg/DFGOperations.cpp:
+ * dfg/DFGOperations.h:
+ * dfg/DFGPredictionPropagationPhase.cpp:
+ (JSC::DFG::PredictionPropagationPhase::propagate):
+ * dfg/DFGSpeculativeJIT.h:
+ (SpeculativeJIT):
+ (JSC::DFG::SpeculativeJIT::callOperation):
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+
2012-05-22 Mark Hahnenberg <[email protected]>
CopiedSpace::contains doesn't check for oversize blocks
Modified: trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp (118101 => 118102)
--- trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp 2012-05-23 02:30:58 UTC (rev 118101)
+++ trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp 2012-05-23 02:34:13 UTC (rev 118102)
@@ -1064,6 +1064,7 @@
break;
case TearOffActivation:
+ case TearOffArguments:
// Does nothing that is user-visible.
break;
Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (118101 => 118102)
--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2012-05-23 02:30:58 UTC (rev 118101)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2012-05-23 02:34:13 UTC (rev 118102)
@@ -2378,11 +2378,15 @@
}
case op_tear_off_activation: {
- // This currently ignores arguments because we don't support them yet.
addToGraph(TearOffActivation, OpInfo(unmodifiedArgumentsRegister(currentInstruction[2].u.operand)), get(currentInstruction[1].u.operand), get(currentInstruction[2].u.operand));
NEXT_OPCODE(op_tear_off_activation);
}
+ case op_tear_off_arguments: {
+ addToGraph(TearOffArguments, get(unmodifiedArgumentsRegister(currentInstruction[1].u.operand)));
+ NEXT_OPCODE(op_tear_off_arguments);
+ }
+
case op_new_func: {
if (!currentInstruction[3].u.operand) {
set(currentInstruction[1].u.operand,
Modified: trunk/Source/_javascript_Core/dfg/DFGCapabilities.h (118101 => 118102)
--- trunk/Source/_javascript_Core/dfg/DFGCapabilities.h 2012-05-23 02:30:58 UTC (rev 118101)
+++ trunk/Source/_javascript_Core/dfg/DFGCapabilities.h 2012-05-23 02:34:13 UTC (rev 118102)
@@ -164,6 +164,7 @@
case op_create_activation:
case op_tear_off_activation:
case op_create_arguments:
+ case op_tear_off_arguments:
case op_new_func:
case op_new_func_exp:
return true;
@@ -200,6 +201,7 @@
case op_new_func:
case op_new_func_exp:
case op_create_arguments:
+ case op_tear_off_arguments:
return false;
default:
Modified: trunk/Source/_javascript_Core/dfg/DFGNodeType.h (118101 => 118102)
--- trunk/Source/_javascript_Core/dfg/DFGNodeType.h 2012-05-23 02:30:58 UTC (rev 118101)
+++ trunk/Source/_javascript_Core/dfg/DFGNodeType.h 2012-05-23 02:34:13 UTC (rev 118102)
@@ -194,6 +194,7 @@
/* Nodes used for arguments. Similar to activation support, only it makes even less */\
/* sense. */\
macro(CreateArguments, NodeResultJS) \
+ macro(TearOffArguments, NodeMustGenerate) \
\
/* Nodes for creating functions. */\
macro(NewFunctionNoCheck, NodeResultJS) \
Modified: trunk/Source/_javascript_Core/dfg/DFGOperations.cpp (118101 => 118102)
--- trunk/Source/_javascript_Core/dfg/DFGOperations.cpp 2012-05-23 02:30:58 UTC (rev 118101)
+++ trunk/Source/_javascript_Core/dfg/DFGOperations.cpp 2012-05-23 02:34:13 UTC (rev 118102)
@@ -1060,6 +1060,12 @@
}
+void DFG_OPERATION operationTearOffArguments(ExecState* exec, JSCell* argumentsCell)
+{
+ ASSERT(exec->codeBlock()->usesArguments() && !exec->codeBlock()->needsFullScopeChain());
+ asArguments(argumentsCell)->tearOff(exec);
+}
+
JSCell* DFG_OPERATION operationNewFunction(ExecState* exec, JSCell* functionExecutable)
{
ASSERT(functionExecutable->inherits(&FunctionExecutable::s_info));
Modified: trunk/Source/_javascript_Core/dfg/DFGOperations.h (118101 => 118102)
--- trunk/Source/_javascript_Core/dfg/DFGOperations.h 2012-05-23 02:30:58 UTC (rev 118101)
+++ trunk/Source/_javascript_Core/dfg/DFGOperations.h 2012-05-23 02:34:13 UTC (rev 118102)
@@ -156,6 +156,7 @@
JSCell* DFG_OPERATION operationCreateActivation(ExecState*);
JSCell* DFG_OPERATION operationCreateArguments(ExecState*);
void DFG_OPERATION operationTearOffActivation(ExecState*, JSCell*, int32_t unmodifiedArgumentsRegister);
+void DFG_OPERATION operationTearOffArguments(ExecState*, JSCell*);
JSCell* DFG_OPERATION operationNewFunction(ExecState*, JSCell*);
JSCell* DFG_OPERATION operationNewFunctionExpression(ExecState*, JSCell*);
double DFG_OPERATION operationFModOnInts(int32_t, int32_t);
Modified: trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp (118101 => 118102)
--- trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp 2012-05-23 02:30:58 UTC (rev 118101)
+++ trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp 2012-05-23 02:34:13 UTC (rev 118102)
@@ -650,6 +650,7 @@
case CheckFunction:
case PutStructure:
case TearOffActivation:
+ case TearOffArguments:
case CheckNumber:
changed |= mergeDefaultFlags(node);
break;
Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h (118101 => 118102)
--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h 2012-05-23 02:30:58 UTC (rev 118101)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h 2012-05-23 02:34:13 UTC (rev 118102)
@@ -1383,6 +1383,11 @@
m_jit.setupArgumentsWithExecState(arg1, TrustedImm32(arg2));
return appendCallWithExceptionCheck(operation);
}
+ template<typename FunctionType, typename ArgumentType1>
+ JITCompiler::Call callOperation(FunctionType operation, NoResultTag, ArgumentType1 arg1)
+ {
+ return callOperation(operation, arg1);
+ }
template<typename FunctionType, typename ArgumentType1, typename ArgumentType2>
JITCompiler::Call callOperation(FunctionType operation, NoResultTag, ArgumentType1 arg1, ArgumentType2 arg2)
{
@@ -1606,6 +1611,11 @@
m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3Payload, arg3Tag);
return appendCallWithExceptionCheck(operation);
}
+ template<typename FunctionType, typename ArgumentType1>
+ JITCompiler::Call callOperation(FunctionType operation, NoResultTag, ArgumentType1 arg1)
+ {
+ return callOperation(operation, arg1);
+ }
template<typename FunctionType, typename ArgumentType1, typename ArgumentType2>
JITCompiler::Call callOperation(FunctionType operation, NoResultTag, ArgumentType1 arg1, ArgumentType2 arg2)
{
Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp (118101 => 118102)
--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp 2012-05-23 02:30:58 UTC (rev 118101)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp 2012-05-23 02:34:13 UTC (rev 118102)
@@ -3792,6 +3792,22 @@
break;
}
+ case TearOffArguments: {
+ JSValueOperand argumentsValue(this, node.child1());
+ GPRReg argumentsValueTagGPR = argumentsValue.tagGPR();
+ GPRReg argumentsValuePayloadGPR = argumentsValue.payloadGPR();
+
+ JITCompiler::Jump created = m_jit.branch32(
+ JITCompiler::NotEqual, argumentsValueTagGPR, TrustedImm32(JSValue::EmptyValueTag));
+
+ addSlowPathGenerator(
+ slowPathCall(
+ created, this, operationTearOffArguments, NoResult, argumentsValuePayloadGPR));
+
+ noResult(m_compileIndex);
+ break;
+ }
+
case NewFunctionNoCheck:
compileNewFunctionNoCheck(node);
break;
Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp (118101 => 118102)
--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp 2012-05-23 02:30:58 UTC (rev 118101)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp 2012-05-23 02:34:13 UTC (rev 118102)
@@ -3807,6 +3807,20 @@
break;
}
+ case TearOffArguments: {
+ JSValueOperand argumentsValue(this, node.child1());
+ GPRReg argumentsValueGPR = argumentsValue.gpr();
+
+ JITCompiler::Jump created = m_jit.branchTestPtr(JITCompiler::NonZero, argumentsValueGPR);
+
+ addSlowPathGenerator(
+ slowPathCall(
+ created, this, operationTearOffArguments, NoResult, argumentsValueGPR));
+
+ noResult(m_compileIndex);
+ break;
+ }
+
case NewFunctionNoCheck:
compileNewFunctionNoCheck(node);
break;