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

Unified Diff: src/compiler/schedule.cc

Issue 1114163005: [turbofan] Fix tail call optimization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/compiler/schedule.cc
diff --git a/src/compiler/schedule.cc b/src/compiler/schedule.cc
index f30e5f61ceb9d944a8afdbe0c16ba2a5822f4a62..adb80a7b081b7c3ceba52752f589d669e25241bc 100644
--- a/src/compiler/schedule.cc
+++ b/src/compiler/schedule.cc
@@ -108,6 +108,8 @@ std::ostream& operator<<(std::ostream& os, const BasicBlock::Control& c) {
return os << "switch";
case BasicBlock::kDeoptimize:
return os << "deoptimize";
+ case BasicBlock::kTailCall:
+ return os << "tailcall";
case BasicBlock::kReturn:
return os << "return";
case BasicBlock::kThrow:
@@ -233,6 +235,14 @@ void Schedule::AddSwitch(BasicBlock* block, Node* sw, BasicBlock** succ_blocks,
}
+void Schedule::AddTailCall(BasicBlock* block, Node* input) {
+ DCHECK_EQ(BasicBlock::kNone, block->control());
+ block->set_control(BasicBlock::kTailCall);
+ SetControlInput(block, input);
+ if (block != end()) AddSuccessor(block, end());
+}
+
+
void Schedule::AddReturn(BasicBlock* block, Node* input) {
DCHECK_EQ(BasicBlock::kNone, block->control());
block->set_control(BasicBlock::kReturn);

Powered by Google App Engine
This is Rietveld 408576698