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