Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index cdc464c32226e3ee2ebd40147b32c0ef953be8b7..4b68438300e32f8da20f84b9bb001ae7ba203c2b 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -2262,27 +2262,26 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { |
- Register value = ToRegister(instr->InputAt(0)); |
- Register scratch = scratch0(); |
- Register scratch2 = ToRegister(instr->TempAt(0)); |
+ Register value = ToRegister(instr->value()); |
+ Register cell = scratch0(); |
// Load the cell. |
- __ mov(scratch, Operand(Handle<Object>(instr->hydrogen()->cell()))); |
+ __ mov(cell, Operand(instr->hydrogen()->cell())); |
// If the cell we are storing to contains the hole it could have |
// been deleted from the property dictionary. In that case, we need |
// to update the property details in the property dictionary to mark |
// it as no longer deleted. |
if (instr->hydrogen()->RequiresHoleCheck()) { |
- __ ldr(scratch2, |
- FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); |
- __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
- __ cmp(scratch2, ip); |
+ // We use a temp to check the payload (CompareRoot might clobber ip). |
+ Register payload = ToRegister(instr->TempAt(0)); |
+ __ ldr(payload, FieldMemOperand(cell, JSGlobalPropertyCell::kValueOffset)); |
+ __ CompareRoot(payload, Heap::kTheHoleValueRootIndex); |
DeoptimizeIf(eq, instr->environment()); |
} |
// Store the value. |
- __ str(value, FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); |
+ __ str(value, FieldMemOperand(cell, JSGlobalPropertyCell::kValueOffset)); |
// Cells are always rescanned, so no write barrier here. |
} |