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

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

Issue 1377113004: VM: Support phis with pair representations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: rebased Created 5 years, 2 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
« no previous file with comments | « runtime/vm/flow_graph_allocator.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 4191 matching lines...) Expand 10 before | Expand all | Expand 10 after
4694 Report::MessageF(Report::kBailout, 4694 Report::MessageF(Report::kBailout,
4695 Script::Handle(function.script()), 4695 Script::Handle(function.script()),
4696 function.token_pos(), 4696 function.token_pos(),
4697 "FlowGraphBuilder Bailout: %s %s", 4697 "FlowGraphBuilder Bailout: %s %s",
4698 String::Handle(function.name()).ToCString(), 4698 String::Handle(function.name()).ToCString(),
4699 reason); 4699 reason);
4700 UNREACHABLE(); 4700 UNREACHABLE();
4701 } 4701 }
4702 4702
4703 } // namespace dart 4703 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_allocator.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698