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

Unified Diff: src/compiler/raw-machine-assembler.cc

Issue 1090393003: Simplified 'return' handling in the instruction selector. (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
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/raw-machine-assembler.cc
diff --git a/src/compiler/raw-machine-assembler.cc b/src/compiler/raw-machine-assembler.cc
index 489c2ca6d9c26b0bb002c2224535c6d2b38dc21e..6a339e7c918d0c60350c847e483209f7865daf53 100644
--- a/src/compiler/raw-machine-assembler.cc
+++ b/src/compiler/raw-machine-assembler.cc
@@ -101,7 +101,8 @@ void RawMachineAssembler::Switch(Node* index, Label* default_label,
void RawMachineAssembler::Return(Node* value) {
- schedule()->AddReturn(CurrentBlock(), value);
+ Node* ret = NewNode(common()->Return(), value);
+ schedule()->AddReturn(CurrentBlock(), ret);
current_block_ = NULL;
}
@@ -183,7 +184,9 @@ Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count,
Node* node = graph()->NewNode(op, input_count, inputs, incomplete);
BasicBlock* block = op->opcode() == IrOpcode::kParameter ? schedule()->start()
: CurrentBlock();
- schedule()->AddNode(block, node);
+ if (op->opcode() != IrOpcode::kReturn) {
+ schedule()->AddNode(block, node);
+ }
return node;
}
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698