OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "arm/lithium-codegen-arm.h" | 7 #include "arm/lithium-codegen-arm.h" |
8 #include "arm/lithium-gap-resolver-arm.h" | 8 #include "arm/lithium-gap-resolver-arm.h" |
9 #include "code-stubs.h" | 9 #include "code-stubs.h" |
10 #include "stub-cache.h" | 10 #include "stub-cache.h" |
(...skipping 4051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4062 HObjectAccess access = instr->hydrogen()->access(); | 4062 HObjectAccess access = instr->hydrogen()->access(); |
4063 int offset = access.offset(); | 4063 int offset = access.offset(); |
4064 | 4064 |
4065 if (access.IsExternalMemory()) { | 4065 if (access.IsExternalMemory()) { |
4066 Register value = ToRegister(instr->value()); | 4066 Register value = ToRegister(instr->value()); |
4067 MemOperand operand = MemOperand(object, offset); | 4067 MemOperand operand = MemOperand(object, offset); |
4068 __ Store(value, operand, representation); | 4068 __ Store(value, operand, representation); |
4069 return; | 4069 return; |
4070 } | 4070 } |
4071 | 4071 |
4072 __ AssertNotSmi(object); | 4072 SmiCheck check_needed = |
| 4073 instr->hydrogen()->value()->IsHeapObject() |
| 4074 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
4073 | 4075 |
4074 ASSERT(!representation.IsSmi() || | 4076 ASSERT(!(representation.IsSmi() && |
4075 !instr->value()->IsConstantOperand() || | 4077 instr->value()->IsConstantOperand() && |
4076 IsSmi(LConstantOperand::cast(instr->value()))); | 4078 !IsSmi(LConstantOperand::cast(instr->value())))); |
4077 if (representation.IsDouble()) { | 4079 if (representation.IsHeapObject()) { |
| 4080 Register value = ToRegister(instr->value()); |
| 4081 if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
| 4082 __ SmiTst(value); |
| 4083 DeoptimizeIf(eq, instr->environment()); |
| 4084 |
| 4085 // We know now that value is not a smi, so we can omit the check below. |
| 4086 check_needed = OMIT_SMI_CHECK; |
| 4087 } |
| 4088 } else if (representation.IsDouble()) { |
4078 ASSERT(access.IsInobject()); | 4089 ASSERT(access.IsInobject()); |
4079 ASSERT(!instr->hydrogen()->has_transition()); | 4090 ASSERT(!instr->hydrogen()->has_transition()); |
4080 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4091 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
4081 DwVfpRegister value = ToDoubleRegister(instr->value()); | 4092 DwVfpRegister value = ToDoubleRegister(instr->value()); |
4082 __ vstr(value, FieldMemOperand(object, offset)); | 4093 __ vstr(value, FieldMemOperand(object, offset)); |
4083 return; | 4094 return; |
4084 } | 4095 } |
4085 | 4096 |
4086 if (instr->hydrogen()->has_transition()) { | 4097 if (instr->hydrogen()->has_transition()) { |
4087 Handle<Map> transition = instr->hydrogen()->transition_map(); | 4098 Handle<Map> transition = instr->hydrogen()->transition_map(); |
(...skipping 21 matching lines...) Expand all Loading... |
4109 __ Store(value, operand, representation); | 4120 __ Store(value, operand, representation); |
4110 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4121 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4111 // Update the write barrier for the object for in-object properties. | 4122 // Update the write barrier for the object for in-object properties. |
4112 __ RecordWriteField(object, | 4123 __ RecordWriteField(object, |
4113 offset, | 4124 offset, |
4114 value, | 4125 value, |
4115 scratch, | 4126 scratch, |
4116 GetLinkRegisterState(), | 4127 GetLinkRegisterState(), |
4117 kSaveFPRegs, | 4128 kSaveFPRegs, |
4118 EMIT_REMEMBERED_SET, | 4129 EMIT_REMEMBERED_SET, |
4119 instr->hydrogen()->SmiCheckForWriteBarrier()); | 4130 check_needed); |
4120 } | 4131 } |
4121 } else { | 4132 } else { |
4122 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 4133 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
4123 MemOperand operand = FieldMemOperand(scratch, offset); | 4134 MemOperand operand = FieldMemOperand(scratch, offset); |
4124 __ Store(value, operand, representation); | 4135 __ Store(value, operand, representation); |
4125 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4136 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4126 // Update the write barrier for the properties array. | 4137 // Update the write barrier for the properties array. |
4127 // object is used as a scratch register. | 4138 // object is used as a scratch register. |
4128 __ RecordWriteField(scratch, | 4139 __ RecordWriteField(scratch, |
4129 offset, | 4140 offset, |
4130 value, | 4141 value, |
4131 object, | 4142 object, |
4132 GetLinkRegisterState(), | 4143 GetLinkRegisterState(), |
4133 kSaveFPRegs, | 4144 kSaveFPRegs, |
4134 EMIT_REMEMBERED_SET, | 4145 EMIT_REMEMBERED_SET, |
4135 instr->hydrogen()->SmiCheckForWriteBarrier()); | 4146 check_needed); |
4136 } | 4147 } |
4137 } | 4148 } |
4138 } | 4149 } |
4139 | 4150 |
4140 | 4151 |
4141 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4152 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4142 ASSERT(ToRegister(instr->context()).is(cp)); | 4153 ASSERT(ToRegister(instr->context()).is(cp)); |
4143 ASSERT(ToRegister(instr->object()).is(r1)); | 4154 ASSERT(ToRegister(instr->object()).is(r1)); |
4144 ASSERT(ToRegister(instr->value()).is(r0)); | 4155 ASSERT(ToRegister(instr->value()).is(r0)); |
4145 | 4156 |
(...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5826 __ ldr(result, FieldMemOperand(scratch, | 5837 __ ldr(result, FieldMemOperand(scratch, |
5827 FixedArray::kHeaderSize - kPointerSize)); | 5838 FixedArray::kHeaderSize - kPointerSize)); |
5828 __ bind(deferred->exit()); | 5839 __ bind(deferred->exit()); |
5829 __ bind(&done); | 5840 __ bind(&done); |
5830 } | 5841 } |
5831 | 5842 |
5832 | 5843 |
5833 #undef __ | 5844 #undef __ |
5834 | 5845 |
5835 } } // namespace v8::internal | 5846 } } // namespace v8::internal |
OLD | NEW |