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

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

Issue 23445012: Mark exception handlers if they have a stacktrace specified. Do not build a stacktrace if the handl… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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
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/code_descriptors.h" 10 #include "vm/code_descriptors.h"
(...skipping 3461 matching lines...) Expand 10 before | Expand all | Expand 10 after
3472 // and ':stacktrace_var' can never be captured variables. 3472 // and ':stacktrace_var' can never be captured variables.
3473 ASSERT(!catch_block->exception_var().is_captured()); 3473 ASSERT(!catch_block->exception_var().is_captured());
3474 ASSERT(!catch_block->stacktrace_var().is_captured()); 3474 ASSERT(!catch_block->stacktrace_var().is_captured());
3475 3475
3476 CatchBlockEntryInstr* catch_entry = 3476 CatchBlockEntryInstr* catch_entry =
3477 new CatchBlockEntryInstr(owner()->AllocateBlockId(), 3477 new CatchBlockEntryInstr(owner()->AllocateBlockId(),
3478 catch_handler_index, 3478 catch_handler_index,
3479 catch_block->handler_types(), 3479 catch_block->handler_types(),
3480 try_handler_index, 3480 try_handler_index,
3481 catch_block->exception_var(), 3481 catch_block->exception_var(),
3482 catch_block->stacktrace_var()); 3482 catch_block->stacktrace_var(),
3483 catch_block->needs_stacktrace());
3483 owner()->AddCatchEntry(catch_entry); 3484 owner()->AddCatchEntry(catch_entry);
3484 ASSERT(!for_catch.is_open()); 3485 ASSERT(!for_catch.is_open());
3485 AppendFragment(catch_entry, for_catch); 3486 AppendFragment(catch_entry, for_catch);
3486 if (node->end_catch_label() != NULL) { 3487 if (node->end_catch_label() != NULL) {
3487 JoinEntryInstr* join = node->end_catch_label()->join_for_continue(); 3488 JoinEntryInstr* join = node->end_catch_label()->join_for_continue();
3488 if (join != NULL) { 3489 if (join != NULL) {
3489 if (is_open()) Goto(join); 3490 if (is_open()) Goto(join);
3490 exit_ = join; 3491 exit_ = join;
3491 } 3492 }
3492 } 3493 }
(...skipping 20 matching lines...) Expand all
3513 ASSERT(!for_finally.is_open()); 3514 ASSERT(!for_finally.is_open());
3514 3515
3515 const Array& types = Array::ZoneHandle(Array::New(1, Heap::kOld)); 3516 const Array& types = Array::ZoneHandle(Array::New(1, Heap::kOld));
3516 types.SetAt(0, Type::Handle(Type::DynamicType())); 3517 types.SetAt(0, Type::Handle(Type::DynamicType()));
3517 CatchBlockEntryInstr* finally_entry = 3518 CatchBlockEntryInstr* finally_entry =
3518 new CatchBlockEntryInstr(owner()->AllocateBlockId(), 3519 new CatchBlockEntryInstr(owner()->AllocateBlockId(),
3519 original_handler_index, 3520 original_handler_index,
3520 types, 3521 types,
3521 catch_handler_index, 3522 catch_handler_index,
3522 catch_block->exception_var(), 3523 catch_block->exception_var(),
3523 catch_block->stacktrace_var()); 3524 catch_block->stacktrace_var(),
3525 catch_block->needs_stacktrace());
3524 owner()->AddCatchEntry(finally_entry); 3526 owner()->AddCatchEntry(finally_entry);
3525 AppendFragment(finally_entry, for_finally); 3527 AppendFragment(finally_entry, for_finally);
3526 } 3528 }
3527 3529
3528 // Generate code for the finally block if one exists. 3530 // Generate code for the finally block if one exists.
3529 if ((finally_block != NULL) && is_open()) { 3531 if ((finally_block != NULL) && is_open()) {
3530 EffectGraphVisitor for_finally_block(owner(), temp_index()); 3532 EffectGraphVisitor for_finally_block(owner(), temp_index());
3531 finally_block->Visit(&for_finally_block); 3533 finally_block->Visit(&for_finally_block);
3532 Append(for_finally_block); 3534 Append(for_finally_block);
3533 } 3535 }
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
3749 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 3751 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
3750 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 3752 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
3751 OS::SNPrint(chars, len, kFormat, function_name, reason); 3753 OS::SNPrint(chars, len, kFormat, function_name, reason);
3752 const Error& error = Error::Handle( 3754 const Error& error = Error::Handle(
3753 LanguageError::New(String::Handle(String::New(chars)))); 3755 LanguageError::New(String::Handle(String::New(chars))));
3754 Isolate::Current()->long_jump_base()->Jump(1, error); 3756 Isolate::Current()->long_jump_base()->Jump(1, error);
3755 } 3757 }
3756 3758
3757 3759
3758 } // namespace dart 3760 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698