Title: [95170] trunk/Source/_javascript_Core
- Revision
- 95170
- Author
- [email protected]
- Date
- 2011-09-14 22:44:07 -0700 (Wed, 14 Sep 2011)
Log Message
DFG JIT does not leverage integer speculations on branches
https://bugs.webkit.org/show_bug.cgi?id=68140
Reviewed by Oliver Hunt.
* dfg/DFGJITCodeGenerator.cpp:
(JSC::DFG::JITCodeGenerator::isStrictInt32):
* dfg/DFGJITCodeGenerator.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compile):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (95169 => 95170)
--- trunk/Source/_javascript_Core/ChangeLog 2011-09-15 05:26:45 UTC (rev 95169)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-09-15 05:44:07 UTC (rev 95170)
@@ -1,3 +1,16 @@
+2011-09-14 Filip Pizlo <[email protected]>
+
+ DFG JIT does not leverage integer speculations on branches
+ https://bugs.webkit.org/show_bug.cgi?id=68140
+
+ Reviewed by Oliver Hunt.
+
+ * dfg/DFGJITCodeGenerator.cpp:
+ (JSC::DFG::JITCodeGenerator::isStrictInt32):
+ * dfg/DFGJITCodeGenerator.h:
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+
2011-09-14 Gavin Barraclough <[email protected]>
[n]stricteq code is bogus in JSValue32_64 JIT
Modified: trunk/Source/_javascript_Core/dfg/DFGJITCodeGenerator.cpp (95169 => 95170)
--- trunk/Source/_javascript_Core/dfg/DFGJITCodeGenerator.cpp 2011-09-15 05:26:45 UTC (rev 95169)
+++ trunk/Source/_javascript_Core/dfg/DFGJITCodeGenerator.cpp 2011-09-15 05:44:07 UTC (rev 95170)
@@ -350,6 +350,17 @@
}
}
+bool JITCodeGenerator::isStrictInt32(NodeIndex nodeIndex)
+{
+ if (isInt32Constant(nodeIndex))
+ return true;
+
+ Node& node = m_jit.graph()[nodeIndex];
+ GenerationInfo& info = m_generationInfo[node.virtualRegister()];
+
+ return info.registerFormat() == DataFormatInteger;
+}
+
bool JITCodeGenerator::isKnownInteger(NodeIndex nodeIndex)
{
if (isInt32Constant(nodeIndex))
Modified: trunk/Source/_javascript_Core/dfg/DFGJITCodeGenerator.h (95169 => 95170)
--- trunk/Source/_javascript_Core/dfg/DFGJITCodeGenerator.h 2011-09-15 05:26:45 UTC (rev 95169)
+++ trunk/Source/_javascript_Core/dfg/DFGJITCodeGenerator.h 2011-09-15 05:44:07 UTC (rev 95170)
@@ -408,6 +408,8 @@
info.spill((DataFormat)(spillFormat | DataFormatJS));
}
+ bool isStrictInt32(NodeIndex);
+
bool isKnownInteger(NodeIndex);
bool isKnownNumeric(NodeIndex);
bool isKnownCell(NodeIndex);
Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (95169 => 95170)
--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2011-09-15 05:26:45 UTC (rev 95169)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2011-09-15 05:44:07 UTC (rev 95170)
@@ -1278,6 +1278,51 @@
}
case Branch:
+ if (isStrictInt32(node.child1())) {
+ SpeculateStrictInt32Operand op(this, node.child1());
+
+ BlockIndex taken = m_jit.graph().blockIndexForBytecodeOffset(node.takenBytecodeOffset());
+ BlockIndex notTaken = m_jit.graph().blockIndexForBytecodeOffset(node.notTakenBytecodeOffset());
+
+ MacroAssembler::ResultCondition condition = MacroAssembler::NonZero;
+
+ if (taken == (m_block + 1)) {
+ condition = MacroAssembler::Zero;
+ BlockIndex tmp = taken;
+ taken = notTaken;
+ notTaken = tmp;
+ }
+
+ addBranch(m_jit.branchTest32(condition, op.gpr()), taken);
+ if (notTaken != (m_block + 1))
+ addBranch(m_jit.jump(), notTaken);
+
+ noResult(m_compileIndex);
+ break;
+ }
+ if (shouldSpeculateInteger(node.child1())) {
+ SpeculateIntegerOperand op(this, node.child1());
+
+ BlockIndex taken = m_jit.graph().blockIndexForBytecodeOffset(node.takenBytecodeOffset());
+ BlockIndex notTaken = m_jit.graph().blockIndexForBytecodeOffset(node.notTakenBytecodeOffset());
+
+ MacroAssembler::RelationalCondition condition = MacroAssembler::NotEqual;
+
+ if (taken == (m_block + 1)) {
+ condition = MacroAssembler::Equal;
+ BlockIndex tmp = taken;
+ taken = notTaken;
+ notTaken = tmp;
+ }
+
+ addBranch(m_jit.branchPtr(condition, op.gpr(), GPRInfo::tagTypeNumberRegister), taken);
+
+ if (notTaken != (m_block + 1))
+ addBranch(m_jit.jump(), notTaken);
+
+ noResult(m_compileIndex);
+ break;
+ }
emitBranch(node);
break;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes