OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 "arm64/lithium-codegen-arm64.h" | 7 #include "arm64/lithium-codegen-arm64.h" |
8 #include "arm64/lithium-gap-resolver-arm64.h" | 8 #include "arm64/lithium-gap-resolver-arm64.h" |
9 #include "code-stubs.h" | 9 #include "code-stubs.h" |
10 #include "stub-cache.h" | 10 #include "stub-cache.h" |
(...skipping 5239 matching lines...) Loading... |
5250 Register object = ToRegister(instr->object()); | 5250 Register object = ToRegister(instr->object()); |
5251 HObjectAccess access = instr->hydrogen()->access(); | 5251 HObjectAccess access = instr->hydrogen()->access(); |
5252 int offset = access.offset(); | 5252 int offset = access.offset(); |
5253 | 5253 |
5254 if (access.IsExternalMemory()) { | 5254 if (access.IsExternalMemory()) { |
5255 ASSERT(!instr->hydrogen()->has_transition()); | 5255 ASSERT(!instr->hydrogen()->has_transition()); |
5256 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 5256 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
5257 Register value = ToRegister(instr->value()); | 5257 Register value = ToRegister(instr->value()); |
5258 __ Store(value, MemOperand(object, offset), representation); | 5258 __ Store(value, MemOperand(object, offset), representation); |
5259 return; | 5259 return; |
5260 } else if (representation.IsDouble()) { | 5260 } |
| 5261 |
| 5262 __ AssertNotSmi(object); |
| 5263 |
| 5264 if (representation.IsDouble()) { |
5261 ASSERT(access.IsInobject()); | 5265 ASSERT(access.IsInobject()); |
5262 ASSERT(!instr->hydrogen()->has_transition()); | 5266 ASSERT(!instr->hydrogen()->has_transition()); |
5263 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 5267 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
5264 FPRegister value = ToDoubleRegister(instr->value()); | 5268 FPRegister value = ToDoubleRegister(instr->value()); |
5265 __ Str(value, FieldMemOperand(object, offset)); | 5269 __ Str(value, FieldMemOperand(object, offset)); |
5266 return; | 5270 return; |
5267 } | 5271 } |
5268 | 5272 |
5269 Register value = ToRegister(instr->value()); | 5273 Register value = ToRegister(instr->value()); |
5270 | 5274 |
5271 SmiCheck check_needed = instr->hydrogen()->value()->IsHeapObject() | 5275 ASSERT(!representation.IsSmi() || |
5272 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 5276 !instr->value()->IsConstantOperand() || |
5273 | 5277 IsInteger32Constant(LConstantOperand::cast(instr->value()))); |
5274 ASSERT(!(representation.IsSmi() && | |
5275 instr->value()->IsConstantOperand() && | |
5276 !IsInteger32Constant(LConstantOperand::cast(instr->value())))); | |
5277 if (representation.IsHeapObject() && | |
5278 !instr->hydrogen()->value()->type().IsHeapObject()) { | |
5279 DeoptimizeIfSmi(value, instr->environment()); | |
5280 | |
5281 // We know now that value is not a smi, so we can omit the check below. | |
5282 check_needed = OMIT_SMI_CHECK; | |
5283 } | |
5284 | 5278 |
5285 if (instr->hydrogen()->has_transition()) { | 5279 if (instr->hydrogen()->has_transition()) { |
5286 Handle<Map> transition = instr->hydrogen()->transition_map(); | 5280 Handle<Map> transition = instr->hydrogen()->transition_map(); |
5287 AddDeprecationDependency(transition); | 5281 AddDeprecationDependency(transition); |
5288 // Store the new map value. | 5282 // Store the new map value. |
5289 Register new_map_value = ToRegister(instr->temp0()); | 5283 Register new_map_value = ToRegister(instr->temp0()); |
5290 __ Mov(new_map_value, Operand(transition)); | 5284 __ Mov(new_map_value, Operand(transition)); |
5291 __ Str(new_map_value, FieldMemOperand(object, HeapObject::kMapOffset)); | 5285 __ Str(new_map_value, FieldMemOperand(object, HeapObject::kMapOffset)); |
5292 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { | 5286 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { |
5293 // Update the write barrier for the map field. | 5287 // Update the write barrier for the map field. |
(...skipping 39 matching lines...) Loading... |
5333 __ Store(value, FieldMemOperand(destination, offset), representation); | 5327 __ Store(value, FieldMemOperand(destination, offset), representation); |
5334 } | 5328 } |
5335 if (instr->hydrogen()->NeedsWriteBarrier()) { | 5329 if (instr->hydrogen()->NeedsWriteBarrier()) { |
5336 __ RecordWriteField(destination, | 5330 __ RecordWriteField(destination, |
5337 offset, | 5331 offset, |
5338 value, // Clobbered. | 5332 value, // Clobbered. |
5339 ToRegister(instr->temp1()), // Clobbered. | 5333 ToRegister(instr->temp1()), // Clobbered. |
5340 GetLinkRegisterState(), | 5334 GetLinkRegisterState(), |
5341 kSaveFPRegs, | 5335 kSaveFPRegs, |
5342 EMIT_REMEMBERED_SET, | 5336 EMIT_REMEMBERED_SET, |
5343 check_needed); | 5337 instr->hydrogen()->SmiCheckForWriteBarrier()); |
5344 } | 5338 } |
5345 } | 5339 } |
5346 | 5340 |
5347 | 5341 |
5348 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 5342 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
5349 ASSERT(ToRegister(instr->context()).is(cp)); | 5343 ASSERT(ToRegister(instr->context()).is(cp)); |
5350 ASSERT(ToRegister(instr->value()).is(x0)); | 5344 ASSERT(ToRegister(instr->value()).is(x0)); |
5351 ASSERT(ToRegister(instr->object()).is(x1)); | 5345 ASSERT(ToRegister(instr->object()).is(x1)); |
5352 | 5346 |
5353 // Name must be in x2. | 5347 // Name must be in x2. |
(...skipping 591 matching lines...) Loading... |
5945 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5939 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
5946 // Index is equal to negated out of object property index plus 1. | 5940 // Index is equal to negated out of object property index plus 1. |
5947 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5941 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
5948 __ Ldr(result, FieldMemOperand(result, | 5942 __ Ldr(result, FieldMemOperand(result, |
5949 FixedArray::kHeaderSize - kPointerSize)); | 5943 FixedArray::kHeaderSize - kPointerSize)); |
5950 __ Bind(deferred->exit()); | 5944 __ Bind(deferred->exit()); |
5951 __ Bind(&done); | 5945 __ Bind(&done); |
5952 } | 5946 } |
5953 | 5947 |
5954 } } // namespace v8::internal | 5948 } } // namespace v8::internal |
OLD | NEW |