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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 // The immediate dominator of the join is the last one in the ordered | 482 // The immediate dominator of the join is the last one in the ordered |
483 // intersection. | 483 // intersection. |
484 join_dominators.Last()->AddDominatedBlock(join); | 484 join_dominators.Last()->AddDominatedBlock(join); |
485 *exit_block = join; | 485 *exit_block = join; |
486 *last_instruction = join; | 486 *last_instruction = join; |
487 | 487 |
488 // If the call has uses, create a phi of the returns. | 488 // If the call has uses, create a phi of the returns. |
489 if (call_->HasUses()) { | 489 if (call_->HasUses()) { |
490 // Add a phi of the return values. | 490 // Add a phi of the return values. |
491 PhiInstr* phi = new(Z) PhiInstr(join, num_exits); | 491 PhiInstr* phi = new(Z) PhiInstr(join, num_exits); |
492 phi->set_ssa_temp_index(caller_graph_->alloc_ssa_temp_index()); | 492 caller_graph_->AllocateSSAIndexes(phi); |
493 phi->mark_alive(); | 493 phi->mark_alive(); |
494 for (intptr_t i = 0; i < num_exits; ++i) { | 494 for (intptr_t i = 0; i < num_exits; ++i) { |
495 ReturnAt(i)->RemoveEnvironment(); | 495 ReturnAt(i)->RemoveEnvironment(); |
496 phi->SetInputAt(i, ValueAt(i)); | 496 phi->SetInputAt(i, ValueAt(i)); |
497 } | 497 } |
498 join->InsertPhi(phi); | 498 join->InsertPhi(phi); |
499 join->InheritDeoptTargetAfter(caller_graph_, call_, phi); | 499 join->InheritDeoptTargetAfter(caller_graph_, call_, phi); |
500 return phi; | 500 return phi; |
501 } else { | 501 } else { |
502 // In the case that the result is unused, remove the return value uses | 502 // In the case that the result is unused, remove the return value uses |
(...skipping 4175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4678 Report::MessageF(Report::kBailout, | 4678 Report::MessageF(Report::kBailout, |
4679 Script::Handle(function.script()), | 4679 Script::Handle(function.script()), |
4680 function.token_pos(), | 4680 function.token_pos(), |
4681 "FlowGraphBuilder Bailout: %s %s", | 4681 "FlowGraphBuilder Bailout: %s %s", |
4682 String::Handle(function.name()).ToCString(), | 4682 String::Handle(function.name()).ToCString(), |
4683 reason); | 4683 reason); |
4684 UNREACHABLE(); | 4684 UNREACHABLE(); |
4685 } | 4685 } |
4686 | 4686 |
4687 } // namespace dart | 4687 } // namespace dart |
OLD | NEW |