Index: src/x64/lithium-x64.cc |
diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc |
index 7fa8a3999c91f797c05b4b7778d283f931f099dd..ac4d5f5d3e6ffae92863dc35d3877a663cfd1585 100644 |
--- a/src/x64/lithium-x64.cc |
+++ b/src/x64/lithium-x64.cc |
@@ -1768,11 +1768,12 @@ LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { |
LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { |
- LStoreGlobalCell* result = |
- new LStoreGlobalCell(UseTempRegister(instr->value()), |
- TempRegister(), |
- TempRegister()); |
- return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result; |
+ LOperand* value = UseRegister(instr->value()); |
+ // Use a temp to avoid reloading the cell value address in the case where |
+ // we perform a hole check. |
+ return instr->RequiresHoleCheck() |
+ ? AssignEnvironment(new LStoreGlobalCell(value, TempRegister())) |
+ : new LStoreGlobalCell(value, NULL); |
} |