Chromium Code Reviews| Index: runtime/vm/kernel_to_il.cc |
| diff --git a/runtime/vm/kernel_to_il.cc b/runtime/vm/kernel_to_il.cc |
| index 06143c84f178cb1f2b180901e3e5fb99dbfc6fb9..da505bab301777e3ee7fc6e044527b7956890ac8 100644 |
| --- a/runtime/vm/kernel_to_il.cc |
| +++ b/runtime/vm/kernel_to_il.cc |
| @@ -734,7 +734,8 @@ class BreakableBlock { |
| outer_(builder->breakable_block_), |
| destination_(NULL), |
| outer_finally_(builder->try_finally_block_), |
| - context_depth_(builder->context_depth_) { |
| + context_depth_(builder->context_depth_), |
| + try_index_(builder->CurrentTryIndex()) { |
| builder_->breakable_block_ = this; |
| } |
| ~BreakableBlock() { builder_->breakable_block_ = outer_; } |
| @@ -759,7 +760,7 @@ class BreakableBlock { |
| private: |
| JoinEntryInstr* EnsureDestination() { |
| if (destination_ == NULL) { |
| - destination_ = builder_->BuildJoinEntry(); |
| + destination_ = builder_->BuildJoinEntry(try_index_); |
| } |
| return destination_; |
| } |
| @@ -770,6 +771,7 @@ class BreakableBlock { |
| JoinEntryInstr* destination_; |
| TryFinallyBlock* outer_finally_; |
| intptr_t context_depth_; |
| + intptr_t try_index_; |
|
Vyacheslav Egorov (Google)
2017/01/17 22:24:08
const?
|
| }; |
| @@ -780,7 +782,8 @@ class SwitchBlock { |
| outer_(builder->switch_block_), |
| outer_finally_(builder->try_finally_block_), |
| switch_statement_(switch_stmt), |
| - context_depth_(builder->context_depth_) { |
| + context_depth_(builder->context_depth_), |
| + try_index_(builder->CurrentTryIndex()) { |
| builder_->switch_block_ = this; |
| } |
| ~SwitchBlock() { builder_->switch_block_ = outer_; } |
| @@ -816,7 +819,7 @@ class SwitchBlock { |
| JoinEntryInstr* EnsureDestination(SwitchCase* switch_case) { |
| JoinEntryInstr* cached_inst = destinations_.Lookup(switch_case); |
| if (cached_inst == NULL) { |
| - JoinEntryInstr* inst = builder_->BuildJoinEntry(); |
| + JoinEntryInstr* inst = builder_->BuildJoinEntry(try_index_); |
| destinations_.Insert(switch_case, inst); |
| return inst; |
| } |
| @@ -845,6 +848,7 @@ class SwitchBlock { |
| TryFinallyBlock* outer_finally_; |
| SwitchStatement* switch_statement_; |
| intptr_t context_depth_; |
| + intptr_t try_index_; |
|
Vyacheslav Egorov (Google)
2017/01/17 22:24:08
const?
|
| }; |
| @@ -3731,6 +3735,11 @@ TargetEntryInstr* FlowGraphBuilder::BuildTargetEntry() { |
| } |
| +JoinEntryInstr* FlowGraphBuilder::BuildJoinEntry(intptr_t try_index) { |
| + return new (Z) JoinEntryInstr(AllocateBlockId(), try_index); |
| +} |
| + |
| + |
| JoinEntryInstr* FlowGraphBuilder::BuildJoinEntry() { |
| return new (Z) JoinEntryInstr(AllocateBlockId(), CurrentTryIndex()); |
| } |