Diff
Modified: branches/dfgopt/Source/_javascript_Core/ChangeLog (116377 => 116378)
--- branches/dfgopt/Source/_javascript_Core/ChangeLog 2012-05-08 00:11:35 UTC (rev 116377)
+++ branches/dfgopt/Source/_javascript_Core/ChangeLog 2012-05-08 00:34:24 UTC (rev 116378)
@@ -1,3 +1,31 @@
+2012-05-07 Filip Pizlo <fpi...@apple.com>
+
+ DFG should support op_tear_off_arguments
+ https://bugs.webkit.org/show_bug.cgi?id=85847
+
+ Reviewed by Michael Saboff.
+
+ * 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-05 Filip Pizlo <fpi...@apple.com>
DFG should support reflective arguments access
Modified: branches/dfgopt/Source/_javascript_Core/dfg/DFGAbstractState.cpp (116377 => 116378)
--- branches/dfgopt/Source/_javascript_Core/dfg/DFGAbstractState.cpp 2012-05-08 00:11:35 UTC (rev 116377)
+++ branches/dfgopt/Source/_javascript_Core/dfg/DFGAbstractState.cpp 2012-05-08 00:34:24 UTC (rev 116378)
@@ -1065,6 +1065,7 @@
break;
case TearOffActivation:
+ case TearOffArguments:
// Does nothing that is user-visible.
break;
Modified: branches/dfgopt/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (116377 => 116378)
--- branches/dfgopt/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2012-05-08 00:11:35 UTC (rev 116377)
+++ branches/dfgopt/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2012-05-08 00:34:24 UTC (rev 116378)
@@ -2357,11 +2357,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: branches/dfgopt/Source/_javascript_Core/dfg/DFGCapabilities.h (116377 => 116378)
--- branches/dfgopt/Source/_javascript_Core/dfg/DFGCapabilities.h 2012-05-08 00:11:35 UTC (rev 116377)
+++ branches/dfgopt/Source/_javascript_Core/dfg/DFGCapabilities.h 2012-05-08 00:34:24 UTC (rev 116378)
@@ -165,6 +165,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;
@@ -201,6 +202,7 @@
case op_new_func:
case op_new_func_exp:
case op_create_arguments:
+ case op_tear_off_arguments:
return false;
default:
Modified: branches/dfgopt/Source/_javascript_Core/dfg/DFGNodeType.h (116377 => 116378)
--- branches/dfgopt/Source/_javascript_Core/dfg/DFGNodeType.h 2012-05-08 00:11:35 UTC (rev 116377)
+++ branches/dfgopt/Source/_javascript_Core/dfg/DFGNodeType.h 2012-05-08 00:34:24 UTC (rev 116378)
@@ -190,6 +190,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: branches/dfgopt/Source/_javascript_Core/dfg/DFGOperations.cpp (116377 => 116378)
--- branches/dfgopt/Source/_javascript_Core/dfg/DFGOperations.cpp 2012-05-08 00:11:35 UTC (rev 116377)
+++ branches/dfgopt/Source/_javascript_Core/dfg/DFGOperations.cpp 2012-05-08 00:34:24 UTC (rev 116378)
@@ -1041,6 +1041,12 @@
asArguments(v)->didTearOffActivation(exec->globalData(), activation);
}
+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: branches/dfgopt/Source/_javascript_Core/dfg/DFGOperations.h (116377 => 116378)
--- branches/dfgopt/Source/_javascript_Core/dfg/DFGOperations.h 2012-05-08 00:11:35 UTC (rev 116377)
+++ branches/dfgopt/Source/_javascript_Core/dfg/DFGOperations.h 2012-05-08 00:34:24 UTC (rev 116378)
@@ -157,6 +157,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: branches/dfgopt/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp (116377 => 116378)
--- branches/dfgopt/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp 2012-05-08 00:11:35 UTC (rev 116377)
+++ branches/dfgopt/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp 2012-05-08 00:34:24 UTC (rev 116378)
@@ -650,6 +650,7 @@
case CheckFunction:
case PutStructure:
case TearOffActivation:
+ case TearOffArguments:
changed |= mergeDefaultFlags(node);
break;
Modified: branches/dfgopt/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h (116377 => 116378)
--- branches/dfgopt/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h 2012-05-08 00:11:35 UTC (rev 116377)
+++ branches/dfgopt/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h 2012-05-08 00:34:24 UTC (rev 116378)
@@ -1395,6 +1395,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)
{
@@ -1608,6 +1613,11 @@
m_jit.setupArgumentsWithExecState(arg1, arg2, 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: branches/dfgopt/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp (116377 => 116378)
--- branches/dfgopt/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp 2012-05-08 00:11:35 UTC (rev 116377)
+++ branches/dfgopt/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp 2012-05-08 00:34:24 UTC (rev 116378)
@@ -3850,6 +3850,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: branches/dfgopt/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp (116377 => 116378)
--- branches/dfgopt/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp 2012-05-08 00:11:35 UTC (rev 116377)
+++ branches/dfgopt/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp 2012-05-08 00:34:24 UTC (rev 116378)
@@ -3838,6 +3838,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;