Chromium Code Reviews| Index: src/x64/lithium-x64.cc |
| diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc |
| index 9a300b396924eca9c3596aa5ec0c33a0dde5fc8d..9cb82e790a5db816985d30e04126b515f6dc2e06 100644 |
| --- a/src/x64/lithium-x64.cc |
| +++ b/src/x64/lithium-x64.cc |
| @@ -1838,16 +1838,13 @@ LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { |
| ASSERT(instr->key()->representation().IsInteger32() || |
| instr->key()->representation().IsTagged()); |
| ElementsKind elements_kind = instr->elements_kind(); |
| - bool clobbers_key = instr->key()->representation().IsTagged(); |
| + bool clobbers_key = ArrayOpClobbersKey<HLoadKeyed>(instr); |
| LOperand* key = clobbers_key |
| ? UseTempRegister(instr->key()) |
| : UseRegisterOrConstantAtStart(instr->key()); |
| - LLoadKeyed* result = NULL; |
| - |
| - if (!instr->is_external()) { |
| - LOperand* obj = UseRegisterAtStart(instr->elements()); |
| - result = new(zone()) LLoadKeyed(obj, key); |
| - } else { |
| + LOperand* elements = UseRegisterAtStart(instr->elements()); |
| + LLoadKeyed* result = new(zone()) LLoadKeyed(elements, key); |
| + if (instr->is_external()) { |
|
danno
2012/11/07 22:34:38
Wrap this in #if DEBUG like you did elsewhere?
mvstanton
2012/11/09 09:43:13
Done.
|
| ASSERT( |
| (instr->representation().IsInteger32() && |
| (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && |
| @@ -1855,8 +1852,6 @@ LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { |
| (instr->representation().IsDouble() && |
| ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
| (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
| - LOperand* external_pointer = UseRegister(instr->elements()); |
| - result = new(zone()) LLoadKeyed(external_pointer, key); |
| } |
| DefineAsRegister(result); |
| @@ -1878,33 +1873,21 @@ LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { |
| LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
| - ElementsKind elements_kind = instr->elements_kind(); |
| bool needs_write_barrier = instr->NeedsWriteBarrier(); |
| - bool clobbers_key = instr->key()->representation().IsTagged(); |
| + bool clobbers_key = ArrayOpClobbersKey<HStoreKeyed>(instr); |
| 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) |
| + LOperand* val = needs_write_barrier |
| ? UseTempRegister(instr->value()) |
| : UseRegisterAtStart(instr->value()); |
| - LStoreKeyed* result = NULL; |
| + LOperand* elements = UseRegisterAtStart(instr->elements()); |
| +#ifdef DEBUG |
| if (!instr->is_external()) { |
| ASSERT(instr->elements()->representation().IsTagged()); |
| - |
| - LOperand* object = NULL; |
| - if (instr->value()->representation().IsDouble()) { |
| - object = UseRegisterAtStart(instr->elements()); |
| - } else { |
| - ASSERT(instr->value()->representation().IsTagged()); |
| - object = UseTempRegister(instr->elements()); |
| - } |
| - |
| - result = new(zone()) LStoreKeyed(object, key, val); |
| } else { |
| + ElementsKind elements_kind = instr->elements_kind(); |
| ASSERT( |
| (instr->value()->representation().IsInteger32() && |
| (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && |
| @@ -1913,11 +1896,10 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
| ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
| (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
| ASSERT(instr->elements()->representation().IsExternal()); |
| - |
| - LOperand* external_pointer = UseRegister(instr->elements()); |
| - result = new(zone()) LStoreKeyed(external_pointer, key, val); |
| } |
| +#endif |
| + LStoreKeyed* result = new(zone()) LStoreKeyed(elements, key, val); |
| ASSERT(result != NULL); |
| return result; |
| } |