Modified: trunk/Source/_javascript_Core/ChangeLog (193997 => 193998)
--- trunk/Source/_javascript_Core/ChangeLog 2015-12-12 01:21:52 UTC (rev 193997)
+++ trunk/Source/_javascript_Core/ChangeLog 2015-12-12 01:32:43 UTC (rev 193998)
@@ -1,3 +1,21 @@
+2015-12-11 Mark Lam <[email protected]>
+
+ Removed some dead code, and simplified some code in the baseline JIT.
+ https://bugs.webkit.org/show_bug.cgi?id=152199
+
+ Reviewed by Benjamin Poulain.
+
+ * jit/JIT.h:
+ * jit/JITArithmetic.cpp:
+ (JSC::JIT::emitBitBinaryOpFastPath):
+ (JSC::JIT::emit_op_bitand):
+ (JSC::JIT::emitSlow_op_lshift):
+ (JSC::JIT::emitRightShiftFastPath):
+ (JSC::JIT::emit_op_rshift):
+ (JSC::JIT::emitSlow_op_rshift):
+ (JSC::JIT::emit_op_urshift):
+ (JSC::JIT::emitSlow_op_urshift):
+
2015-12-11 Filip Pizlo <[email protected]>
B3::reduceStrength should remove redundant Phi's
Modified: trunk/Source/_javascript_Core/jit/JIT.h (193997 => 193998)
--- trunk/Source/_javascript_Core/jit/JIT.h 2015-12-12 01:21:52 UTC (rev 193997)
+++ trunk/Source/_javascript_Core/jit/JIT.h 2015-12-12 01:32:43 UTC (rev 193998)
@@ -833,11 +833,7 @@
template<typename SnippetGenerator>
void emitBitBinaryOpFastPath(Instruction* currentInstruction);
- enum RightShiftType {
- SignedShift,
- UnsignedShift
- };
- void emitRightShiftFastPath(Instruction* currentInstruction, RightShiftType);
+ void emitRightShiftFastPath(Instruction* currentInstruction, OpcodeID);
Jump checkStructure(RegisterID reg, Structure* structure);
Modified: trunk/Source/_javascript_Core/jit/JITArithmetic.cpp (193997 => 193998)
--- trunk/Source/_javascript_Core/jit/JITArithmetic.cpp 2015-12-12 01:21:52 UTC (rev 193997)
+++ trunk/Source/_javascript_Core/jit/JITArithmetic.cpp 2015-12-12 01:32:43 UTC (rev 193998)
@@ -536,17 +536,11 @@
gen.generateFastPath(*this);
- if (gen.didEmitFastPath()) {
- gen.endJumpList().link(this);
- emitPutVirtualRegister(result, resultRegs);
+ ASSERT(gen.didEmitFastPath());
+ gen.endJumpList().link(this);
+ emitPutVirtualRegister(result, resultRegs);
- addSlowCase(gen.slowPathJumpList());
- } else {
- ASSERT(gen.endJumpList().empty());
- ASSERT(gen.slowPathJumpList().empty());
- JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_add);
- slowPathCall.call();
- }
+ addSlowCase(gen.slowPathJumpList());
}
void JIT::emit_op_bitand(Instruction* currentInstruction)
@@ -601,8 +595,13 @@
slowPathCall.call();
}
-void JIT::emitRightShiftFastPath(Instruction* currentInstruction, RightShiftType rightShiftType)
+void JIT::emitRightShiftFastPath(Instruction* currentInstruction, OpcodeID opcodeID)
{
+ ASSERT(opcodeID == op_rshift || opcodeID == op_urshift);
+
+ JITRightShiftGenerator::ShiftType snippetShiftType = opcodeID == op_rshift ?
+ JITRightShiftGenerator::SignedShift : JITRightShiftGenerator::UnsignedShift;
+
int result = currentInstruction[1].u.operand;
int op1 = currentInstruction[2].u.operand;
int op2 = currentInstruction[3].u.operand;
@@ -636,30 +635,21 @@
if (!rightOperand.isConst())
emitGetVirtualRegister(op2, rightRegs);
- JITRightShiftGenerator::ShiftType snippetShiftType =
- (rightShiftType == SignedShift) ? JITRightShiftGenerator::SignedShift : JITRightShiftGenerator::UnsignedShift;
-
JITRightShiftGenerator gen(leftOperand, rightOperand, resultRegs, leftRegs, rightRegs,
fpRegT0, scratchGPR, scratchFPR, snippetShiftType);
gen.generateFastPath(*this);
- if (gen.didEmitFastPath()) {
- gen.endJumpList().link(this);
- emitPutVirtualRegister(result, resultRegs);
+ ASSERT(gen.didEmitFastPath());
+ gen.endJumpList().link(this);
+ emitPutVirtualRegister(result, resultRegs);
- addSlowCase(gen.slowPathJumpList());
- } else {
- ASSERT(gen.endJumpList().empty());
- ASSERT(gen.slowPathJumpList().empty());
- JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_add);
- slowPathCall.call();
- }
+ addSlowCase(gen.slowPathJumpList());
}
void JIT::emit_op_rshift(Instruction* currentInstruction)
{
- emitRightShiftFastPath(currentInstruction, RightShiftType::SignedShift);
+ emitRightShiftFastPath(currentInstruction, op_rshift);
}
void JIT::emitSlow_op_rshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
@@ -672,7 +662,7 @@
void JIT::emit_op_urshift(Instruction* currentInstruction)
{
- emitRightShiftFastPath(currentInstruction, RightShiftType::UnsignedShift);
+ emitRightShiftFastPath(currentInstruction, op_urshift);
}
void JIT::emitSlow_op_urshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)