Index: src/x64/lithium-x64.cc |
diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc |
index 45b15723dc7ac856ee6c7b19be4c7ea6ec524af9..c345e764564ef9d36851908476dbbb7a75c1d481 100644 |
--- a/src/x64/lithium-x64.cc |
+++ b/src/x64/lithium-x64.cc |
@@ -1887,26 +1887,27 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
ElementsKind elements_kind = instr->elements_kind(); |
bool needs_write_barrier = instr->NeedsWriteBarrier(); |
bool clobbers_key = instr->key()->representation().IsTagged(); |
- LOperand* key = (clobbers_key || needs_write_barrier) |
- ? UseTempRegister(instr->key()) |
- : UseRegisterOrConstantAtStart(instr->key()); |
- bool val_is_temp_register = |
- elements_kind == EXTERNAL_PIXEL_ELEMENTS || |
- elements_kind == EXTERNAL_FLOAT_ELEMENTS; |
- LOperand* val = (needs_write_barrier || val_is_temp_register) |
- ? UseTempRegister(instr->value()) |
- : UseRegisterAtStart(instr->value()); |
LStoreKeyed* result = NULL; |
if (!instr->is_external()) { |
ASSERT(instr->elements()->representation().IsTagged()); |
LOperand* object = NULL; |
+ LOperand* key = NULL; |
+ LOperand* val = NULL; |
if (instr->value()->representation().IsDouble()) { |
object = UseRegisterAtStart(instr->elements()); |
+ val = UseTempRegister(instr->value()); |
+ key = clobbers_key ? UseTempRegister(instr->key()) |
+ : UseRegisterOrConstantAtStart(instr->key()); |
} else { |
ASSERT(instr->value()->representation().IsTagged()); |
object = UseTempRegister(instr->elements()); |
+ val = needs_write_barrier ? UseTempRegister(instr->value()) |
+ : UseRegisterAtStart(instr->value()); |
+ key = (clobbers_key || needs_write_barrier) |
+ ? UseTempRegister(instr->key()) |
+ : UseRegisterOrConstantAtStart(instr->key()); |
} |
result = new(zone()) LStoreKeyed(object, key, val); |
@@ -1919,7 +1920,13 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
(elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
ASSERT(instr->elements()->representation().IsExternal()); |
- |
+ bool val_is_temp_register = |
+ elements_kind == EXTERNAL_PIXEL_ELEMENTS || |
+ elements_kind == EXTERNAL_FLOAT_ELEMENTS; |
+ LOperand* val = val_is_temp_register ? UseTempRegister(instr->value()) |
+ : UseRegister(instr->value()); |
+ LOperand* key = clobbers_key ? UseTempRegister(instr->key()) |
+ : UseRegisterOrConstantAtStart(instr->key()); |
LOperand* external_pointer = UseRegister(instr->elements()); |
result = new(zone()) LStoreKeyed(external_pointer, key, val); |
} |