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/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 4303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4314 ASSERT(!catch_block->stacktrace_var().is_captured()); | 4314 ASSERT(!catch_block->stacktrace_var().is_captured()); |
4315 | 4315 |
4316 CatchBlockEntryInstr* catch_entry = | 4316 CatchBlockEntryInstr* catch_entry = |
4317 new(Z) CatchBlockEntryInstr(owner()->AllocateBlockId(), | 4317 new(Z) CatchBlockEntryInstr(owner()->AllocateBlockId(), |
4318 catch_handler_index, | 4318 catch_handler_index, |
4319 owner()->graph_entry(), | 4319 owner()->graph_entry(), |
4320 catch_block->handler_types(), | 4320 catch_block->handler_types(), |
4321 try_handler_index, | 4321 try_handler_index, |
4322 catch_block->exception_var(), | 4322 catch_block->exception_var(), |
4323 catch_block->stacktrace_var(), | 4323 catch_block->stacktrace_var(), |
4324 catch_block->needs_stacktrace()); | 4324 catch_block->needs_stacktrace(), |
| 4325 Thread::Current()->GetNextDeoptId()); |
4325 owner()->AddCatchEntry(catch_entry); | 4326 owner()->AddCatchEntry(catch_entry); |
4326 AppendFragment(catch_entry, for_catch); | 4327 AppendFragment(catch_entry, for_catch); |
4327 | 4328 |
4328 if (for_catch.is_open()) { | 4329 if (for_catch.is_open()) { |
4329 JoinEntryInstr* join = new(Z) JoinEntryInstr(owner()->AllocateBlockId(), | 4330 JoinEntryInstr* join = new(Z) JoinEntryInstr(owner()->AllocateBlockId(), |
4330 original_handler_index); | 4331 original_handler_index); |
4331 for_catch.Goto(join); | 4332 for_catch.Goto(join); |
4332 if (is_open()) Goto(join); | 4333 if (is_open()) Goto(join); |
4333 exit_ = join; | 4334 exit_ = join; |
4334 } | 4335 } |
(...skipping 25 matching lines...) Expand all Loading... |
4360 const Array& types = Array::ZoneHandle(Z, Array::New(1, Heap::kOld)); | 4361 const Array& types = Array::ZoneHandle(Z, Array::New(1, Heap::kOld)); |
4361 types.SetAt(0, Object::dynamic_type()); | 4362 types.SetAt(0, Object::dynamic_type()); |
4362 CatchBlockEntryInstr* finally_entry = | 4363 CatchBlockEntryInstr* finally_entry = |
4363 new(Z) CatchBlockEntryInstr(owner()->AllocateBlockId(), | 4364 new(Z) CatchBlockEntryInstr(owner()->AllocateBlockId(), |
4364 original_handler_index, | 4365 original_handler_index, |
4365 owner()->graph_entry(), | 4366 owner()->graph_entry(), |
4366 types, | 4367 types, |
4367 catch_handler_index, | 4368 catch_handler_index, |
4368 catch_block->exception_var(), | 4369 catch_block->exception_var(), |
4369 catch_block->stacktrace_var(), | 4370 catch_block->stacktrace_var(), |
4370 catch_block->needs_stacktrace()); | 4371 catch_block->needs_stacktrace(), |
| 4372 Thread::Current()->GetNextDeoptId()); |
4371 owner()->AddCatchEntry(finally_entry); | 4373 owner()->AddCatchEntry(finally_entry); |
4372 AppendFragment(finally_entry, for_finally); | 4374 AppendFragment(finally_entry, for_finally); |
4373 } | 4375 } |
4374 | 4376 |
4375 // Generate code for the finally block if one exists. | 4377 // Generate code for the finally block if one exists. |
4376 if ((finally_block != NULL) && is_open()) { | 4378 if ((finally_block != NULL) && is_open()) { |
4377 EffectGraphVisitor for_finally_block(owner()); | 4379 EffectGraphVisitor for_finally_block(owner()); |
4378 finally_block->Visit(&for_finally_block); | 4380 finally_block->Visit(&for_finally_block); |
4379 Append(for_finally_block); | 4381 Append(for_finally_block); |
4380 } | 4382 } |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4636 block_marks); | 4638 block_marks); |
4637 ASSERT(found); | 4639 ASSERT(found); |
4638 } | 4640 } |
4639 | 4641 |
4640 | 4642 |
4641 void FlowGraphBuilder::Bailout(const char* reason) const { | 4643 void FlowGraphBuilder::Bailout(const char* reason) const { |
4642 parsed_function_.Bailout("FlowGraphBuilder", reason); | 4644 parsed_function_.Bailout("FlowGraphBuilder", reason); |
4643 } | 4645 } |
4644 | 4646 |
4645 } // namespace dart | 4647 } // namespace dart |
OLD | NEW |