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