Index: src/arm/lithium-arm.cc |
diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc |
index d3ac5e0dfebf67c4ed54481d8669852b842c1c83..0b3179449ae64f17eb5f561ec5e8a1a61a9dd794 100644 |
--- a/src/arm/lithium-arm.cc |
+++ b/src/arm/lithium-arm.cc |
@@ -2246,8 +2246,6 @@ LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { |
LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
- ElementsKind elements_kind = instr->elements_kind(); |
- |
if (!instr->is_external()) { |
ASSERT(instr->elements()->representation().IsTagged()); |
bool needs_write_barrier = instr->NeedsWriteBarrier(); |
@@ -2257,15 +2255,19 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
if (instr->value()->representation().IsDouble()) { |
object = UseRegisterAtStart(instr->elements()); |
- val = UseTempRegister(instr->value()); |
+ val = UseRegister(instr->value()); |
key = UseRegisterOrConstantAtStart(instr->key()); |
} else { |
ASSERT(instr->value()->representation().IsSmiOrTagged()); |
- object = UseTempRegister(instr->elements()); |
- val = needs_write_barrier ? UseTempRegister(instr->value()) |
- : UseRegisterAtStart(instr->value()); |
- key = needs_write_barrier ? UseTempRegister(instr->key()) |
- : UseRegisterOrConstantAtStart(instr->key()); |
+ if (needs_write_barrier) { |
+ object = UseTempRegister(instr->elements()); |
+ val = UseTempRegister(instr->value()); |
+ key = UseTempRegister(instr->key()); |
+ } else { |
+ object = UseRegisterAtStart(instr->elements()); |
+ val = UseRegisterAtStart(instr->value()); |
+ key = UseRegisterOrConstantAtStart(instr->key()); |
+ } |
} |
return new(zone()) LStoreKeyed(object, key, val); |
@@ -2273,17 +2275,13 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
ASSERT( |
(instr->value()->representation().IsInteger32() && |
- (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && |
- (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || |
+ (instr->elements_kind() != EXTERNAL_FLOAT_ELEMENTS) && |
+ (instr->elements_kind() != EXTERNAL_DOUBLE_ELEMENTS)) || |
(instr->value()->representation().IsDouble() && |
- ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
- (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
+ ((instr->elements_kind() == EXTERNAL_FLOAT_ELEMENTS) || |
+ (instr->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* val = UseRegister(instr->value()); |
LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
LOperand* external_pointer = UseRegister(instr->elements()); |
return new(zone()) LStoreKeyed(external_pointer, key, val); |