| 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 4080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4091 if (finally_block != NULL) { | 4091 if (finally_block != NULL) { |
| 4092 // Create a handler for the code in the catch block, containing the | 4092 // Create a handler for the code in the catch block, containing the |
| 4093 // code in the finally block. | 4093 // code in the finally block. |
| 4094 owner()->set_try_index(original_handler_index); | 4094 owner()->set_try_index(original_handler_index); |
| 4095 EffectGraphVisitor for_finally(owner()); | 4095 EffectGraphVisitor for_finally(owner()); |
| 4096 for_finally.BuildRestoreContext(catch_block->context_var()); | 4096 for_finally.BuildRestoreContext(catch_block->context_var()); |
| 4097 | 4097 |
| 4098 finally_block->Visit(&for_finally); | 4098 finally_block->Visit(&for_finally); |
| 4099 if (for_finally.is_open()) { | 4099 if (for_finally.is_open()) { |
| 4100 // Rethrow the exception. Manually build the graph for rethrow. | 4100 // Rethrow the exception. Manually build the graph for rethrow. |
| 4101 // TODO(regis): This is not correct. Issue 22595. | |
| 4102 Value* exception = for_finally.Bind( | 4101 Value* exception = for_finally.Bind( |
| 4103 for_finally.BuildLoadLocal(catch_block->exception_var())); | 4102 for_finally.BuildLoadLocal(catch_block->rethrow_exception_var())); |
| 4104 for_finally.PushArgument(exception); | 4103 for_finally.PushArgument(exception); |
| 4105 Value* stacktrace = for_finally.Bind( | 4104 Value* stacktrace = for_finally.Bind( |
| 4106 for_finally.BuildLoadLocal(catch_block->stacktrace_var())); | 4105 for_finally.BuildLoadLocal(catch_block->rethrow_stacktrace_var())); |
| 4107 for_finally.PushArgument(stacktrace); | 4106 for_finally.PushArgument(stacktrace); |
| 4108 for_finally.AddInstruction( | 4107 for_finally.AddInstruction( |
| 4109 new(I) ReThrowInstr(catch_block->token_pos(), catch_handler_index)); | 4108 new(I) ReThrowInstr(catch_block->token_pos(), catch_handler_index)); |
| 4110 for_finally.CloseFragment(); | 4109 for_finally.CloseFragment(); |
| 4111 } | 4110 } |
| 4112 ASSERT(!for_finally.is_open()); | 4111 ASSERT(!for_finally.is_open()); |
| 4113 | 4112 |
| 4114 const Array& types = Array::ZoneHandle(I, Array::New(1, Heap::kOld)); | 4113 const Array& types = Array::ZoneHandle(I, Array::New(1, Heap::kOld)); |
| 4115 types.SetAt(0, Type::Handle(I, Type::DynamicType())); | 4114 types.SetAt(0, Type::Handle(I, Type::DynamicType())); |
| 4116 CatchBlockEntryInstr* finally_entry = | 4115 CatchBlockEntryInstr* finally_entry = |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4364 Report::MessageF(Report::kBailout, | 4363 Report::MessageF(Report::kBailout, |
| 4365 Script::Handle(function.script()), | 4364 Script::Handle(function.script()), |
| 4366 function.token_pos(), | 4365 function.token_pos(), |
| 4367 "FlowGraphBuilder Bailout: %s %s", | 4366 "FlowGraphBuilder Bailout: %s %s", |
| 4368 String::Handle(function.name()).ToCString(), | 4367 String::Handle(function.name()).ToCString(), |
| 4369 reason); | 4368 reason); |
| 4370 UNREACHABLE(); | 4369 UNREACHABLE(); |
| 4371 } | 4370 } |
| 4372 | 4371 |
| 4373 } // namespace dart | 4372 } // namespace dart |
| OLD | NEW |