Chromium Code Reviews| Index: src/a64/lithium-codegen-a64.cc |
| diff --git a/src/a64/lithium-codegen-a64.cc b/src/a64/lithium-codegen-a64.cc |
| index 87072f3c1d424c9f10134ed1bf48144158734d8b..691ba3777b2e05efe7262e1cc1da72f4b45e8d6f 100644 |
| --- a/src/a64/lithium-codegen-a64.cc |
| +++ b/src/a64/lithium-codegen-a64.cc |
| @@ -3472,7 +3472,16 @@ void LCodeGen::DoLoadKeyedFixed(LLoadKeyedFixed* instr) { |
| instr->hydrogen()->elements_kind()); |
| offset = FixedArray::OffsetOfElementAt(instr->additional_index()); |
| } |
| - __ Ldr(result, FieldMemOperand(load_base, offset)); |
| + Representation representation = instr->hydrogen()->representation(); |
| + |
| + if (representation.IsInteger32() && |
| + instr->hydrogen()->elements_kind() == FAST_SMI_ELEMENTS) { |
|
m.m.capewell
2014/02/07 15:56:50
Perhaps assert the format of a smi here and in sto
ulan
2014/02/07 16:08:09
Done.
|
| + __ Load(result, UntagSmiFieldMemOperand(load_base, offset), |
| + Representation::Integer32()); |
| + } else { |
| + __ Load(result, FieldMemOperand(load_base, offset), |
| + representation); |
| + } |
| if (instr->hydrogen()->RequiresHoleCheck()) { |
| if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { |
| @@ -4914,7 +4923,15 @@ void LCodeGen::DoStoreKeyedFixed(LStoreKeyedFixed* instr) { |
| instr->hydrogen()->elements_kind()); |
| offset = FixedArray::OffsetOfElementAt(instr->additional_index()); |
| } |
| - __ Str(value, FieldMemOperand(store_base, offset)); |
| + Representation representation = instr->hydrogen()->value()->representation(); |
| + if (representation.IsInteger32()) { |
| + ASSERT(instr->hydrogen()->store_mode() == STORE_TO_INITIALIZED_ENTRY); |
| + ASSERT(instr->hydrogen()->elements_kind() == FAST_SMI_ELEMENTS); |
| + __ Store(value, UntagSmiFieldMemOperand(store_base, offset), |
| + Representation::Integer32()); |
| + } else { |
| + __ Store(value, FieldMemOperand(store_base, offset), representation); |
| + } |
| if (instr->hydrogen()->NeedsWriteBarrier()) { |
| SmiCheck check_needed = |
| @@ -5003,7 +5020,15 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
| __ Ldr(temp0, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
| destination = temp0; |
| } |
| - __ Store(value, FieldMemOperand(destination, offset), representation); |
| + |
| + if (representation.IsSmi() && |
| + instr->hydrogen()->value()->representation().IsInteger32()) { |
| + ASSERT(instr->hydrogen()->store_mode() == STORE_TO_INITIALIZED_ENTRY); |
| + __ Store(value, UntagSmiFieldMemOperand(destination, offset), |
| + Representation::Integer32()); |
| + } else { |
| + __ Store(value, FieldMemOperand(destination, offset), representation); |
| + } |
| if (instr->hydrogen()->NeedsWriteBarrier()) { |
| __ RecordWriteField(destination, |
| offset, |