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

Unified Diff: runtime/vm/kernel_to_il.cc

Issue 2637993002: VM: [Kernel] Ensure we have correct try-index on join blocks for break destinations (Closed)
Patch Set: Mark 2 tests as Dartk issue Created 3 years, 11 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 | « runtime/vm/kernel_to_il.h ('k') | tests/language/language_kernel.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « runtime/vm/kernel_to_il.h ('k') | tests/language/language_kernel.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698