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 SmiCheck check_needed = | 4072 __ AssertNotSmi(object); |
4073 instr->hydrogen()->value()->IsHeapObject() | |
4074 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | |
4075 | 4073 |
4076 ASSERT(!(representation.IsSmi() && | 4074 ASSERT(!representation.IsSmi() || |
4077 instr->value()->IsConstantOperand() && | 4075 !instr->value()->IsConstantOperand() || |
4078 !IsSmi(LConstantOperand::cast(instr->value())))); | 4076 IsSmi(LConstantOperand::cast(instr->value()))); |
4079 if (representation.IsHeapObject()) { | 4077 if (representation.IsDouble()) { |
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()) { | |
4089 ASSERT(access.IsInobject()); | 4078 ASSERT(access.IsInobject()); |
4090 ASSERT(!instr->hydrogen()->has_transition()); | 4079 ASSERT(!instr->hydrogen()->has_transition()); |
4091 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4080 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
4092 DwVfpRegister value = ToDoubleRegister(instr->value()); | 4081 DwVfpRegister value = ToDoubleRegister(instr->value()); |
4093 __ vstr(value, FieldMemOperand(object, offset)); | 4082 __ vstr(value, FieldMemOperand(object, offset)); |
4094 return; | 4083 return; |
4095 } | 4084 } |
4096 | 4085 |
4097 if (instr->hydrogen()->has_transition()) { | 4086 if (instr->hydrogen()->has_transition()) { |
4098 Handle<Map> transition = instr->hydrogen()->transition_map(); | 4087 Handle<Map> transition = instr->hydrogen()->transition_map(); |
(...skipping 21 matching lines...) Expand all Loading... |
4120 __ Store(value, operand, representation); | 4109 __ Store(value, operand, representation); |
4121 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4110 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4122 // Update the write barrier for the object for in-object properties. | 4111 // Update the write barrier for the object for in-object properties. |
4123 __ RecordWriteField(object, | 4112 __ RecordWriteField(object, |
4124 offset, | 4113 offset, |
4125 value, | 4114 value, |
4126 scratch, | 4115 scratch, |
4127 GetLinkRegisterState(), | 4116 GetLinkRegisterState(), |
4128 kSaveFPRegs, | 4117 kSaveFPRegs, |
4129 EMIT_REMEMBERED_SET, | 4118 EMIT_REMEMBERED_SET, |
4130 check_needed); | 4119 instr->hydrogen()->SmiCheckForWriteBarrier()); |
4131 } | 4120 } |
4132 } else { | 4121 } else { |
4133 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 4122 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
4134 MemOperand operand = FieldMemOperand(scratch, offset); | 4123 MemOperand operand = FieldMemOperand(scratch, offset); |
4135 __ Store(value, operand, representation); | 4124 __ Store(value, operand, representation); |
4136 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4125 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4137 // Update the write barrier for the properties array. | 4126 // Update the write barrier for the properties array. |
4138 // object is used as a scratch register. | 4127 // object is used as a scratch register. |
4139 __ RecordWriteField(scratch, | 4128 __ RecordWriteField(scratch, |
4140 offset, | 4129 offset, |
4141 value, | 4130 value, |
4142 object, | 4131 object, |
4143 GetLinkRegisterState(), | 4132 GetLinkRegisterState(), |
4144 kSaveFPRegs, | 4133 kSaveFPRegs, |
4145 EMIT_REMEMBERED_SET, | 4134 EMIT_REMEMBERED_SET, |
4146 check_needed); | 4135 instr->hydrogen()->SmiCheckForWriteBarrier()); |
4147 } | 4136 } |
4148 } | 4137 } |
4149 } | 4138 } |
4150 | 4139 |
4151 | 4140 |
4152 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4141 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4153 ASSERT(ToRegister(instr->context()).is(cp)); | 4142 ASSERT(ToRegister(instr->context()).is(cp)); |
4154 ASSERT(ToRegister(instr->object()).is(r1)); | 4143 ASSERT(ToRegister(instr->object()).is(r1)); |
4155 ASSERT(ToRegister(instr->value()).is(r0)); | 4144 ASSERT(ToRegister(instr->value()).is(r0)); |
4156 | 4145 |
(...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5837 __ ldr(result, FieldMemOperand(scratch, | 5826 __ ldr(result, FieldMemOperand(scratch, |
5838 FixedArray::kHeaderSize - kPointerSize)); | 5827 FixedArray::kHeaderSize - kPointerSize)); |
5839 __ bind(deferred->exit()); | 5828 __ bind(deferred->exit()); |
5840 __ bind(&done); | 5829 __ bind(&done); |
5841 } | 5830 } |
5842 | 5831 |
5843 | 5832 |
5844 #undef __ | 5833 #undef __ |
5845 | 5834 |
5846 } } // namespace v8::internal | 5835 } } // namespace v8::internal |
OLD | NEW |