Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (143164 => 143165)
--- trunk/Source/_javascript_Core/ChangeLog 2013-02-18 08:59:02 UTC (rev 143164)
+++ trunk/Source/_javascript_Core/ChangeLog 2013-02-18 08:59:05 UTC (rev 143165)
@@ -1,3 +1,21 @@
+2013-02-18 Filip Pizlo <fpi...@apple.com>
+
+ Remove dead code for ValueToNumber from the DFG.
+
+ Rubber stamped by Andy Estes.
+
+ We killed ValueToNumber at some point, but forgot to kill all of the backend support
+ for it.
+
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::handleMinMax):
+ * dfg/DFGOperations.cpp:
+ * dfg/DFGOperations.h:
+ * dfg/DFGSpeculativeJIT.h:
+ (SpeculativeJIT):
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ * dfg/DFGSpeculativeJIT64.cpp:
+
2013-02-17 Csaba Osztrogonác <o...@webkit.org>
Unreviewed buildfix for JSVALUE32_64 builds after r143147.
Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (143164 => 143165)
--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2013-02-18 08:59:02 UTC (rev 143164)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2013-02-18 08:59:05 UTC (rev 143165)
@@ -1464,7 +1464,6 @@
}
if (argumentCountIncludingThis == 2) { // Math.min(x)
- // FIXME: what we'd really like is a ValueToNumber, except we don't support that right now. Oh well.
Node* result = get(registerOffset + argumentToOperand(1));
addToGraph(CheckNumber, result);
setIntrinsicResult(usesResult, resultOperand, result);
Modified: trunk/Source/_javascript_Core/dfg/DFGOperations.cpp (143164 => 143165)
--- trunk/Source/_javascript_Core/dfg/DFGOperations.cpp 2013-02-18 08:59:02 UTC (rev 143164)
+++ trunk/Source/_javascript_Core/dfg/DFGOperations.cpp 2013-02-18 08:59:05 UTC (rev 143165)
@@ -1583,14 +1583,6 @@
return dfgHandlerEncoded(handler.callFrame, handler.catchRoutine);
}
-double DFG_OPERATION dfgConvertJSValueToNumber(ExecState* exec, EncodedJSValue value)
-{
- JSGlobalData* globalData = &exec->globalData();
- NativeCallFrameTracer tracer(globalData, exec);
-
- return JSValue::decode(value).toNumber(exec);
-}
-
size_t DFG_OPERATION dfgConvertJSValueToInt32(ExecState* exec, EncodedJSValue value)
{
JSGlobalData* globalData = &exec->globalData();
Modified: trunk/Source/_javascript_Core/dfg/DFGOperations.h (143164 => 143165)
--- trunk/Source/_javascript_Core/dfg/DFGOperations.h 2013-02-18 08:59:02 UTC (rev 143164)
+++ trunk/Source/_javascript_Core/dfg/DFGOperations.h 2013-02-18 08:59:05 UTC (rev 143165)
@@ -254,8 +254,7 @@
DFGHandlerEncoded DFG_OPERATION lookupExceptionHandler(ExecState*, uint32_t) WTF_INTERNAL;
DFGHandlerEncoded DFG_OPERATION lookupExceptionHandlerInStub(ExecState*, StructureStubInfo*) WTF_INTERNAL;
-// These operations implement the implicitly called ToInt32, ToNumber, and ToBoolean conversions from ES5.
-double DFG_OPERATION dfgConvertJSValueToNumber(ExecState*, EncodedJSValue) WTF_INTERNAL;
+// These operations implement the implicitly called ToInt32 and ToBoolean conversions from ES5.
// This conversion returns an int32_t within a size_t such that the value is zero extended to fill the register.
size_t DFG_OPERATION dfgConvertJSValueToInt32(ExecState*, EncodedJSValue) WTF_INTERNAL;
size_t DFG_OPERATION dfgConvertJSValueToBoolean(ExecState*, EncodedJSValue) WTF_INTERNAL;
Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h (143164 => 143165)
--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h 2013-02-18 08:59:02 UTC (rev 143164)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h 2013-02-18 08:59:05 UTC (rev 143165)
@@ -693,7 +693,6 @@
return lastNode->op() == Branch && lastNode->child1() == m_currentNode ? block->size() - 1 : UINT_MAX;
}
- void nonSpeculativeValueToNumber(Node*);
void nonSpeculativeValueToInt32(Node*);
void nonSpeculativeUInt32ToNumber(Node*);
Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp (143164 => 143165)
--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp 2013-02-18 08:59:02 UTC (rev 143164)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp 2013-02-18 08:59:05 UTC (rev 143165)
@@ -363,77 +363,6 @@
}
}
-class ValueToNumberSlowPathGenerator
- : public CallSlowPathGenerator<MacroAssembler::Jump, D_DFGOperation_EJ, JSValueRegs> {
-public:
- ValueToNumberSlowPathGenerator(
- MacroAssembler::Jump from, SpeculativeJIT* jit,
- GPRReg resultTagGPR, GPRReg resultPayloadGPR, GPRReg jsValueTagGPR, GPRReg jsValuePayloadGPR)
- : CallSlowPathGenerator<MacroAssembler::Jump, D_DFGOperation_EJ, JSValueRegs>(
- from, jit, dfgConvertJSValueToNumber, NeedToSpill, JSValueRegs(resultTagGPR, resultPayloadGPR))
- , m_jsValueTagGPR(jsValueTagGPR)
- , m_jsValuePayloadGPR(jsValuePayloadGPR)
- {
- }
-
-protected:
- virtual void generateInternal(SpeculativeJIT* jit)
- {
- setUp(jit);
- recordCall(jit->callOperation(dfgConvertJSValueToNumber, FPRInfo::returnValueFPR, m_jsValueTagGPR, m_jsValuePayloadGPR));
- jit->boxDouble(FPRInfo::returnValueFPR, m_result.tagGPR(), m_result.payloadGPR());
- tearDown(jit);
- }
-
-private:
- GPRReg m_jsValueTagGPR;
- GPRReg m_jsValuePayloadGPR;
-};
-
-void SpeculativeJIT::nonSpeculativeValueToNumber(Node* node)
-{
- if (isKnownNumeric(node->child1().node())) {
- JSValueOperand op1(this, node->child1());
- op1.fill();
- if (op1.isDouble()) {
- FPRTemporary result(this, op1);
- m_jit.moveDouble(op1.fpr(), result.fpr());
- doubleResult(result.fpr(), node);
- } else {
- GPRTemporary resultTag(this, op1);
- GPRTemporary resultPayload(this, op1, false);
- m_jit.move(op1.tagGPR(), resultTag.gpr());
- m_jit.move(op1.payloadGPR(), resultPayload.gpr());
- jsValueResult(resultTag.gpr(), resultPayload.gpr(), node);
- }
- return;
- }
-
- JSValueOperand op1(this, node->child1());
- GPRTemporary resultTag(this, op1);
- GPRTemporary resultPayload(this, op1, false);
-
- ASSERT(!isInt32Constant(node->child1().node()));
- ASSERT(!isNumberConstant(node->child1().node()));
-
- GPRReg tagGPR = op1.tagGPR();
- GPRReg payloadGPR = op1.payloadGPR();
- GPRReg resultTagGPR = resultTag.gpr();
- GPRReg resultPayloadGPR = resultPayload.gpr();
- op1.use();
-
- JITCompiler::Jump isInteger = m_jit.branch32(MacroAssembler::Equal, tagGPR, TrustedImm32(JSValue::Int32Tag));
- JITCompiler::Jump nonNumeric = m_jit.branch32(MacroAssembler::AboveOrEqual, tagGPR, TrustedImm32(JSValue::LowestTag));
-
- isInteger.link(&m_jit);
- m_jit.move(tagGPR, resultTagGPR);
- m_jit.move(payloadGPR, resultPayloadGPR);
-
- addSlowPathGenerator(adoptPtr(new ValueToNumberSlowPathGenerator(nonNumeric, this, resultTagGPR, resultPayloadGPR, tagGPR, payloadGPR)));
-
- jsValueResult(resultTagGPR, resultPayloadGPR, node, UseChildrenCalledExplicitly);
-}
-
void SpeculativeJIT::nonSpeculativeValueToInt32(Node* node)
{
ASSERT(!isInt32Constant(node->child1().node()));
Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp (143164 => 143165)
--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp 2013-02-18 08:59:02 UTC (rev 143164)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp 2013-02-18 08:59:05 UTC (rev 143165)
@@ -363,68 +363,6 @@
}
}
-class ValueToNumberSlowPathGenerator
- : public CallSlowPathGenerator<MacroAssembler::Jump, D_DFGOperation_EJ, GPRReg> {
-public:
- ValueToNumberSlowPathGenerator(
- MacroAssembler::Jump from, SpeculativeJIT* jit,
- GPRReg resultGPR, GPRReg jsValueGPR)
- : CallSlowPathGenerator<MacroAssembler::Jump, D_DFGOperation_EJ, GPRReg>(
- from, jit, dfgConvertJSValueToNumber, NeedToSpill, resultGPR)
- , m_jsValueGPR(jsValueGPR)
- {
- }
-
-protected:
- virtual void generateInternal(SpeculativeJIT* jit)
- {
- setUp(jit);
- recordCall(jit->callOperation(dfgConvertJSValueToNumber, FPRInfo::returnValueFPR, m_jsValueGPR));
- jit->boxDouble(FPRInfo::returnValueFPR, m_result);
- tearDown(jit);
- }
-
-private:
- GPRReg m_jsValueGPR;
-};
-
-void SpeculativeJIT::nonSpeculativeValueToNumber(Node* node)
-{
- if (isKnownNumeric(node->child1().node())) {
- JSValueOperand op1(this, node->child1());
- GPRTemporary result(this, op1);
- m_jit.move(op1.gpr(), result.gpr());
- jsValueResult(result.gpr(), m_currentNode);
- return;
- }
-
- JSValueOperand op1(this, node->child1());
- GPRTemporary result(this);
-
- ASSERT(!isInt32Constant(node->child1().node()));
- ASSERT(!isNumberConstant(node->child1().node()));
-
- GPRReg jsValueGpr = op1.gpr();
- GPRReg gpr = result.gpr();
- op1.use();
-
- JITCompiler::Jump isInteger = m_jit.branch64(MacroAssembler::AboveOrEqual, jsValueGpr, GPRInfo::tagTypeNumberRegister);
- JITCompiler::Jump nonNumeric = m_jit.branchTest64(MacroAssembler::Zero, jsValueGpr, GPRInfo::tagTypeNumberRegister);
-
- // First, if we get here we have a double encoded as a JSValue
- m_jit.move(jsValueGpr, gpr);
- JITCompiler::Jump hasUnboxedDouble = m_jit.jump();
-
- // Finally, handle integers.
- isInteger.link(&m_jit);
- m_jit.or64(GPRInfo::tagTypeNumberRegister, jsValueGpr, gpr);
- hasUnboxedDouble.link(&m_jit);
-
- addSlowPathGenerator(adoptPtr(new ValueToNumberSlowPathGenerator(nonNumeric, this, gpr, jsValueGpr)));
-
- jsValueResult(result.gpr(), m_currentNode, UseChildrenCalledExplicitly);
-}
-
void SpeculativeJIT::nonSpeculativeValueToInt32(Node* node)
{
ASSERT(!isInt32Constant(node->child1().node()));