Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (159972 => 159973)
--- trunk/Source/_javascript_Core/ChangeLog 2013-12-02 23:03:53 UTC (rev 159972)
+++ trunk/Source/_javascript_Core/ChangeLog 2013-12-02 23:17:53 UTC (rev 159973)
@@ -1,3 +1,59 @@
+2013-12-02 Filip Pizlo <[email protected]>
+
+ Baseline JIT calls to CommonSlowPaths shouldn't restore the last result
+ https://bugs.webkit.org/show_bug.cgi?id=125107
+
+ Reviewed by Mark Hahnenberg.
+
+ Just killing dead code.
+
+ * jit/JITArithmetic.cpp:
+ (JSC::JIT::emitSlow_op_negate):
+ (JSC::JIT::emitSlow_op_lshift):
+ (JSC::JIT::emitSlow_op_rshift):
+ (JSC::JIT::emitSlow_op_urshift):
+ (JSC::JIT::emitSlow_op_bitand):
+ (JSC::JIT::emitSlow_op_inc):
+ (JSC::JIT::emitSlow_op_dec):
+ (JSC::JIT::emitSlow_op_mod):
+ (JSC::JIT::emit_op_mod):
+ (JSC::JIT::compileBinaryArithOpSlowCase):
+ (JSC::JIT::emitSlow_op_div):
+ * jit/JITArithmetic32_64.cpp:
+ (JSC::JIT::emitSlow_op_negate):
+ (JSC::JIT::emitSlow_op_lshift):
+ (JSC::JIT::emitRightShiftSlowCase):
+ (JSC::JIT::emitSlow_op_bitand):
+ (JSC::JIT::emitSlow_op_bitor):
+ (JSC::JIT::emitSlow_op_bitxor):
+ (JSC::JIT::emitSlow_op_inc):
+ (JSC::JIT::emitSlow_op_dec):
+ (JSC::JIT::emitSlow_op_add):
+ (JSC::JIT::emitSlow_op_sub):
+ (JSC::JIT::emitSlow_op_mul):
+ (JSC::JIT::emitSlow_op_div):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_strcat):
+ (JSC::JIT::emitSlow_op_get_callee):
+ (JSC::JIT::emitSlow_op_create_this):
+ (JSC::JIT::emitSlow_op_to_this):
+ (JSC::JIT::emitSlow_op_to_primitive):
+ (JSC::JIT::emitSlow_op_not):
+ (JSC::JIT::emitSlow_op_bitxor):
+ (JSC::JIT::emitSlow_op_bitor):
+ (JSC::JIT::emitSlow_op_stricteq):
+ (JSC::JIT::emitSlow_op_nstricteq):
+ (JSC::JIT::emitSlow_op_to_number):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emitSlow_op_to_primitive):
+ (JSC::JIT::emitSlow_op_not):
+ (JSC::JIT::emitSlow_op_stricteq):
+ (JSC::JIT::emitSlow_op_nstricteq):
+ (JSC::JIT::emitSlow_op_to_number):
+ (JSC::JIT::emitSlow_op_get_callee):
+ (JSC::JIT::emitSlow_op_create_this):
+ (JSC::JIT::emitSlow_op_to_this):
+
2013-12-01 Filip Pizlo <[email protected]>
Stores to local captured variables should be intercepted
Modified: trunk/Source/_javascript_Core/jit/JITArithmetic.cpp (159972 => 159973)
--- trunk/Source/_javascript_Core/jit/JITArithmetic.cpp 2013-12-02 23:03:53 UTC (rev 159972)
+++ trunk/Source/_javascript_Core/jit/JITArithmetic.cpp 2013-12-02 23:17:53 UTC (rev 159973)
@@ -220,14 +220,11 @@
void JIT::emitSlow_op_negate(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int result = currentInstruction[1].u.operand;
-
linkSlowCase(iter); // 0x7fffffff check
linkSlowCase(iter); // double check
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_negate);
slowPathCall.call();
- emitGetVirtualRegister(result, regT0);
}
void JIT::emit_op_lshift(Instruction* currentInstruction)
@@ -249,13 +246,10 @@
void JIT::emitSlow_op_lshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int result = currentInstruction[1].u.operand;
-
linkSlowCase(iter);
linkSlowCase(iter);
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_lshift);
slowPathCall.call();
- emitGetVirtualRegister(result, regT0);
}
void JIT::emit_op_rshift(Instruction* currentInstruction)
@@ -295,12 +289,8 @@
void JIT::emitSlow_op_rshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int result = currentInstruction[1].u.operand;
- int op1 = currentInstruction[2].u.operand;
int op2 = currentInstruction[3].u.operand;
- UNUSED_PARAM(op1);
-
if (isOperandConstantImmediateInt(op2))
linkSlowCase(iter);
@@ -317,7 +307,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_rshift);
slowPathCall.call();
- emitGetVirtualRegister(result, regT0);
}
void JIT::emit_op_urshift(Instruction* currentInstruction)
@@ -410,7 +399,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_urshift);
slowPathCall.call();
- emitGetVirtualRegister(dst, regT0);
}
void JIT::emit_compareAndJump(OpcodeID, int op1, int op2, unsigned target, RelationalCondition condition)
@@ -587,13 +575,10 @@
void JIT::emitSlow_op_bitand(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int result = currentInstruction[1].u.operand;
-
linkSlowCase(iter);
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitand);
slowPathCall.call();
- emitGetVirtualRegister(result, regT0);
}
void JIT::emit_op_inc(Instruction* currentInstruction)
@@ -609,13 +594,10 @@
void JIT::emitSlow_op_inc(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int srcDst = currentInstruction[1].u.operand;
-
linkSlowCase(iter);
linkSlowCase(iter);
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_inc);
slowPathCall.call();
- emitGetVirtualRegister(srcDst, regT0);
}
void JIT::emit_op_dec(Instruction* currentInstruction)
@@ -631,13 +613,10 @@
void JIT::emitSlow_op_dec(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int srcDst = currentInstruction[1].u.operand;
-
linkSlowCase(iter);
linkSlowCase(iter);
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_dec);
slowPathCall.call();
- emitGetVirtualRegister(srcDst, regT0);
}
/* ------------------------------ BEGIN: OP_MOD ------------------------------ */
@@ -675,8 +654,6 @@
void JIT::emitSlow_op_mod(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int result = currentInstruction[1].u.operand;
-
linkSlowCase(iter);
linkSlowCase(iter);
linkSlowCase(iter);
@@ -684,7 +661,6 @@
linkSlowCase(iter);
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_mod);
slowPathCall.call();
- emitGetVirtualRegister(result, regT0);
}
#else // CPU(X86) || CPU(X86_64)
@@ -700,7 +676,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_mod);
slowPathCall.call();
- emitGetVirtualRegister(result, regT0);
}
void JIT::emitSlow_op_mod(Instruction*, Vector<SlowCaseEntry>::iterator&)
@@ -784,7 +759,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, opcodeID == op_add ? slow_path_add : opcodeID == op_sub ? slow_path_sub : slow_path_mul);
slowPathCall.call();
- emitGetVirtualRegister(result, regT0);
Jump end = jump();
if (op1HasImmediateIntFastCase) {
@@ -1020,7 +994,6 @@
void JIT::emitSlow_op_div(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int result = currentInstruction[1].u.operand;
int op1 = currentInstruction[2].u.operand;
int op2 = currentInstruction[3].u.operand;
OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
@@ -1041,7 +1014,6 @@
// There is an extra slow case for (op1 * -N) or (-N * op2), to check for 0 since this should produce a result of -0.
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_div);
slowPathCall.call();
- emitGetVirtualRegister(result, regT0);
}
void JIT::emit_op_sub(Instruction* currentInstruction)
Modified: trunk/Source/_javascript_Core/jit/JITArithmetic32_64.cpp (159972 => 159973)
--- trunk/Source/_javascript_Core/jit/JITArithmetic32_64.cpp 2013-12-02 23:03:53 UTC (rev 159972)
+++ trunk/Source/_javascript_Core/jit/JITArithmetic32_64.cpp 2013-12-02 23:17:53 UTC (rev 159973)
@@ -75,14 +75,11 @@
void JIT::emitSlow_op_negate(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int dst = currentInstruction[1].u.operand;
-
linkSlowCase(iter); // 0x7fffffff check
linkSlowCase(iter); // double check
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_negate);
slowPathCall.call();
- emitLoad(dst, regT1, regT0);
}
void JIT::emit_compareAndJump(OpcodeID opcode, int op1, int op2, unsigned target, RelationalCondition condition)
@@ -189,7 +186,6 @@
void JIT::emitSlow_op_lshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int dst = currentInstruction[1].u.operand;
int op1 = currentInstruction[2].u.operand;
int op2 = currentInstruction[3].u.operand;
@@ -199,7 +195,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_lshift);
slowPathCall.call();
- emitLoad(dst, regT1, regT0);
}
// RightShift (>>) and UnsignedRightShift (>>>) helper
@@ -296,7 +291,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, isUnsigned ? slow_path_urshift : slow_path_rshift);
slowPathCall.call();
- emitLoad(dst, regT1, regT0);
}
// RightShift (>>)
@@ -350,7 +344,6 @@
void JIT::emitSlow_op_bitand(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int dst = currentInstruction[1].u.operand;
int op1 = currentInstruction[2].u.operand;
int op2 = currentInstruction[3].u.operand;
@@ -360,7 +353,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitand);
slowPathCall.call();
- emitLoad(dst, regT1, regT0);
}
// BitOr (|)
@@ -390,7 +382,6 @@
void JIT::emitSlow_op_bitor(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int dst = currentInstruction[1].u.operand;
int op1 = currentInstruction[2].u.operand;
int op2 = currentInstruction[3].u.operand;
@@ -400,7 +391,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitor);
slowPathCall.call();
- emitLoad(dst, regT1, regT0);
}
// BitXor (^)
@@ -430,7 +420,6 @@
void JIT::emitSlow_op_bitxor(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int dst = currentInstruction[1].u.operand;
int op1 = currentInstruction[2].u.operand;
int op2 = currentInstruction[3].u.operand;
@@ -440,7 +429,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitxor);
slowPathCall.call();
- emitLoad(dst, regT1, regT0);
}
void JIT::emit_op_inc(Instruction* currentInstruction)
@@ -456,14 +444,11 @@
void JIT::emitSlow_op_inc(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int srcDst = currentInstruction[1].u.operand;
-
linkSlowCase(iter); // int32 check
linkSlowCase(iter); // overflow check
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_inc);
slowPathCall.call();
- emitLoad(srcDst, regT1, regT0);
}
void JIT::emit_op_dec(Instruction* currentInstruction)
@@ -479,14 +464,11 @@
void JIT::emitSlow_op_dec(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int srcDst = currentInstruction[1].u.operand;
-
linkSlowCase(iter); // int32 check
linkSlowCase(iter); // overflow check
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_dec);
slowPathCall.call();
- emitLoad(srcDst, regT1, regT0);
}
// Addition (+)
@@ -564,7 +546,6 @@
void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int dst = currentInstruction[1].u.operand;
int op1 = currentInstruction[2].u.operand;
int op2 = currentInstruction[3].u.operand;
OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
@@ -605,7 +586,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_add);
slowPathCall.call();
- emitLoad(dst, regT1, regT0);
}
// Subtraction (-)
@@ -674,7 +654,6 @@
void JIT::emitSlow_op_sub(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int dst = currentInstruction[1].u.operand;
int op2 = currentInstruction[3].u.operand;
OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
@@ -702,7 +681,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_sub);
slowPathCall.call();
- emitLoad(dst, regT1, regT0);
}
void JIT::emitBinaryDoubleOp(OpcodeID opcodeID, int dst, int op1, int op2, OperandTypes types, JumpList& notInt32Op1, JumpList& notInt32Op2, bool op1IsInRegisters, bool op2IsInRegisters)
@@ -1008,7 +986,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_mul);
slowPathCall.call();
- emitLoad(dst, regT1, regT0);
}
// Division (/)
@@ -1078,8 +1055,6 @@
void JIT::emitSlow_op_div(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int dst = currentInstruction[1].u.operand;
-
OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
if (!supportsFloatingPoint())
@@ -1096,7 +1071,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_div);
slowPathCall.call();
- emitLoad(dst, regT1, regT0);
}
// Mod (%)
Modified: trunk/Source/_javascript_Core/jit/JITOpcodes.cpp (159972 => 159973)
--- trunk/Source/_javascript_Core/jit/JITOpcodes.cpp 2013-12-02 23:03:53 UTC (rev 159972)
+++ trunk/Source/_javascript_Core/jit/JITOpcodes.cpp 2013-12-02 23:17:53 UTC (rev 159973)
@@ -323,7 +323,6 @@
{
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_strcat);
slowPathCall.call();
- emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
}
void JIT::emit_op_not(Instruction* currentInstruction)
@@ -855,7 +854,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_get_callee);
slowPathCall.call();
- emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
}
void JIT::emit_op_create_this(Instruction* currentInstruction)
@@ -883,7 +881,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_create_this);
slowPathCall.call();
- emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
}
void JIT::emit_op_profile_will_call(Instruction* currentInstruction)
@@ -909,7 +906,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_this);
slowPathCall.call();
- emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
}
void JIT::emitSlow_op_to_primitive(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
@@ -918,7 +914,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_primitive);
slowPathCall.call();
- emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
}
void JIT::emitSlow_op_not(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
@@ -927,7 +922,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_not);
slowPathCall.call();
- emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
}
void JIT::emitSlow_op_jfalse(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
@@ -949,7 +943,6 @@
linkSlowCase(iter);
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitxor);
slowPathCall.call();
- emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
}
void JIT::emitSlow_op_bitor(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
@@ -957,7 +950,6 @@
linkSlowCase(iter);
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitor);
slowPathCall.call();
- emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
}
void JIT::emitSlow_op_eq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
@@ -984,7 +976,6 @@
linkSlowCase(iter);
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_stricteq);
slowPathCall.call();
- emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
}
void JIT::emitSlow_op_nstricteq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
@@ -994,7 +985,6 @@
linkSlowCase(iter);
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_nstricteq);
slowPathCall.call();
- emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
}
void JIT::emitSlow_op_check_has_instance(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
@@ -1032,7 +1022,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_number);
slowPathCall.call();
- emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
}
void JIT::emit_op_get_arguments_length(Instruction* currentInstruction)
Modified: trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp (159972 => 159973)
--- trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp 2013-12-02 23:03:53 UTC (rev 159972)
+++ trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp 2013-12-02 23:17:53 UTC (rev 159973)
@@ -411,13 +411,10 @@
void JIT::emitSlow_op_to_primitive(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int dst = currentInstruction[1].u.operand;
-
linkSlowCase(iter);
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_primitive);
slowPathCall.call();
- emitLoad(dst, regT1, regT0, callFrameRegister);
}
void JIT::emit_op_strcat(Instruction* currentInstruction)
@@ -442,13 +439,10 @@
void JIT::emitSlow_op_not(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int dst = currentInstruction[1].u.operand;
-
linkSlowCase(iter);
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_not);
slowPathCall.call();
- emitLoad(dst, regT1, regT0, callFrameRegister);
}
void JIT::emit_op_jfalse(Instruction* currentInstruction)
@@ -706,15 +700,12 @@
void JIT::emitSlow_op_stricteq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int dst = currentInstruction[1].u.operand;
-
linkSlowCase(iter);
linkSlowCase(iter);
linkSlowCase(iter);
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_stricteq);
slowPathCall.call();
- emitLoad(dst, regT1, regT0, callFrameRegister);
}
void JIT::emit_op_nstricteq(Instruction* currentInstruction)
@@ -724,15 +715,12 @@
void JIT::emitSlow_op_nstricteq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int dst = currentInstruction[1].u.operand;
-
linkSlowCase(iter);
linkSlowCase(iter);
linkSlowCase(iter);
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_nstricteq);
slowPathCall.call();
- emitLoad(dst, regT1, regT0, callFrameRegister);
}
void JIT::emit_op_eq_null(Instruction* currentInstruction)
@@ -934,13 +922,10 @@
void JIT::emitSlow_op_to_number(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int dst = currentInstruction[1].u.operand;
-
linkSlowCase(iter);
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_number);
slowPathCall.call();
- emitLoad(dst, regT1, regT0, callFrameRegister);
}
void JIT::emit_op_push_name_scope(Instruction* currentInstruction)
@@ -1096,7 +1081,6 @@
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_get_callee);
slowPathCall.call();
- emitLoad(currentInstruction[1].u.operand, regT1, regT0);
}
void JIT::emit_op_create_this(Instruction* currentInstruction)
@@ -1119,13 +1103,11 @@
void JIT::emitSlow_op_create_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int dst = currentInstruction[1].u.operand;
linkSlowCase(iter); // doesn't have an allocation profile
linkSlowCase(iter); // allocation failed
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_create_this);
slowPathCall.call();
- emitLoad(dst, regT1, regT0);
}
void JIT::emit_op_to_this(Instruction* currentInstruction)
@@ -1144,13 +1126,11 @@
void JIT::emitSlow_op_to_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- int dst = currentInstruction[1].u.operand;
linkSlowCase(iter);
linkSlowCase(iter);
linkSlowCase(iter);
JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_this);
slowPathCall.call();
- emitLoad(dst, regT1, regT0);
}
void JIT::emit_op_profile_will_call(Instruction* currentInstruction)