- Revision
- 194042
- Author
- [email protected]
- Date
- 2015-12-14 11:44:56 -0800 (Mon, 14 Dec 2015)
Log Message
Misc. small fixes in snippet related code.
https://bugs.webkit.org/show_bug.cgi?id=152259
Reviewed by Saam Barati.
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithMul):
- When loading a constant JSValue for a node, use the one that the node already
provides instead of reconstructing it. This is not a bug, but the fix makes
the code cleaner.
* jit/JITBitAndGenerator.cpp:
(JSC::JITBitAndGenerator::generateFastPath):
- No need to do a bitand with a constant int 0xffffffff operand.
* jit/JITBitOrGenerator.cpp:
(JSC::JITBitOrGenerator::generateFastPath):
- Fix comments: bitor is '|', not '&'.
- No need to do a bitor with a constant int 0 operand.
* jit/JITBitXorGenerator.cpp:
(JSC::JITBitXorGenerator::generateFastPath):
- Fix comments: bitxor is '^', not '&'.
* jit/JITRightShiftGenerator.cpp:
(JSC::JITRightShiftGenerator::generateFastPath):
- Renamed a jump target name to be clearer about its purpose.
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (194041 => 194042)
--- trunk/Source/_javascript_Core/ChangeLog 2015-12-14 19:41:45 UTC (rev 194041)
+++ trunk/Source/_javascript_Core/ChangeLog 2015-12-14 19:44:56 UTC (rev 194042)
@@ -1,5 +1,35 @@
2015-12-14 Mark Lam <[email protected]>
+ Misc. small fixes in snippet related code.
+ https://bugs.webkit.org/show_bug.cgi?id=152259
+
+ Reviewed by Saam Barati.
+
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::compileArithMul):
+ - When loading a constant JSValue for a node, use the one that the node already
+ provides instead of reconstructing it. This is not a bug, but the fix makes
+ the code cleaner.
+
+ * jit/JITBitAndGenerator.cpp:
+ (JSC::JITBitAndGenerator::generateFastPath):
+ - No need to do a bitand with a constant int 0xffffffff operand.
+
+ * jit/JITBitOrGenerator.cpp:
+ (JSC::JITBitOrGenerator::generateFastPath):
+ - Fix comments: bitor is '|', not '&'.
+ - No need to do a bitor with a constant int 0 operand.
+
+ * jit/JITBitXorGenerator.cpp:
+ (JSC::JITBitXorGenerator::generateFastPath):
+ - Fix comments: bitxor is '^', not '&'.
+
+ * jit/JITRightShiftGenerator.cpp:
+ (JSC::JITRightShiftGenerator::generateFastPath):
+ - Renamed a jump target name to be clearer about its purpose.
+
+2015-12-14 Mark Lam <[email protected]>
+
We should not employ the snippet code in the DFG if no OSR exit was previously encountered.
https://bugs.webkit.org/show_bug.cgi?id=152255
Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (194041 => 194042)
--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2015-12-14 19:41:45 UTC (rev 194041)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2015-12-14 19:44:56 UTC (rev 194042)
@@ -3578,12 +3578,10 @@
if (leftOperand.isPositiveConstInt32()) {
leftRegs = resultRegs;
- int64_t leftConst = leftOperand.asConstInt32();
- m_jit.moveValue(JSValue(leftConst), leftRegs);
+ m_jit.moveValue(leftChild->asJSValue(), leftRegs);
} else if (rightOperand.isPositiveConstInt32()) {
rightRegs = resultRegs;
- int64_t rightConst = rightOperand.asConstInt32();
- m_jit.moveValue(JSValue(rightConst), rightRegs);
+ m_jit.moveValue(rightChild->asJSValue(), rightRegs);
}
callOperation(operationValueMul, resultRegs, leftRegs, rightRegs);
Modified: trunk/Source/_javascript_Core/jit/JITBitAndGenerator.cpp (194041 => 194042)
--- trunk/Source/_javascript_Core/jit/JITBitAndGenerator.cpp 2015-12-14 19:41:45 UTC (rev 194041)
+++ trunk/Source/_javascript_Core/jit/JITBitAndGenerator.cpp 2015-12-14 19:44:56 UTC (rev 194042)
@@ -52,14 +52,16 @@
m_slowPathJumpList.append(jit.branchIfNotInt32(var));
jit.moveValueRegs(var, m_result);
+ if (constOpr.asConstInt32() != static_cast<int32_t>(0xffffffff)) {
#if USE(JSVALUE64)
- jit.and64(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
- if (constOpr.asConstInt32() >= 0)
- jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
+ jit.and64(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
+ if (constOpr.asConstInt32() >= 0)
+ jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
#else
- jit.and32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
+ jit.and32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
#endif
-
+ }
+
} else {
ASSERT(!m_leftOperand.isConstInt32() && !m_rightOperand.isConstInt32());
Modified: trunk/Source/_javascript_Core/jit/JITBitOrGenerator.cpp (194041 => 194042)
--- trunk/Source/_javascript_Core/jit/JITBitOrGenerator.cpp 2015-12-14 19:41:45 UTC (rev 194041)
+++ trunk/Source/_javascript_Core/jit/JITBitOrGenerator.cpp 2015-12-14 19:44:56 UTC (rev 194042)
@@ -40,21 +40,23 @@
JSValueRegs var = m_leftOperand.isConstInt32() ? m_right : m_left;
SnippetOperand& constOpr = m_leftOperand.isConstInt32() ? m_leftOperand : m_rightOperand;
- // Try to do intVar & intConstant.
+ // Try to do intVar | intConstant.
m_slowPathJumpList.append(jit.branchIfNotInt32(var));
jit.moveValueRegs(var, m_result);
+ if (constOpr.asConstInt32()) {
#if USE(JSVALUE64)
- jit.or32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
- jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
+ jit.or32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
+ jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
#else
- jit.or32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
+ jit.or32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
#endif
-
+ }
+
} else {
ASSERT(!m_leftOperand.isConstInt32() && !m_rightOperand.isConstInt32());
- // Try to do intVar & intVar.
+ // Try to do intVar | intVar.
m_slowPathJumpList.append(jit.branchIfNotInt32(m_left));
m_slowPathJumpList.append(jit.branchIfNotInt32(m_right));
Modified: trunk/Source/_javascript_Core/jit/JITBitXorGenerator.cpp (194041 => 194042)
--- trunk/Source/_javascript_Core/jit/JITBitXorGenerator.cpp 2015-12-14 19:41:45 UTC (rev 194041)
+++ trunk/Source/_javascript_Core/jit/JITBitXorGenerator.cpp 2015-12-14 19:44:56 UTC (rev 194042)
@@ -40,7 +40,7 @@
JSValueRegs var = m_leftOperand.isConstInt32() ? m_right : m_left;
SnippetOperand& constOpr = m_leftOperand.isConstInt32() ? m_leftOperand : m_rightOperand;
- // Try to do intVar & intConstant.
+ // Try to do intVar ^ intConstant.
m_slowPathJumpList.append(jit.branchIfNotInt32(var));
jit.moveValueRegs(var, m_result);
@@ -54,7 +54,7 @@
} else {
ASSERT(!m_leftOperand.isConstInt32() && !m_rightOperand.isConstInt32());
- // Try to do intVar & intVar.
+ // Try to do intVar ^ intVar.
m_slowPathJumpList.append(jit.branchIfNotInt32(m_left));
m_slowPathJumpList.append(jit.branchIfNotInt32(m_right));
Modified: trunk/Source/_javascript_Core/jit/JITRightShiftGenerator.cpp (194041 => 194042)
--- trunk/Source/_javascript_Core/jit/JITRightShiftGenerator.cpp 2015-12-14 19:41:45 UTC (rev 194041)
+++ trunk/Source/_javascript_Core/jit/JITRightShiftGenerator.cpp 2015-12-14 19:44:56 UTC (rev 194042)
@@ -87,14 +87,14 @@
// Try to do (intConstant >> intVar) or (intVar >> intVar).
m_slowPathJumpList.append(jit.branchIfNotInt32(m_right));
- CCallHelpers::Jump notInt;
+ CCallHelpers::Jump leftNotInt;
if (m_leftOperand.isConstInt32()) {
#if USE(JSVALUE32_64)
jit.move(m_right.tagGPR(), m_result.tagGPR());
#endif
jit.move(CCallHelpers::Imm32(m_leftOperand.asConstInt32()), m_result.payloadGPR());
} else {
- notInt = jit.branchIfNotInt32(m_left);
+ leftNotInt = jit.branchIfNotInt32(m_left);
jit.moveValueRegs(m_left, m_result);
}
@@ -112,7 +112,7 @@
m_endJumpList.append(jit.jump()); // Terminate the above case before emitting more code.
// Try to do (doubleVar >> intVar).
- notInt.link(&jit);
+ leftNotInt.link(&jit);
m_slowPathJumpList.append(jit.branchIfNotNumber(m_left, m_scratchGPR));
jit.unboxDoubleNonDestructive(m_left, m_leftFPR, m_scratchGPR, m_scratchFPR);
@@ -125,7 +125,7 @@
jit.boxInt32(m_scratchGPR, m_result);
} else
- m_slowPathJumpList.append(notInt);
+ m_slowPathJumpList.append(leftNotInt);
}
}