Index: src/compiler/ia32/code-generator-ia32.cc |
diff --git a/src/compiler/ia32/code-generator-ia32.cc b/src/compiler/ia32/code-generator-ia32.cc |
index 7ec7eba8111f51012561545c8547822258134412..586d5488e906c6c3777b8b2704b974671c32c205 100644 |
--- a/src/compiler/ia32/code-generator-ia32.cc |
+++ b/src/compiler/ia32/code-generator-ia32.cc |
@@ -790,13 +790,20 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
break; |
case kIA32StoreWriteBarrier: { |
Register object = i.InputRegister(0); |
- Register index = i.InputRegister(1); |
Register value = i.InputRegister(2); |
- __ mov(Operand(object, index, times_1, 0), value); |
- __ lea(index, Operand(object, index, times_1, 0)); |
SaveFPRegsMode mode = |
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs; |
- __ RecordWrite(object, index, value, mode); |
+ if (HasImmediateInput(instr, 1)) { |
+ int index = i.InputInt32(1); |
+ Register scratch = i.TempRegister(1); |
+ __ mov(Operand(object, index), value); |
+ __ RecordWriteContextSlot(object, index, value, scratch, mode); |
+ } else { |
+ Register index = i.InputRegister(1); |
+ __ mov(Operand(object, index, times_1, 0), value); |
+ __ lea(index, Operand(object, index, times_1, 0)); |
+ __ RecordWrite(object, index, value, mode); |
+ } |
break; |
} |
case kCheckedLoadInt8: |