| 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/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
| (...skipping 3330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3341 DeoptimizeIfRoot( | 3341 DeoptimizeIfRoot( |
| 3342 result, Heap::kTheHoleValueRootIndex, instr->environment()); | 3342 result, Heap::kTheHoleValueRootIndex, instr->environment()); |
| 3343 } | 3343 } |
| 3344 } | 3344 } |
| 3345 | 3345 |
| 3346 | 3346 |
| 3347 template <class T> | 3347 template <class T> |
| 3348 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | 3348 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { |
| 3349 DCHECK(FLAG_vector_ics); | 3349 DCHECK(FLAG_vector_ics); |
| 3350 Register vector = ToRegister(instr->temp_vector()); | 3350 Register vector = ToRegister(instr->temp_vector()); |
| 3351 DCHECK(vector.is(LoadIC::VectorRegister())); | 3351 DCHECK(vector.is(FullVectorLoadConvention::VectorRegister())); |
| 3352 __ Mov(vector, instr->hydrogen()->feedback_vector()); | 3352 __ Mov(vector, instr->hydrogen()->feedback_vector()); |
| 3353 // No need to allocate this register. | 3353 // No need to allocate this register. |
| 3354 DCHECK(LoadIC::SlotRegister().is(x0)); | 3354 DCHECK(FullVectorLoadConvention::SlotRegister().is(x0)); |
| 3355 __ Mov(LoadIC::SlotRegister(), Smi::FromInt(instr->hydrogen()->slot())); | 3355 __ Mov(FullVectorLoadConvention::SlotRegister(), |
| 3356 Smi::FromInt(instr->hydrogen()->slot())); |
| 3356 } | 3357 } |
| 3357 | 3358 |
| 3358 | 3359 |
| 3359 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 3360 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
| 3360 DCHECK(ToRegister(instr->context()).is(cp)); | 3361 DCHECK(ToRegister(instr->context()).is(cp)); |
| 3361 DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister())); | 3362 DCHECK(ToRegister(instr->global_object()) |
| 3363 .is(LoadConvention::ReceiverRegister())); |
| 3362 DCHECK(ToRegister(instr->result()).Is(x0)); | 3364 DCHECK(ToRegister(instr->result()).Is(x0)); |
| 3363 __ Mov(LoadIC::NameRegister(), Operand(instr->name())); | 3365 __ Mov(LoadConvention::NameRegister(), Operand(instr->name())); |
| 3364 if (FLAG_vector_ics) { | 3366 if (FLAG_vector_ics) { |
| 3365 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 3367 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
| 3366 } | 3368 } |
| 3367 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 3369 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
| 3368 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); | 3370 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); |
| 3369 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3371 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3370 } | 3372 } |
| 3371 | 3373 |
| 3372 | 3374 |
| 3373 MemOperand LCodeGen::PrepareKeyedExternalArrayOperand( | 3375 MemOperand LCodeGen::PrepareKeyedExternalArrayOperand( |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3607 } else { | 3609 } else { |
| 3608 DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex, | 3610 DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex, |
| 3609 instr->environment()); | 3611 instr->environment()); |
| 3610 } | 3612 } |
| 3611 } | 3613 } |
| 3612 } | 3614 } |
| 3613 | 3615 |
| 3614 | 3616 |
| 3615 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3617 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
| 3616 DCHECK(ToRegister(instr->context()).is(cp)); | 3618 DCHECK(ToRegister(instr->context()).is(cp)); |
| 3617 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); | 3619 DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); |
| 3618 DCHECK(ToRegister(instr->key()).is(LoadIC::NameRegister())); | 3620 DCHECK(ToRegister(instr->key()).is(LoadConvention::NameRegister())); |
| 3619 if (FLAG_vector_ics) { | 3621 if (FLAG_vector_ics) { |
| 3620 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3622 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
| 3621 } | 3623 } |
| 3622 | 3624 |
| 3623 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 3625 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
| 3624 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3626 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3625 | 3627 |
| 3626 DCHECK(ToRegister(instr->result()).Is(x0)); | 3628 DCHECK(ToRegister(instr->result()).Is(x0)); |
| 3627 } | 3629 } |
| 3628 | 3630 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3663 Representation::Integer32()); | 3665 Representation::Integer32()); |
| 3664 } else { | 3666 } else { |
| 3665 __ Load(result, FieldMemOperand(source, offset), access.representation()); | 3667 __ Load(result, FieldMemOperand(source, offset), access.representation()); |
| 3666 } | 3668 } |
| 3667 } | 3669 } |
| 3668 | 3670 |
| 3669 | 3671 |
| 3670 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3672 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
| 3671 DCHECK(ToRegister(instr->context()).is(cp)); | 3673 DCHECK(ToRegister(instr->context()).is(cp)); |
| 3672 // LoadIC expects name and receiver in registers. | 3674 // LoadIC expects name and receiver in registers. |
| 3673 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); | 3675 DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); |
| 3674 __ Mov(LoadIC::NameRegister(), Operand(instr->name())); | 3676 __ Mov(LoadConvention::NameRegister(), Operand(instr->name())); |
| 3675 if (FLAG_vector_ics) { | 3677 if (FLAG_vector_ics) { |
| 3676 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3678 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
| 3677 } | 3679 } |
| 3678 | 3680 |
| 3679 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); | 3681 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); |
| 3680 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3682 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3681 | 3683 |
| 3682 DCHECK(ToRegister(instr->result()).is(x0)); | 3684 DCHECK(ToRegister(instr->result()).is(x0)); |
| 3683 } | 3685 } |
| 3684 | 3686 |
| (...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5300 __ Add(element_addr, mem_op.base(), mem_op.OffsetAsOperand()); | 5302 __ Add(element_addr, mem_op.base(), mem_op.OffsetAsOperand()); |
| 5301 __ RecordWrite(elements, element_addr, value, GetLinkRegisterState(), | 5303 __ RecordWrite(elements, element_addr, value, GetLinkRegisterState(), |
| 5302 kSaveFPRegs, EMIT_REMEMBERED_SET, check_needed, | 5304 kSaveFPRegs, EMIT_REMEMBERED_SET, check_needed, |
| 5303 instr->hydrogen()->PointersToHereCheckForValue()); | 5305 instr->hydrogen()->PointersToHereCheckForValue()); |
| 5304 } | 5306 } |
| 5305 } | 5307 } |
| 5306 | 5308 |
| 5307 | 5309 |
| 5308 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 5310 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
| 5309 DCHECK(ToRegister(instr->context()).is(cp)); | 5311 DCHECK(ToRegister(instr->context()).is(cp)); |
| 5310 DCHECK(ToRegister(instr->object()).is(KeyedStoreIC::ReceiverRegister())); | 5312 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); |
| 5311 DCHECK(ToRegister(instr->key()).is(KeyedStoreIC::NameRegister())); | 5313 DCHECK(ToRegister(instr->key()).is(StoreConvention::NameRegister())); |
| 5312 DCHECK(ToRegister(instr->value()).is(KeyedStoreIC::ValueRegister())); | 5314 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); |
| 5313 | 5315 |
| 5314 Handle<Code> ic = instr->strict_mode() == STRICT | 5316 Handle<Code> ic = instr->strict_mode() == STRICT |
| 5315 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() | 5317 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() |
| 5316 : isolate()->builtins()->KeyedStoreIC_Initialize(); | 5318 : isolate()->builtins()->KeyedStoreIC_Initialize(); |
| 5317 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 5319 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 5318 } | 5320 } |
| 5319 | 5321 |
| 5320 | 5322 |
| 5321 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { | 5323 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
| 5322 Representation representation = instr->representation(); | 5324 Representation representation = instr->representation(); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5407 kSaveFPRegs, | 5409 kSaveFPRegs, |
| 5408 EMIT_REMEMBERED_SET, | 5410 EMIT_REMEMBERED_SET, |
| 5409 instr->hydrogen()->SmiCheckForWriteBarrier(), | 5411 instr->hydrogen()->SmiCheckForWriteBarrier(), |
| 5410 instr->hydrogen()->PointersToHereCheckForValue()); | 5412 instr->hydrogen()->PointersToHereCheckForValue()); |
| 5411 } | 5413 } |
| 5412 } | 5414 } |
| 5413 | 5415 |
| 5414 | 5416 |
| 5415 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 5417 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
| 5416 DCHECK(ToRegister(instr->context()).is(cp)); | 5418 DCHECK(ToRegister(instr->context()).is(cp)); |
| 5417 DCHECK(ToRegister(instr->object()).is(StoreIC::ReceiverRegister())); | 5419 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); |
| 5418 DCHECK(ToRegister(instr->value()).is(StoreIC::ValueRegister())); | 5420 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); |
| 5419 | 5421 |
| 5420 __ Mov(StoreIC::NameRegister(), Operand(instr->name())); | 5422 __ Mov(StoreConvention::NameRegister(), Operand(instr->name())); |
| 5421 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); | 5423 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); |
| 5422 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 5424 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 5423 } | 5425 } |
| 5424 | 5426 |
| 5425 | 5427 |
| 5426 void LCodeGen::DoStringAdd(LStringAdd* instr) { | 5428 void LCodeGen::DoStringAdd(LStringAdd* instr) { |
| 5427 DCHECK(ToRegister(instr->context()).is(cp)); | 5429 DCHECK(ToRegister(instr->context()).is(cp)); |
| 5428 DCHECK(ToRegister(instr->left()).Is(x1)); | 5430 DCHECK(ToRegister(instr->left()).Is(x1)); |
| 5429 DCHECK(ToRegister(instr->right()).Is(x0)); | 5431 DCHECK(ToRegister(instr->right()).Is(x0)); |
| 5430 StringAddStub stub(isolate(), | 5432 StringAddStub stub(isolate(), |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6019 Handle<ScopeInfo> scope_info = instr->scope_info(); | 6021 Handle<ScopeInfo> scope_info = instr->scope_info(); |
| 6020 __ Push(scope_info); | 6022 __ Push(scope_info); |
| 6021 __ Push(ToRegister(instr->function())); | 6023 __ Push(ToRegister(instr->function())); |
| 6022 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6024 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6023 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6025 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6024 } | 6026 } |
| 6025 | 6027 |
| 6026 | 6028 |
| 6027 | 6029 |
| 6028 } } // namespace v8::internal | 6030 } } // namespace v8::internal |
| OLD | NEW |