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

Side by Side Diff: src/crankshaft/x64/lithium-codegen-x64.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/crankshaft/mips64/lithium-codegen-mips64.cc ('k') | src/flag-definitions.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 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/crankshaft/x64/lithium-codegen-x64.h" 7 #include "src/crankshaft/x64/lithium-codegen-x64.h"
8 8
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 3716 matching lines...) Expand 10 before | Expand all | Expand 10 after
3727 __ InvokeFunction(rdi, no_reg, count, CALL_FUNCTION, generator); 3727 __ InvokeFunction(rdi, no_reg, count, CALL_FUNCTION, generator);
3728 } else { 3728 } else {
3729 CallKnownFunction(known_function, 3729 CallKnownFunction(known_function,
3730 instr->hydrogen()->formal_parameter_count(), 3730 instr->hydrogen()->formal_parameter_count(),
3731 instr->arity(), instr); 3731 instr->arity(), instr);
3732 } 3732 }
3733 } 3733 }
3734 3734
3735 3735
3736 void LCodeGen::DoCallFunction(LCallFunction* instr) { 3736 void LCodeGen::DoCallFunction(LCallFunction* instr) {
3737 HCallFunction* hinstr = instr->hydrogen();
3737 DCHECK(ToRegister(instr->context()).is(rsi)); 3738 DCHECK(ToRegister(instr->context()).is(rsi));
3738 DCHECK(ToRegister(instr->function()).is(rdi)); 3739 DCHECK(ToRegister(instr->function()).is(rdi));
3739 DCHECK(ToRegister(instr->result()).is(rax)); 3740 DCHECK(ToRegister(instr->result()).is(rax));
3740 3741
3741 int arity = instr->arity(); 3742 int arity = instr->arity();
3742 ConvertReceiverMode mode = instr->hydrogen()->convert_mode(); 3743
3743 if (instr->hydrogen()->HasVectorAndSlot()) { 3744 ConvertReceiverMode mode = hinstr->convert_mode();
3745 TailCallMode tail_call_mode = hinstr->tail_call_mode();
3746 if (hinstr->HasVectorAndSlot()) {
3744 Register slot_register = ToRegister(instr->temp_slot()); 3747 Register slot_register = ToRegister(instr->temp_slot());
3745 Register vector_register = ToRegister(instr->temp_vector()); 3748 Register vector_register = ToRegister(instr->temp_vector());
3746 DCHECK(slot_register.is(rdx)); 3749 DCHECK(slot_register.is(rdx));
3747 DCHECK(vector_register.is(rbx)); 3750 DCHECK(vector_register.is(rbx));
3748 3751
3749 AllowDeferredHandleDereference vector_structure_check; 3752 AllowDeferredHandleDereference vector_structure_check;
3750 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); 3753 Handle<TypeFeedbackVector> vector = hinstr->feedback_vector();
3751 int index = vector->GetIndex(instr->hydrogen()->slot()); 3754 int index = vector->GetIndex(hinstr->slot());
3752 3755
3753 __ Move(vector_register, vector); 3756 __ Move(vector_register, vector);
3754 __ Move(slot_register, Smi::FromInt(index)); 3757 __ Move(slot_register, Smi::FromInt(index));
3755 3758
3756 Handle<Code> ic = 3759 Handle<Code> ic = CodeFactory::CallICInOptimizedCode(isolate(), arity, mode,
3757 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); 3760 tail_call_mode)
3761 .code();
3758 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3762 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3759 } else { 3763 } else {
3760 __ Set(rax, arity); 3764 __ Set(rax, arity);
3761 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); 3765 CallCode(isolate()->builtins()->Call(mode, tail_call_mode),
3766 RelocInfo::CODE_TARGET, instr);
3762 } 3767 }
3763 } 3768 }
3764 3769
3765 3770
3766 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { 3771 void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
3767 DCHECK(ToRegister(instr->context()).is(rsi)); 3772 DCHECK(ToRegister(instr->context()).is(rsi));
3768 DCHECK(ToRegister(instr->constructor()).is(rdi)); 3773 DCHECK(ToRegister(instr->constructor()).is(rdi));
3769 DCHECK(ToRegister(instr->result()).is(rax)); 3774 DCHECK(ToRegister(instr->result()).is(rax));
3770 3775
3771 __ Set(rax, instr->arity()); 3776 __ Set(rax, instr->arity());
(...skipping 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after
5642 RecordSafepoint(Safepoint::kNoLazyDeopt); 5647 RecordSafepoint(Safepoint::kNoLazyDeopt);
5643 } 5648 }
5644 5649
5645 5650
5646 #undef __ 5651 #undef __
5647 5652
5648 } // namespace internal 5653 } // namespace internal
5649 } // namespace v8 5654 } // namespace v8
5650 5655
5651 #endif // V8_TARGET_ARCH_X64 5656 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/crankshaft/mips64/lithium-codegen-mips64.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698