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

Unified Diff: runtime/vm/branch_optimizer.cc

Issue 2900963008: Reapply "Shuffle around deopt id allocation... (Closed)
Patch Set: . Created 3 years, 7 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: runtime/vm/branch_optimizer.cc
diff --git a/runtime/vm/branch_optimizer.cc b/runtime/vm/branch_optimizer.cc
index f68bbcaef3379903f93cec3ce13d18b07e604846..0048b7ed637da3a17cc9cff4b85cb046595f6954 100644
--- a/runtime/vm/branch_optimizer.cc
+++ b/runtime/vm/branch_optimizer.cc
@@ -65,8 +65,8 @@ JoinEntryInstr* BranchSimplifier::ToJoinEntry(Zone* zone,
// Convert a target block into a join block. Branches will be duplicated
// so the former true and false targets become joins of the control flows
// from all the duplicated branches.
- JoinEntryInstr* join =
- new (zone) JoinEntryInstr(target->block_id(), target->try_index());
+ JoinEntryInstr* join = new (zone) JoinEntryInstr(
+ target->block_id(), target->try_index(), Thread::kNoDeoptId);
join->InheritDeoptTarget(zone, target);
join->LinkTo(target->next());
join->set_last_instruction(target->last_instruction());
@@ -82,7 +82,8 @@ BranchInstr* BranchSimplifier::CloneBranch(Zone* zone,
ComparisonInstr* comparison = branch->comparison();
ComparisonInstr* new_comparison =
comparison->CopyWithNewOperands(new_left, new_right);
- BranchInstr* new_branch = new (zone) BranchInstr(new_comparison);
+ BranchInstr* new_branch =
+ new (zone) BranchInstr(new_comparison, Thread::kNoDeoptId);
return new_branch;
}
@@ -183,20 +184,24 @@ void BranchSimplifier::Simplify(FlowGraph* flow_graph) {
// Connect the branch to the true and false joins, via empty target
// blocks.
- TargetEntryInstr* true_target = new (zone) TargetEntryInstr(
- flow_graph->max_block_id() + 1, block->try_index());
+ TargetEntryInstr* true_target =
+ new (zone) TargetEntryInstr(flow_graph->max_block_id() + 1,
+ block->try_index(), Thread::kNoDeoptId);
true_target->InheritDeoptTarget(zone, join_true);
- TargetEntryInstr* false_target = new (zone) TargetEntryInstr(
- flow_graph->max_block_id() + 2, block->try_index());
+ TargetEntryInstr* false_target =
+ new (zone) TargetEntryInstr(flow_graph->max_block_id() + 2,
+ block->try_index(), Thread::kNoDeoptId);
false_target->InheritDeoptTarget(zone, join_false);
flow_graph->set_max_block_id(flow_graph->max_block_id() + 2);
*new_branch->true_successor_address() = true_target;
*new_branch->false_successor_address() = false_target;
- GotoInstr* goto_true = new (zone) GotoInstr(join_true);
+ GotoInstr* goto_true =
+ new (zone) GotoInstr(join_true, Thread::kNoDeoptId);
goto_true->InheritDeoptTarget(zone, join_true);
true_target->LinkTo(goto_true);
true_target->set_last_instruction(goto_true);
- GotoInstr* goto_false = new (zone) GotoInstr(join_false);
+ GotoInstr* goto_false =
+ new (zone) GotoInstr(join_false, Thread::kNoDeoptId);
goto_false->InheritDeoptTarget(zone, join_false);
false_target->LinkTo(goto_false);
false_target->set_last_instruction(goto_false);
@@ -295,8 +300,9 @@ void IfConverter::Simplify(FlowGraph* flow_graph) {
ComparisonInstr* new_comparison = comparison->CopyWithNewOperands(
comparison->left()->Copy(zone), comparison->right()->Copy(zone));
- IfThenElseInstr* if_then_else = new (zone) IfThenElseInstr(
- new_comparison, if_true->Copy(zone), if_false->Copy(zone));
+ IfThenElseInstr* if_then_else = new (zone)
+ IfThenElseInstr(new_comparison, if_true->Copy(zone),
+ if_false->Copy(zone), Thread::kNoDeoptId);
flow_graph->InsertBefore(branch, if_then_else, NULL,
FlowGraph::kValue);

Powered by Google App Engine
This is Rietveld 408576698