OLD | NEW |
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 3579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3590 | 3590 |
3591 CatchBlockEntryInstr* catch_entry = | 3591 CatchBlockEntryInstr* catch_entry = |
3592 new CatchBlockEntryInstr(owner()->AllocateBlockId(), | 3592 new CatchBlockEntryInstr(owner()->AllocateBlockId(), |
3593 catch_handler_index, | 3593 catch_handler_index, |
3594 catch_block->handler_types(), | 3594 catch_block->handler_types(), |
3595 try_handler_index, | 3595 try_handler_index, |
3596 catch_block->exception_var(), | 3596 catch_block->exception_var(), |
3597 catch_block->stacktrace_var(), | 3597 catch_block->stacktrace_var(), |
3598 catch_block->needs_stacktrace()); | 3598 catch_block->needs_stacktrace()); |
3599 owner()->AddCatchEntry(catch_entry); | 3599 owner()->AddCatchEntry(catch_entry); |
3600 ASSERT(!for_catch.is_open()); | |
3601 AppendFragment(catch_entry, for_catch); | 3600 AppendFragment(catch_entry, for_catch); |
3602 | 3601 |
3603 JoinEntryInstr* join = node->end_catch_label()->join_for_continue(); | 3602 if (for_catch.is_open()) { |
3604 if (join != NULL) { | 3603 JoinEntryInstr* join = new JoinEntryInstr(owner()->AllocateBlockId(), |
| 3604 original_handler_index); |
| 3605 for_catch.Goto(join); |
3605 if (is_open()) Goto(join); | 3606 if (is_open()) Goto(join); |
3606 exit_ = join; | 3607 exit_ = join; |
3607 } | 3608 } |
3608 | 3609 |
3609 if (finally_block != NULL) { | 3610 if (finally_block != NULL) { |
3610 // Create a handler for the code in the catch block, containing the | 3611 // Create a handler for the code in the catch block, containing the |
3611 // code in the finally block. | 3612 // code in the finally block. |
3612 owner()->set_try_index(original_handler_index); | 3613 owner()->set_try_index(original_handler_index); |
3613 EffectGraphVisitor for_finally(owner()); | 3614 EffectGraphVisitor for_finally(owner()); |
3614 for_finally.BuildRestoreContext(catch_block->context_var()); | 3615 for_finally.BuildRestoreContext(catch_block->context_var()); |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3883 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 3884 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
3884 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 3885 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
3885 OS::SNPrint(chars, len, kFormat, function_name, reason); | 3886 OS::SNPrint(chars, len, kFormat, function_name, reason); |
3886 const Error& error = Error::Handle( | 3887 const Error& error = Error::Handle( |
3887 LanguageError::New(String::Handle(String::New(chars)))); | 3888 LanguageError::New(String::Handle(String::New(chars)))); |
3888 Isolate::Current()->long_jump_base()->Jump(1, error); | 3889 Isolate::Current()->long_jump_base()->Jump(1, error); |
3889 } | 3890 } |
3890 | 3891 |
3891 | 3892 |
3892 } // namespace dart | 3893 } // namespace dart |
OLD | NEW |