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

Side by Side Diff: runtime/vm/flow_graph_builder.cc

Issue 1006463003: Fix restoring of contexts in inlined finally code (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph_builder.h" 5 #include "vm/flow_graph_builder.h"
6 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/ast_printer.h" 8 #include "vm/ast_printer.h"
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 4274 matching lines...) Expand 10 before | Expand all | Expand 10 after
4285 void EffectGraphVisitor::VisitInlinedFinallyNode(InlinedFinallyNode* node) { 4285 void EffectGraphVisitor::VisitInlinedFinallyNode(InlinedFinallyNode* node) {
4286 InlineBailout("EffectGraphVisitor::VisitInlinedFinallyNode (exception)"); 4286 InlineBailout("EffectGraphVisitor::VisitInlinedFinallyNode (exception)");
4287 const intptr_t try_index = owner()->try_index(); 4287 const intptr_t try_index = owner()->try_index();
4288 if (try_index >= 0) { 4288 if (try_index >= 0) {
4289 // We are about to generate code for an inlined finally block. Exceptions 4289 // We are about to generate code for an inlined finally block. Exceptions
4290 // thrown in this block of code should be treated as though they are 4290 // thrown in this block of code should be treated as though they are
4291 // thrown not from the current try block but the outer try block if any. 4291 // thrown not from the current try block but the outer try block if any.
4292 intptr_t outer_try_index = node->try_index(); 4292 intptr_t outer_try_index = node->try_index();
4293 owner()->set_try_index(outer_try_index); 4293 owner()->set_try_index(outer_try_index);
4294 } 4294 }
4295 BuildRestoreContext(node->context_var());
4296 4295
srdjan 2015/03/12 22:09:22 Add a comment, similar to the on in CL, so that no
4297 JoinEntryInstr* finally_entry = 4296 JoinEntryInstr* finally_entry =
4298 new(I) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index()); 4297 new(I) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
4299 EffectGraphVisitor for_finally_block(owner()); 4298 EffectGraphVisitor for_finally_block(owner());
4300 node->finally_block()->Visit(&for_finally_block); 4299 node->finally_block()->Visit(&for_finally_block);
4301 4300
4302 if (try_index >= 0) { 4301 if (try_index >= 0) {
4303 owner()->set_try_index(try_index); 4302 owner()->set_try_index(try_index);
4304 } 4303 }
4305 4304
4306 if (for_finally_block.is_open()) { 4305 if (for_finally_block.is_open()) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
4363 Report::MessageF(Report::kBailout, 4362 Report::MessageF(Report::kBailout,
4364 Script::Handle(function.script()), 4363 Script::Handle(function.script()),
4365 function.token_pos(), 4364 function.token_pos(),
4366 "FlowGraphBuilder Bailout: %s %s", 4365 "FlowGraphBuilder Bailout: %s %s",
4367 String::Handle(function.name()).ToCString(), 4366 String::Handle(function.name()).ToCString(),
4368 reason); 4367 reason);
4369 UNREACHABLE(); 4368 UNREACHABLE();
4370 } 4369 }
4371 4370
4372 } // namespace dart 4371 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698