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

Side by Side Diff: src/crankshaft/arm/lithium-codegen-arm.cc

Issue 1609893003: [es6] Tail calls support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing Created 4 years, 11 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
« no previous file with comments | « src/compiler/js-operator.cc ('k') | src/crankshaft/arm64/lithium-codegen-arm64.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/crankshaft/arm/lithium-codegen-arm.h" 5 #include "src/crankshaft/arm/lithium-codegen-arm.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h"
(...skipping 3694 matching lines...) Expand 10 before | Expand all | Expand 10 after
3705 3705
3706 // Load the code entry address 3706 // Load the code entry address
3707 __ ldr(ip, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); 3707 __ ldr(ip, FieldMemOperand(r1, JSFunction::kCodeEntryOffset));
3708 __ Call(ip); 3708 __ Call(ip);
3709 3709
3710 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); 3710 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT);
3711 } 3711 }
3712 3712
3713 3713
3714 void LCodeGen::DoCallFunction(LCallFunction* instr) { 3714 void LCodeGen::DoCallFunction(LCallFunction* instr) {
3715 HCallFunction* hinstr = instr->hydrogen();
3715 DCHECK(ToRegister(instr->context()).is(cp)); 3716 DCHECK(ToRegister(instr->context()).is(cp));
3716 DCHECK(ToRegister(instr->function()).is(r1)); 3717 DCHECK(ToRegister(instr->function()).is(r1));
3717 DCHECK(ToRegister(instr->result()).is(r0)); 3718 DCHECK(ToRegister(instr->result()).is(r0));
3718 3719
3719 int arity = instr->arity(); 3720 int arity = instr->arity();
3720 ConvertReceiverMode mode = instr->hydrogen()->convert_mode(); 3721 ConvertReceiverMode mode = hinstr->convert_mode();
3721 if (instr->hydrogen()->HasVectorAndSlot()) { 3722 TailCallMode tail_call_mode = hinstr->tail_call_mode();
3723 if (hinstr->HasVectorAndSlot()) {
3722 Register slot_register = ToRegister(instr->temp_slot()); 3724 Register slot_register = ToRegister(instr->temp_slot());
3723 Register vector_register = ToRegister(instr->temp_vector()); 3725 Register vector_register = ToRegister(instr->temp_vector());
3724 DCHECK(slot_register.is(r3)); 3726 DCHECK(slot_register.is(r3));
3725 DCHECK(vector_register.is(r2)); 3727 DCHECK(vector_register.is(r2));
3726 3728
3727 AllowDeferredHandleDereference vector_structure_check; 3729 AllowDeferredHandleDereference vector_structure_check;
3728 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); 3730 Handle<TypeFeedbackVector> vector = hinstr->feedback_vector();
3729 int index = vector->GetIndex(instr->hydrogen()->slot()); 3731 int index = vector->GetIndex(hinstr->slot());
3730 3732
3731 __ Move(vector_register, vector); 3733 __ Move(vector_register, vector);
3732 __ mov(slot_register, Operand(Smi::FromInt(index))); 3734 __ mov(slot_register, Operand(Smi::FromInt(index)));
3733 3735
3734 Handle<Code> ic = 3736 Handle<Code> ic = CodeFactory::CallICInOptimizedCode(isolate(), arity, mode,
3735 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); 3737 tail_call_mode)
3738 .code();
3736 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3739 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3737 } else { 3740 } else {
3738 __ mov(r0, Operand(arity)); 3741 __ mov(r0, Operand(arity));
3739 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); 3742 CallCode(isolate()->builtins()->Call(mode, tail_call_mode),
3743 RelocInfo::CODE_TARGET, instr);
3740 } 3744 }
3741 } 3745 }
3742 3746
3743 3747
3744 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { 3748 void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
3745 DCHECK(ToRegister(instr->context()).is(cp)); 3749 DCHECK(ToRegister(instr->context()).is(cp));
3746 DCHECK(ToRegister(instr->constructor()).is(r1)); 3750 DCHECK(ToRegister(instr->constructor()).is(r1));
3747 DCHECK(ToRegister(instr->result()).is(r0)); 3751 DCHECK(ToRegister(instr->result()).is(r0));
3748 3752
3749 __ mov(r0, Operand(instr->arity())); 3753 __ mov(r0, Operand(instr->arity()));
(...skipping 1828 matching lines...) Expand 10 before | Expand all | Expand 10 after
5578 __ push(ToRegister(instr->function())); 5582 __ push(ToRegister(instr->function()));
5579 CallRuntime(Runtime::kPushBlockContext, instr); 5583 CallRuntime(Runtime::kPushBlockContext, instr);
5580 RecordSafepoint(Safepoint::kNoLazyDeopt); 5584 RecordSafepoint(Safepoint::kNoLazyDeopt);
5581 } 5585 }
5582 5586
5583 5587
5584 #undef __ 5588 #undef __
5585 5589
5586 } // namespace internal 5590 } // namespace internal
5587 } // namespace v8 5591 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-operator.cc ('k') | src/crankshaft/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698