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 4044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4055 HObjectAccess access = instr->hydrogen()->access(); | 4055 HObjectAccess access = instr->hydrogen()->access(); |
4056 int offset = access.offset(); | 4056 int offset = access.offset(); |
4057 | 4057 |
4058 if (access.IsExternalMemory()) { | 4058 if (access.IsExternalMemory()) { |
4059 Register value = ToRegister(instr->value()); | 4059 Register value = ToRegister(instr->value()); |
4060 MemOperand operand = MemOperand(object, offset); | 4060 MemOperand operand = MemOperand(object, offset); |
4061 __ Store(value, operand, representation); | 4061 __ Store(value, operand, representation); |
4062 return; | 4062 return; |
4063 } | 4063 } |
4064 | 4064 |
4065 SmiCheck check_needed = | 4065 __ AssertNotSmi(object); |
4066 instr->hydrogen()->value()->IsHeapObject() | |
4067 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | |
4068 | 4066 |
4069 ASSERT(!(representation.IsSmi() && | 4067 ASSERT(!representation.IsSmi() || |
4070 instr->value()->IsConstantOperand() && | 4068 !instr->value()->IsConstantOperand() || |
4071 !IsSmi(LConstantOperand::cast(instr->value())))); | 4069 IsSmi(LConstantOperand::cast(instr->value()))); |
4072 if (representation.IsHeapObject()) { | 4070 if (representation.IsDouble()) { |
4073 Register value = ToRegister(instr->value()); | |
4074 if (!instr->hydrogen()->value()->type().IsHeapObject()) { | |
4075 __ SmiTst(value); | |
4076 DeoptimizeIf(eq, instr->environment()); | |
4077 | |
4078 // We know now that value is not a smi, so we can omit the check below. | |
4079 check_needed = OMIT_SMI_CHECK; | |
4080 } | |
4081 } else if (representation.IsDouble()) { | |
4082 ASSERT(access.IsInobject()); | 4071 ASSERT(access.IsInobject()); |
4083 ASSERT(!instr->hydrogen()->has_transition()); | 4072 ASSERT(!instr->hydrogen()->has_transition()); |
4084 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4073 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
4085 DwVfpRegister value = ToDoubleRegister(instr->value()); | 4074 DwVfpRegister value = ToDoubleRegister(instr->value()); |
4086 __ vstr(value, FieldMemOperand(object, offset)); | 4075 __ vstr(value, FieldMemOperand(object, offset)); |
4087 return; | 4076 return; |
4088 } | 4077 } |
4089 | 4078 |
4090 if (instr->hydrogen()->has_transition()) { | 4079 if (instr->hydrogen()->has_transition()) { |
4091 Handle<Map> transition = instr->hydrogen()->transition_map(); | 4080 Handle<Map> transition = instr->hydrogen()->transition_map(); |
(...skipping 21 matching lines...) Expand all Loading... |
4113 __ Store(value, operand, representation); | 4102 __ Store(value, operand, representation); |
4114 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4103 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4115 // Update the write barrier for the object for in-object properties. | 4104 // Update the write barrier for the object for in-object properties. |
4116 __ RecordWriteField(object, | 4105 __ RecordWriteField(object, |
4117 offset, | 4106 offset, |
4118 value, | 4107 value, |
4119 scratch, | 4108 scratch, |
4120 GetLinkRegisterState(), | 4109 GetLinkRegisterState(), |
4121 kSaveFPRegs, | 4110 kSaveFPRegs, |
4122 EMIT_REMEMBERED_SET, | 4111 EMIT_REMEMBERED_SET, |
4123 check_needed); | 4112 instr->hydrogen()->SmiCheckForWriteBarrier()); |
4124 } | 4113 } |
4125 } else { | 4114 } else { |
4126 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 4115 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
4127 MemOperand operand = FieldMemOperand(scratch, offset); | 4116 MemOperand operand = FieldMemOperand(scratch, offset); |
4128 __ Store(value, operand, representation); | 4117 __ Store(value, operand, representation); |
4129 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4118 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4130 // Update the write barrier for the properties array. | 4119 // Update the write barrier for the properties array. |
4131 // object is used as a scratch register. | 4120 // object is used as a scratch register. |
4132 __ RecordWriteField(scratch, | 4121 __ RecordWriteField(scratch, |
4133 offset, | 4122 offset, |
4134 value, | 4123 value, |
4135 object, | 4124 object, |
4136 GetLinkRegisterState(), | 4125 GetLinkRegisterState(), |
4137 kSaveFPRegs, | 4126 kSaveFPRegs, |
4138 EMIT_REMEMBERED_SET, | 4127 EMIT_REMEMBERED_SET, |
4139 check_needed); | 4128 instr->hydrogen()->SmiCheckForWriteBarrier()); |
4140 } | 4129 } |
4141 } | 4130 } |
4142 } | 4131 } |
4143 | 4132 |
4144 | 4133 |
4145 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4134 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4146 ASSERT(ToRegister(instr->context()).is(cp)); | 4135 ASSERT(ToRegister(instr->context()).is(cp)); |
4147 ASSERT(ToRegister(instr->object()).is(r1)); | 4136 ASSERT(ToRegister(instr->object()).is(r1)); |
4148 ASSERT(ToRegister(instr->value()).is(r0)); | 4137 ASSERT(ToRegister(instr->value()).is(r0)); |
4149 | 4138 |
(...skipping 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5831 __ ldr(result, FieldMemOperand(scratch, | 5820 __ ldr(result, FieldMemOperand(scratch, |
5832 FixedArray::kHeaderSize - kPointerSize)); | 5821 FixedArray::kHeaderSize - kPointerSize)); |
5833 __ bind(deferred->exit()); | 5822 __ bind(deferred->exit()); |
5834 __ bind(&done); | 5823 __ bind(&done); |
5835 } | 5824 } |
5836 | 5825 |
5837 | 5826 |
5838 #undef __ | 5827 #undef __ |
5839 | 5828 |
5840 } } // namespace v8::internal | 5829 } } // namespace v8::internal |
OLD | NEW |