| 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/code_descriptors.h" | 10 #include "vm/code_descriptors.h" |
| (...skipping 3255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3266 | 3266 |
| 3267 Goto(try_entry); | 3267 Goto(try_entry); |
| 3268 AppendFragment(try_entry, for_try_block); | 3268 AppendFragment(try_entry, for_try_block); |
| 3269 exit_ = for_try_block.exit_; | 3269 exit_ = for_try_block.exit_; |
| 3270 | 3270 |
| 3271 // We are done generating code for the try block. | 3271 // We are done generating code for the try block. |
| 3272 owner()->set_try_index(old_try_index); | 3272 owner()->set_try_index(old_try_index); |
| 3273 | 3273 |
| 3274 CatchClauseNode* catch_block = node->catch_block(); | 3274 CatchClauseNode* catch_block = node->catch_block(); |
| 3275 if (catch_block != NULL) { | 3275 if (catch_block != NULL) { |
| 3276 // Set the corresponding try index for this catch block so | |
| 3277 // that we can set the appropriate handler pc when we generate | |
| 3278 // code for this catch block. | |
| 3279 catch_block->set_try_index(try_index); | |
| 3280 EffectGraphVisitor for_catch_block(owner(), temp_index()); | 3276 EffectGraphVisitor for_catch_block(owner(), temp_index()); |
| 3281 catch_block->Visit(&for_catch_block); | 3277 catch_block->Visit(&for_catch_block); |
| 3282 CatchBlockEntryInstr* catch_entry = | 3278 CatchBlockEntryInstr* catch_entry = |
| 3283 new CatchBlockEntryInstr(owner()->AllocateBlockId(), | 3279 new CatchBlockEntryInstr(owner()->AllocateBlockId(), |
| 3284 old_try_index, | 3280 old_try_index, |
| 3285 catch_block->handler_types(), | 3281 catch_block->handler_types(), |
| 3286 try_index); | 3282 try_index); |
| 3287 owner()->AddCatchEntry(catch_entry); | 3283 owner()->AddCatchEntry(catch_entry); |
| 3288 ASSERT(!for_catch_block.is_open()); | 3284 ASSERT(!for_catch_block.is_open()); |
| 3289 AppendFragment(catch_entry, for_catch_block); | 3285 AppendFragment(catch_entry, for_catch_block); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3514 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 3510 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 3515 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 3511 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 3516 OS::SNPrint(chars, len, kFormat, function_name, reason); | 3512 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 3517 const Error& error = Error::Handle( | 3513 const Error& error = Error::Handle( |
| 3518 LanguageError::New(String::Handle(String::New(chars)))); | 3514 LanguageError::New(String::Handle(String::New(chars)))); |
| 3519 Isolate::Current()->long_jump_base()->Jump(1, error); | 3515 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 3520 } | 3516 } |
| 3521 | 3517 |
| 3522 | 3518 |
| 3523 } // namespace dart | 3519 } // namespace dart |
| OLD | NEW |