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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arm64/lithium-codegen-arm64.h" | 7 #include "src/arm64/lithium-codegen-arm64.h" |
8 #include "src/arm64/lithium-gap-resolver-arm64.h" | 8 #include "src/arm64/lithium-gap-resolver-arm64.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 3642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3653 int offset = access.offset(); | 3653 int offset = access.offset(); |
3654 Register object = ToRegister(instr->object()); | 3654 Register object = ToRegister(instr->object()); |
3655 | 3655 |
3656 if (access.IsExternalMemory()) { | 3656 if (access.IsExternalMemory()) { |
3657 Register result = ToRegister(instr->result()); | 3657 Register result = ToRegister(instr->result()); |
3658 __ Load(result, MemOperand(object, offset), access.representation()); | 3658 __ Load(result, MemOperand(object, offset), access.representation()); |
3659 return; | 3659 return; |
3660 } | 3660 } |
3661 | 3661 |
3662 if (instr->hydrogen()->representation().IsDouble()) { | 3662 if (instr->hydrogen()->representation().IsDouble()) { |
3663 DCHECK(access.IsInobject()); | |
3664 FPRegister result = ToDoubleRegister(instr->result()); | 3663 FPRegister result = ToDoubleRegister(instr->result()); |
3665 __ Ldr(result, FieldMemOperand(object, offset)); | 3664 __ Ldr(result, FieldMemOperand(object, offset)); |
3666 return; | 3665 return; |
3667 } | 3666 } |
3668 | 3667 |
3669 Register result = ToRegister(instr->result()); | 3668 Register result = ToRegister(instr->result()); |
3670 Register source; | 3669 Register source; |
3671 if (access.IsInobject()) { | 3670 if (access.IsInobject()) { |
3672 source = object; | 3671 source = object; |
3673 } else { | 3672 } else { |
(...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5344 if (access.IsExternalMemory()) { | 5343 if (access.IsExternalMemory()) { |
5345 DCHECK(!instr->hydrogen()->has_transition()); | 5344 DCHECK(!instr->hydrogen()->has_transition()); |
5346 DCHECK(!instr->hydrogen()->NeedsWriteBarrier()); | 5345 DCHECK(!instr->hydrogen()->NeedsWriteBarrier()); |
5347 Register value = ToRegister(instr->value()); | 5346 Register value = ToRegister(instr->value()); |
5348 __ Store(value, MemOperand(object, offset), representation); | 5347 __ Store(value, MemOperand(object, offset), representation); |
5349 return; | 5348 return; |
5350 } | 5349 } |
5351 | 5350 |
5352 __ AssertNotSmi(object); | 5351 __ AssertNotSmi(object); |
5353 | 5352 |
5354 if (!FLAG_unbox_double_fields && representation.IsDouble()) { | 5353 if (representation.IsDouble()) { |
5355 DCHECK(access.IsInobject()); | 5354 DCHECK(access.IsInobject()); |
5356 DCHECK(!instr->hydrogen()->has_transition()); | 5355 DCHECK(!instr->hydrogen()->has_transition()); |
5357 DCHECK(!instr->hydrogen()->NeedsWriteBarrier()); | 5356 DCHECK(!instr->hydrogen()->NeedsWriteBarrier()); |
5358 FPRegister value = ToDoubleRegister(instr->value()); | 5357 FPRegister value = ToDoubleRegister(instr->value()); |
5359 __ Str(value, FieldMemOperand(object, offset)); | 5358 __ Str(value, FieldMemOperand(object, offset)); |
5360 return; | 5359 return; |
5361 } | 5360 } |
5362 | 5361 |
| 5362 Register value = ToRegister(instr->value()); |
| 5363 |
5363 DCHECK(!representation.IsSmi() || | 5364 DCHECK(!representation.IsSmi() || |
5364 !instr->value()->IsConstantOperand() || | 5365 !instr->value()->IsConstantOperand() || |
5365 IsInteger32Constant(LConstantOperand::cast(instr->value()))); | 5366 IsInteger32Constant(LConstantOperand::cast(instr->value()))); |
5366 | 5367 |
5367 if (instr->hydrogen()->has_transition()) { | 5368 if (instr->hydrogen()->has_transition()) { |
5368 Handle<Map> transition = instr->hydrogen()->transition_map(); | 5369 Handle<Map> transition = instr->hydrogen()->transition_map(); |
5369 AddDeprecationDependency(transition); | 5370 AddDeprecationDependency(transition); |
5370 // Store the new map value. | 5371 // Store the new map value. |
5371 Register new_map_value = ToRegister(instr->temp0()); | 5372 Register new_map_value = ToRegister(instr->temp0()); |
5372 __ Mov(new_map_value, Operand(transition)); | 5373 __ Mov(new_map_value, Operand(transition)); |
(...skipping 11 matching lines...) Expand all Loading... |
5384 // Do the store. | 5385 // Do the store. |
5385 Register destination; | 5386 Register destination; |
5386 if (access.IsInobject()) { | 5387 if (access.IsInobject()) { |
5387 destination = object; | 5388 destination = object; |
5388 } else { | 5389 } else { |
5389 Register temp0 = ToRegister(instr->temp0()); | 5390 Register temp0 = ToRegister(instr->temp0()); |
5390 __ Ldr(temp0, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5391 __ Ldr(temp0, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
5391 destination = temp0; | 5392 destination = temp0; |
5392 } | 5393 } |
5393 | 5394 |
5394 if (FLAG_unbox_double_fields && representation.IsDouble()) { | 5395 if (representation.IsSmi() && |
5395 DCHECK(access.IsInobject()); | 5396 instr->hydrogen()->value()->representation().IsInteger32()) { |
5396 FPRegister value = ToDoubleRegister(instr->value()); | |
5397 __ Str(value, FieldMemOperand(object, offset)); | |
5398 } else if (representation.IsSmi() && | |
5399 instr->hydrogen()->value()->representation().IsInteger32()) { | |
5400 DCHECK(instr->hydrogen()->store_mode() == STORE_TO_INITIALIZED_ENTRY); | 5397 DCHECK(instr->hydrogen()->store_mode() == STORE_TO_INITIALIZED_ENTRY); |
5401 #ifdef DEBUG | 5398 #ifdef DEBUG |
5402 Register temp0 = ToRegister(instr->temp0()); | 5399 Register temp0 = ToRegister(instr->temp0()); |
5403 __ Ldr(temp0, FieldMemOperand(destination, offset)); | 5400 __ Ldr(temp0, FieldMemOperand(destination, offset)); |
5404 __ AssertSmi(temp0); | 5401 __ AssertSmi(temp0); |
5405 // If destination aliased temp0, restore it to the address calculated | 5402 // If destination aliased temp0, restore it to the address calculated |
5406 // earlier. | 5403 // earlier. |
5407 if (destination.Is(temp0)) { | 5404 if (destination.Is(temp0)) { |
5408 DCHECK(!access.IsInobject()); | 5405 DCHECK(!access.IsInobject()); |
5409 __ Ldr(destination, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5406 __ Ldr(destination, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
5410 } | 5407 } |
5411 #endif | 5408 #endif |
5412 STATIC_ASSERT(static_cast<unsigned>(kSmiValueSize) == kWRegSizeInBits); | 5409 STATIC_ASSERT(static_cast<unsigned>(kSmiValueSize) == kWRegSizeInBits); |
5413 STATIC_ASSERT(kSmiTag == 0); | 5410 STATIC_ASSERT(kSmiTag == 0); |
5414 Register value = ToRegister(instr->value()); | |
5415 __ Store(value, UntagSmiFieldMemOperand(destination, offset), | 5411 __ Store(value, UntagSmiFieldMemOperand(destination, offset), |
5416 Representation::Integer32()); | 5412 Representation::Integer32()); |
5417 } else { | 5413 } else { |
5418 Register value = ToRegister(instr->value()); | |
5419 __ Store(value, FieldMemOperand(destination, offset), representation); | 5414 __ Store(value, FieldMemOperand(destination, offset), representation); |
5420 } | 5415 } |
5421 if (instr->hydrogen()->NeedsWriteBarrier()) { | 5416 if (instr->hydrogen()->NeedsWriteBarrier()) { |
5422 Register value = ToRegister(instr->value()); | |
5423 __ RecordWriteField(destination, | 5417 __ RecordWriteField(destination, |
5424 offset, | 5418 offset, |
5425 value, // Clobbered. | 5419 value, // Clobbered. |
5426 ToRegister(instr->temp1()), // Clobbered. | 5420 ToRegister(instr->temp1()), // Clobbered. |
5427 GetLinkRegisterState(), | 5421 GetLinkRegisterState(), |
5428 kSaveFPRegs, | 5422 kSaveFPRegs, |
5429 EMIT_REMEMBERED_SET, | 5423 EMIT_REMEMBERED_SET, |
5430 instr->hydrogen()->SmiCheckForWriteBarrier(), | 5424 instr->hydrogen()->SmiCheckForWriteBarrier(), |
5431 instr->hydrogen()->PointersToHereCheckForValue()); | 5425 instr->hydrogen()->PointersToHereCheckForValue()); |
5432 } | 5426 } |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6043 Handle<ScopeInfo> scope_info = instr->scope_info(); | 6037 Handle<ScopeInfo> scope_info = instr->scope_info(); |
6044 __ Push(scope_info); | 6038 __ Push(scope_info); |
6045 __ Push(ToRegister(instr->function())); | 6039 __ Push(ToRegister(instr->function())); |
6046 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6040 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6047 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6041 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6048 } | 6042 } |
6049 | 6043 |
6050 | 6044 |
6051 | 6045 |
6052 } } // namespace v8::internal | 6046 } } // namespace v8::internal |
OLD | NEW |