Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: src/arm64/lithium-codegen-arm64.cc

Issue 500073002: Eliminate code duplication in lithium calls to vector-based LoadICs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm64/lithium-codegen-arm64.h ('k') | src/ia32/lithium-codegen-ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3326 matching lines...) Expand 10 before | Expand all | Expand 10 after
3337 Register result = ToRegister(instr->result()); 3337 Register result = ToRegister(instr->result());
3338 __ Mov(result, Operand(Handle<Object>(instr->hydrogen()->cell().handle()))); 3338 __ Mov(result, Operand(Handle<Object>(instr->hydrogen()->cell().handle())));
3339 __ Ldr(result, FieldMemOperand(result, Cell::kValueOffset)); 3339 __ Ldr(result, FieldMemOperand(result, Cell::kValueOffset));
3340 if (instr->hydrogen()->RequiresHoleCheck()) { 3340 if (instr->hydrogen()->RequiresHoleCheck()) {
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>
3348 void LCodeGen::EmitVectorLoadICRegisters(T* instr) {
3349 DCHECK(FLAG_vector_ics);
3350 Register vector = ToRegister(instr->temp_vector());
3351 DCHECK(vector.is(LoadIC::VectorRegister()));
3352 __ Mov(vector, instr->hydrogen()->feedback_vector());
3353 // No need to allocate this register.
3354 DCHECK(LoadIC::SlotRegister().is(x0));
3355 __ Mov(LoadIC::SlotRegister(), Smi::FromInt(instr->hydrogen()->slot()));
3356 }
3357
3358
3347 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { 3359 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
3348 DCHECK(ToRegister(instr->context()).is(cp)); 3360 DCHECK(ToRegister(instr->context()).is(cp));
3349 DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister())); 3361 DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister()));
3350 DCHECK(ToRegister(instr->result()).Is(x0)); 3362 DCHECK(ToRegister(instr->result()).Is(x0));
3351 __ Mov(LoadIC::NameRegister(), Operand(instr->name())); 3363 __ Mov(LoadIC::NameRegister(), Operand(instr->name()));
3352 if (FLAG_vector_ics) { 3364 if (FLAG_vector_ics) {
3353 Register vector = ToRegister(instr->temp_vector()); 3365 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
3354 DCHECK(vector.is(LoadIC::VectorRegister()));
3355 __ Mov(vector, instr->hydrogen()->feedback_vector());
3356 // No need to allocate this register.
3357 DCHECK(LoadIC::SlotRegister().is(x0));
3358 __ Mov(LoadIC::SlotRegister(),
3359 Smi::FromInt(instr->hydrogen()->slot()));
3360 } 3366 }
3361 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; 3367 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
3362 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); 3368 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode);
3363 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3369 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3364 } 3370 }
3365 3371
3366 3372
3367 MemOperand LCodeGen::PrepareKeyedExternalArrayOperand( 3373 MemOperand LCodeGen::PrepareKeyedExternalArrayOperand(
3368 Register key, 3374 Register key,
3369 Register base, 3375 Register base,
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
3604 } 3610 }
3605 } 3611 }
3606 } 3612 }
3607 3613
3608 3614
3609 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { 3615 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
3610 DCHECK(ToRegister(instr->context()).is(cp)); 3616 DCHECK(ToRegister(instr->context()).is(cp));
3611 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); 3617 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister()));
3612 DCHECK(ToRegister(instr->key()).is(LoadIC::NameRegister())); 3618 DCHECK(ToRegister(instr->key()).is(LoadIC::NameRegister()));
3613 if (FLAG_vector_ics) { 3619 if (FLAG_vector_ics) {
3614 Register vector = ToRegister(instr->temp_vector()); 3620 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
3615 DCHECK(vector.is(LoadIC::VectorRegister()));
3616 __ Mov(vector, instr->hydrogen()->feedback_vector());
3617 // No need to allocate this register.
3618 DCHECK(LoadIC::SlotRegister().is(x0));
3619 __ Mov(LoadIC::SlotRegister(),
3620 Smi::FromInt(instr->hydrogen()->slot()));
3621 } 3621 }
3622 3622
3623 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); 3623 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
3624 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3624 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3625 3625
3626 DCHECK(ToRegister(instr->result()).Is(x0)); 3626 DCHECK(ToRegister(instr->result()).Is(x0));
3627 } 3627 }
3628 3628
3629 3629
3630 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { 3630 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
3666 } 3666 }
3667 } 3667 }
3668 3668
3669 3669
3670 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 3670 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
3671 DCHECK(ToRegister(instr->context()).is(cp)); 3671 DCHECK(ToRegister(instr->context()).is(cp));
3672 // LoadIC expects name and receiver in registers. 3672 // LoadIC expects name and receiver in registers.
3673 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); 3673 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister()));
3674 __ Mov(LoadIC::NameRegister(), Operand(instr->name())); 3674 __ Mov(LoadIC::NameRegister(), Operand(instr->name()));
3675 if (FLAG_vector_ics) { 3675 if (FLAG_vector_ics) {
3676 Register vector = ToRegister(instr->temp_vector()); 3676 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
3677 DCHECK(vector.is(LoadIC::VectorRegister()));
3678 __ Mov(vector, instr->hydrogen()->feedback_vector());
3679 // No need to allocate this register.
3680 DCHECK(LoadIC::SlotRegister().is(x0));
3681 __ Mov(LoadIC::SlotRegister(),
3682 Smi::FromInt(instr->hydrogen()->slot()));
3683 } 3677 }
3684 3678
3685 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); 3679 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL);
3686 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3680 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3687 3681
3688 DCHECK(ToRegister(instr->result()).is(x0)); 3682 DCHECK(ToRegister(instr->result()).is(x0));
3689 } 3683 }
3690 3684
3691 3685
3692 void LCodeGen::DoLoadRoot(LLoadRoot* instr) { 3686 void LCodeGen::DoLoadRoot(LLoadRoot* instr) {
(...skipping 2332 matching lines...) Expand 10 before | Expand all | Expand 10 after
6025 Handle<ScopeInfo> scope_info = instr->scope_info(); 6019 Handle<ScopeInfo> scope_info = instr->scope_info();
6026 __ Push(scope_info); 6020 __ Push(scope_info);
6027 __ Push(ToRegister(instr->function())); 6021 __ Push(ToRegister(instr->function()));
6028 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6022 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6029 RecordSafepoint(Safepoint::kNoLazyDeopt); 6023 RecordSafepoint(Safepoint::kNoLazyDeopt);
6030 } 6024 }
6031 6025
6032 6026
6033 6027
6034 } } // namespace v8::internal 6028 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/lithium-codegen-arm64.h ('k') | src/ia32/lithium-codegen-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698