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

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

Issue 1419553005: VM: Don't rely on always running constant propagation in the optimizer (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | no next file » | 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/compiler.h" 10 #include "vm/compiler.h"
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 new(Z) Value(true_const), 541 new(Z) Value(true_const),
542 new(Z) Value(true_const), 542 new(Z) Value(true_const),
543 false)); // No number check. 543 false)); // No number check.
544 branch->InheritDeoptTarget(zone(), call_); 544 branch->InheritDeoptTarget(zone(), call_);
545 *branch->true_successor_address() = callee_entry; 545 *branch->true_successor_address() = callee_entry;
546 *branch->false_successor_address() = false_block; 546 *branch->false_successor_address() = false_block;
547 547
548 call_->previous()->AppendInstruction(branch); 548 call_->previous()->AppendInstruction(branch);
549 call_block->set_last_instruction(branch); 549 call_block->set_last_instruction(branch);
550 550
551 // Replace uses of the return value with null to maintain valid
552 // SSA form - even though the rest of the caller is unreachable.
553 call_->ReplaceUsesWith(caller_graph_->constant_null());
554
551 // Update dominator tree. 555 // Update dominator tree.
552 call_block->AddDominatedBlock(callee_entry); 556 call_block->AddDominatedBlock(callee_entry);
553 call_block->AddDominatedBlock(false_block); 557 call_block->AddDominatedBlock(false_block);
554 558
555 } else { 559 } else {
556 Definition* callee_result = JoinReturns(&callee_exit, 560 Definition* callee_result = JoinReturns(&callee_exit,
557 &callee_last_instruction, 561 &callee_last_instruction,
558 call_block->try_index()); 562 call_block->try_index());
559 if (callee_result != NULL) { 563 if (callee_result != NULL) {
560 call_->ReplaceUsesWith(callee_result); 564 call_->ReplaceUsesWith(callee_result);
(...skipping 4108 matching lines...) Expand 10 before | Expand all | Expand 10 after
4669 Report::MessageF(Report::kBailout, 4673 Report::MessageF(Report::kBailout,
4670 Script::Handle(function.script()), 4674 Script::Handle(function.script()),
4671 function.token_pos(), 4675 function.token_pos(),
4672 "FlowGraphBuilder Bailout: %s %s", 4676 "FlowGraphBuilder Bailout: %s %s",
4673 String::Handle(function.name()).ToCString(), 4677 String::Handle(function.name()).ToCString(),
4674 reason); 4678 reason);
4675 UNREACHABLE(); 4679 UNREACHABLE();
4676 } 4680 }
4677 4681
4678 } // namespace dart 4682 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698