Index: src/crankshaft/ia32/lithium-codegen-ia32.cc |
diff --git a/src/crankshaft/ia32/lithium-codegen-ia32.cc b/src/crankshaft/ia32/lithium-codegen-ia32.cc |
index 00761c4857a6467208403bd16cb59253dc4fec50..f806e462f0edd04858c9515ec0cd9949cea01122 100644 |
--- a/src/crankshaft/ia32/lithium-codegen-ia32.cc |
+++ b/src/crankshaft/ia32/lithium-codegen-ia32.cc |
@@ -3075,6 +3075,17 @@ void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr) { |
Register tmp = input_reg.is(eax) ? ecx : eax; |
Register tmp2 = tmp.is(ecx) ? edx : input_reg.is(ecx) ? edx : ecx; |
+ // Make sure that the context isn't overwritten in the AllocateHeapNumber |
+ // macro below. |
+ if (instr->context()->IsRegister()) { |
+ Register context_reg = ToRegister(instr->context()); |
+ if (tmp.is(context_reg)) { |
+ tmp = ebx; |
+ } else if (tmp2.is(context_reg)) { |
+ tmp2 = ebx; |
+ } |
+ } |
Jarin
2016/06/03 13:54:56
It is not obvious that tmp/tmp2 cannot alias the i
epertoso
2016/06/03 15:39:06
Changed it a bit. Feel free to Commit if you still
|
+ |
// Preserve the value of all registers. |
PushSafepointRegistersScope scope(this); |