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

Unified Diff: src/compiler/bytecode-graph-builder.cc

Issue 1698273003: [es6] [interpreter] Add tail calls support to Ignition. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@tco-turbo-2
Patch Set: Fixed Bytecodes::IsCallOrNew() Created 4 years, 10 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
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index 527e2ddaa2f65ff1961d4c781b922446dba1ebf4..db4900cea7726aed7d1178b034650c073c89721d 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -993,7 +993,7 @@ Node* BytecodeGraphBuilder::ProcessCallArguments(const Operator* call_op,
return value;
}
-void BytecodeGraphBuilder::BuildCall() {
+void BytecodeGraphBuilder::BuildCall(TailCallMode tail_call_mode) {
FrameStateBeforeAndAfter states(this);
// TODO(rmcilroy): Set receiver_hint correctly based on whether the receiver
// register has been loaded with null / undefined explicitly or we are sure it
@@ -1006,16 +1006,23 @@ void BytecodeGraphBuilder::BuildCall() {
VectorSlotPair feedback =
CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(3));
- // TODO(ishell): provide correct tail_call_mode value to CallFunction.
- const Operator* call =
- javascript()->CallFunction(arg_count + 1, feedback, receiver_hint);
+ const Operator* call = javascript()->CallFunction(
+ arg_count + 1, feedback, receiver_hint, tail_call_mode);
Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 1);
environment()->BindAccumulator(value, &states);
}
-void BytecodeGraphBuilder::VisitCall() { BuildCall(); }
+void BytecodeGraphBuilder::VisitCall() { BuildCall(TailCallMode::kDisallow); }
-void BytecodeGraphBuilder::VisitCallWide() { BuildCall(); }
+void BytecodeGraphBuilder::VisitCallWide() {
+ BuildCall(TailCallMode::kDisallow);
+}
+
+void BytecodeGraphBuilder::VisitTailCall() { BuildCall(TailCallMode::kAllow); }
+
+void BytecodeGraphBuilder::VisitTailCallWide() {
+ BuildCall(TailCallMode::kAllow);
+}
void BytecodeGraphBuilder::BuildCallJSRuntime() {
FrameStateBeforeAndAfter states(this);
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698