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

Unified Diff: src/compiler/instruction-selector.cc

Issue 928213003: Model exceptional edges from call nodes in TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. Created 5 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/control-reducer.cc ('k') | src/compiler/js-intrinsic-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector.cc
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc
index c170a01d4a2bebbfe51e246254c2d86600c96ce2..2d0b2bd8af18c44af2b4691d306ee2ed42713045 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -485,34 +485,34 @@ void InstructionSelector::VisitBlock(BasicBlock* block) {
}
-namespace {
-
-V8_INLINE void CheckNoPhis(const BasicBlock* block) {
+void InstructionSelector::VisitControl(BasicBlock* block) {
#ifdef DEBUG
- // Branch targets should not have phis.
- for (BasicBlock::const_iterator i = block->begin(); i != block->end(); ++i) {
- const Node* node = *i;
- CHECK_NE(IrOpcode::kPhi, node->opcode());
+ // SSA deconstruction requires targets of branches not to have phis.
+ // Edge split form guarantees this property, but is more strict.
+ if (block->SuccessorCount() > 1) {
+ for (BasicBlock* const successor : block->successors()) {
+ for (Node* const node : *successor) {
+ CHECK(!IrOpcode::IsPhiOpcode(node->opcode()));
+ }
+ }
}
#endif
-}
-} // namespace
-
-
-void InstructionSelector::VisitControl(BasicBlock* block) {
Node* input = block->control_input();
switch (block->control()) {
case BasicBlock::kGoto:
return VisitGoto(block->SuccessorAt(0));
+ case BasicBlock::kCall: {
+ DCHECK_EQ(IrOpcode::kCall, input->opcode());
+ BasicBlock* success = block->SuccessorAt(0);
+ // TODO(mstarzinger): Record location of {exception} in {handler_table}.
+ // BasicBlock* exception = block->SuccessorAt(1);
+ return VisitCall(input), VisitGoto(success);
+ }
case BasicBlock::kBranch: {
DCHECK_EQ(IrOpcode::kBranch, input->opcode());
BasicBlock* tbranch = block->SuccessorAt(0);
BasicBlock* fbranch = block->SuccessorAt(1);
- // SSA deconstruction requires targets of branches not to have phis.
- // Edge split form guarantees this property, but is more strict.
- CheckNoPhis(tbranch);
- CheckNoPhis(fbranch);
if (tbranch == fbranch) return VisitGoto(tbranch);
// Treat special Branch(Always, IfTrue, IfFalse) as Goto(IfTrue).
Node* const condition = input->InputAt(0);
@@ -524,9 +524,6 @@ void InstructionSelector::VisitControl(BasicBlock* block) {
// Last successor must be Default.
BasicBlock* default_branch = block->successors().back();
DCHECK_EQ(IrOpcode::kIfDefault, default_branch->front()->opcode());
- // SSA deconstruction requires targets of branches not to have phis.
- // Edge split form guarantees this property, but is more strict.
- CheckNoPhis(default_branch);
// All other successors must be cases.
size_t case_count = block->SuccessorCount() - 1;
DCHECK_LE(1u, case_count);
@@ -541,9 +538,6 @@ void InstructionSelector::VisitControl(BasicBlock* block) {
case_values[index] = value;
if (min_value > value) min_value = value;
if (max_value < value) max_value = value;
- // SSA deconstruction requires targets of branches not to have phis.
- // Edge split form guarantees this property, but is more strict.
- CheckNoPhis(branch);
}
DCHECK_LE(min_value, max_value);
return VisitSwitch(input, default_branch, case_branches, case_values,
@@ -721,6 +715,8 @@ void InstructionSelector::VisitNode(Node* node) {
case IrOpcode::kBranch:
case IrOpcode::kIfTrue:
case IrOpcode::kIfFalse:
+ case IrOpcode::kIfSuccess:
+ case IrOpcode::kIfException:
case IrOpcode::kSwitch:
case IrOpcode::kIfValue:
case IrOpcode::kIfDefault:
« no previous file with comments | « src/compiler/control-reducer.cc ('k') | src/compiler/js-intrinsic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698