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...) Expand 10 before | Expand all | Expand 10 after 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 } | 5260 } else if (representation.IsDouble()) { |
5261 | |
5262 __ AssertNotSmi(object); | |
5263 | |
5264 if (representation.IsDouble()) { | |
5265 ASSERT(access.IsInobject()); | 5261 ASSERT(access.IsInobject()); |
5266 ASSERT(!instr->hydrogen()->has_transition()); | 5262 ASSERT(!instr->hydrogen()->has_transition()); |
5267 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 5263 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
5268 FPRegister value = ToDoubleRegister(instr->value()); | 5264 FPRegister value = ToDoubleRegister(instr->value()); |
5269 __ Str(value, FieldMemOperand(object, offset)); | 5265 __ Str(value, FieldMemOperand(object, offset)); |
5270 return; | 5266 return; |
5271 } | 5267 } |
5272 | 5268 |
5273 Register value = ToRegister(instr->value()); | 5269 Register value = ToRegister(instr->value()); |
5274 | 5270 |
5275 ASSERT(!representation.IsSmi() || | 5271 SmiCheck check_needed = instr->hydrogen()->value()->IsHeapObject() |
5276 !instr->value()->IsConstantOperand() || | 5272 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
5277 IsInteger32Constant(LConstantOperand::cast(instr->value()))); | 5273 |
| 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 } |
5278 | 5284 |
5279 if (instr->hydrogen()->has_transition()) { | 5285 if (instr->hydrogen()->has_transition()) { |
5280 Handle<Map> transition = instr->hydrogen()->transition_map(); | 5286 Handle<Map> transition = instr->hydrogen()->transition_map(); |
5281 AddDeprecationDependency(transition); | 5287 AddDeprecationDependency(transition); |
5282 // Store the new map value. | 5288 // Store the new map value. |
5283 Register new_map_value = ToRegister(instr->temp0()); | 5289 Register new_map_value = ToRegister(instr->temp0()); |
5284 __ Mov(new_map_value, Operand(transition)); | 5290 __ Mov(new_map_value, Operand(transition)); |
5285 __ Str(new_map_value, FieldMemOperand(object, HeapObject::kMapOffset)); | 5291 __ Str(new_map_value, FieldMemOperand(object, HeapObject::kMapOffset)); |
5286 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { | 5292 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { |
5287 // Update the write barrier for the map field. | 5293 // Update the write barrier for the map field. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5327 __ Store(value, FieldMemOperand(destination, offset), representation); | 5333 __ Store(value, FieldMemOperand(destination, offset), representation); |
5328 } | 5334 } |
5329 if (instr->hydrogen()->NeedsWriteBarrier()) { | 5335 if (instr->hydrogen()->NeedsWriteBarrier()) { |
5330 __ RecordWriteField(destination, | 5336 __ RecordWriteField(destination, |
5331 offset, | 5337 offset, |
5332 value, // Clobbered. | 5338 value, // Clobbered. |
5333 ToRegister(instr->temp1()), // Clobbered. | 5339 ToRegister(instr->temp1()), // Clobbered. |
5334 GetLinkRegisterState(), | 5340 GetLinkRegisterState(), |
5335 kSaveFPRegs, | 5341 kSaveFPRegs, |
5336 EMIT_REMEMBERED_SET, | 5342 EMIT_REMEMBERED_SET, |
5337 instr->hydrogen()->SmiCheckForWriteBarrier()); | 5343 check_needed); |
5338 } | 5344 } |
5339 } | 5345 } |
5340 | 5346 |
5341 | 5347 |
5342 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 5348 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
5343 ASSERT(ToRegister(instr->context()).is(cp)); | 5349 ASSERT(ToRegister(instr->context()).is(cp)); |
5344 ASSERT(ToRegister(instr->value()).is(x0)); | 5350 ASSERT(ToRegister(instr->value()).is(x0)); |
5345 ASSERT(ToRegister(instr->object()).is(x1)); | 5351 ASSERT(ToRegister(instr->object()).is(x1)); |
5346 | 5352 |
5347 // Name must be in x2. | 5353 // Name must be in x2. |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5939 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5945 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
5940 // Index is equal to negated out of object property index plus 1. | 5946 // Index is equal to negated out of object property index plus 1. |
5941 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5947 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
5942 __ Ldr(result, FieldMemOperand(result, | 5948 __ Ldr(result, FieldMemOperand(result, |
5943 FixedArray::kHeaderSize - kPointerSize)); | 5949 FixedArray::kHeaderSize - kPointerSize)); |
5944 __ Bind(deferred->exit()); | 5950 __ Bind(deferred->exit()); |
5945 __ Bind(&done); | 5951 __ Bind(&done); |
5946 } | 5952 } |
5947 | 5953 |
5948 } } // namespace v8::internal | 5954 } } // namespace v8::internal |
OLD | NEW |