Index: runtime/vm/branch_optimizer.cc |
diff --git a/runtime/vm/branch_optimizer.cc b/runtime/vm/branch_optimizer.cc |
index f68bbcaef3379903f93cec3ce13d18b07e604846..00ef0c87ff27ed8b0bdc764f2c29929dc6ce7020 100644 |
--- a/runtime/vm/branch_optimizer.cc |
+++ b/runtime/vm/branch_optimizer.cc |
@@ -66,7 +66,8 @@ JoinEntryInstr* BranchSimplifier::ToJoinEntry(Zone* zone, |
// 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()); |
+ new (zone) JoinEntryInstr(target->block_id(), target->try_index(), |
+ Thread::Current()->GetNextDeoptId()); |
Vyacheslav Egorov (Google)
2017/05/23 12:00:00
This can be Thread::kNoDeoptId because we copy the
|
join->InheritDeoptTarget(zone, target); |
join->LinkTo(target->next()); |
join->set_last_instruction(target->last_instruction()); |
@@ -82,7 +83,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::Current()->GetNextDeoptId()); |
Vyacheslav Egorov (Google)
2017/05/23 12:00:00
This should probably be Thread::kNoDeoptId
(e.g.
|
return new_branch; |
} |
@@ -183,20 +185,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::Current()->GetNextDeoptId()); |
Vyacheslav Egorov (Google)
2017/05/23 12:00:01
kNoDeoptId here, because it is overwritten anyway
|
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(), |
Vyacheslav Egorov (Google)
2017/05/23 12:00:01
ditto
|
+ Thread::Current()->GetNextDeoptId()); |
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::Current()->GetNextDeoptId()); |
Vyacheslav Egorov (Google)
2017/05/23 12:00:00
ditto
|
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::Current()->GetNextDeoptId()); |
Vyacheslav Egorov (Google)
2017/05/23 12:00:01
ditto
|
goto_false->InheritDeoptTarget(zone, join_false); |
false_target->LinkTo(goto_false); |
false_target->set_last_instruction(goto_false); |
@@ -296,7 +302,8 @@ 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)); |
+ new_comparison, if_true->Copy(zone), if_false->Copy(zone), |
+ Thread::Current()->GetNextDeoptId()); |
Vyacheslav Egorov (Google)
2017/05/23 12:00:00
I think this should be Thread::kNoDeoptId because
|
flow_graph->InsertBefore(branch, if_then_else, NULL, |
FlowGraph::kValue); |