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

Unified 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: Support for CS and TF compilers added 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 side-by-side diff with in-line comments
Download patch
Index: src/crankshaft/x64/lithium-codegen-x64.cc
diff --git a/src/crankshaft/x64/lithium-codegen-x64.cc b/src/crankshaft/x64/lithium-codegen-x64.cc
index feb071d848583b55a576c8383017eddfa1327bfd..bfb16d12b1134b93ce79edaf52f915cb3215f8b8 100644
--- a/src/crankshaft/x64/lithium-codegen-x64.cc
+++ b/src/crankshaft/x64/lithium-codegen-x64.cc
@@ -3741,31 +3741,37 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
void LCodeGen::DoCallFunction(LCallFunction* instr) {
+ HCallFunction* hinstr = instr->hydrogen();
DCHECK(ToRegister(instr->context()).is(rsi));
DCHECK(ToRegister(instr->function()).is(rdi));
DCHECK(ToRegister(instr->result()).is(rax));
int arity = instr->arity();
- ConvertReceiverMode mode = instr->hydrogen()->convert_mode();
- if (instr->hydrogen()->HasVectorAndSlot()) {
+
+ ConvertReceiverMode mode = hinstr->convert_mode();
+ TailCallMode tail_call_mode = hinstr->tail_call_mode();
+ if (hinstr->HasVectorAndSlot()) {
Register slot_register = ToRegister(instr->temp_slot());
Register vector_register = ToRegister(instr->temp_vector());
DCHECK(slot_register.is(rdx));
DCHECK(vector_register.is(rbx));
AllowDeferredHandleDereference vector_structure_check;
- Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector();
- int index = vector->GetIndex(instr->hydrogen()->slot());
+ Handle<TypeFeedbackVector> vector = hinstr->feedback_vector();
+ int index = vector->GetIndex(hinstr->slot());
__ Move(vector_register, vector);
__ Move(slot_register, Smi::FromInt(index));
- Handle<Code> ic =
- CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code();
+ // TODO(ishell): propagate correct TailCallMode
+ Handle<Code> ic = CodeFactory::CallICInOptimizedCode(isolate(), arity, mode,
+ tail_call_mode)
+ .code();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
} else {
__ Set(rax, arity);
- CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr);
+ CallCode(isolate()->builtins()->Call(mode, tail_call_mode),
+ RelocInfo::CODE_TARGET, instr);
}
}

Powered by Google App Engine
This is Rietveld 408576698