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

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

Issue 58003003: Impelments IfThenElse instruction for ARM and MIPS. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/assembler_mips.h ('k') | runtime/vm/intermediate_language.h » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cha.h" 8 #include "vm/cha.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 7469 matching lines...) Expand 10 before | Expand all | Expand 10 after
7480 7480
7481 if ((block->next() == instr) && 7481 if ((block->next() == instr) &&
7482 (instr->next() == block->last_instruction())) { 7482 (instr->next() == block->last_instruction())) {
7483 before->previous()->LinkTo(instr); 7483 before->previous()->LinkTo(instr);
7484 instr->LinkTo(before); 7484 instr->LinkTo(before);
7485 } 7485 }
7486 } 7486 }
7487 7487
7488 7488
7489 void IfConverter::Simplify(FlowGraph* flow_graph) { 7489 void IfConverter::Simplify(FlowGraph* flow_graph) {
7490 if (!IfThenElseInstr::IsSupported()) {
7491 return;
7492 }
7493
7494 bool changed = false; 7490 bool changed = false;
7495 7491
7496 const GrowableArray<BlockEntryInstr*>& postorder = flow_graph->postorder(); 7492 const GrowableArray<BlockEntryInstr*>& postorder = flow_graph->postorder();
7497 for (BlockIterator it(postorder); !it.Done(); it.Advance()) { 7493 for (BlockIterator it(postorder); !it.Done(); it.Advance()) {
7498 BlockEntryInstr* block = it.Current(); 7494 BlockEntryInstr* block = it.Current();
7499 JoinEntryInstr* join = block->AsJoinEntry(); 7495 JoinEntryInstr* join = block->AsJoinEntry();
7500 7496
7501 // Detect diamond control flow pattern which materializes a value depending 7497 // Detect diamond control flow pattern which materializes a value depending
7502 // on the result of the comparison: 7498 // on the result of the comparison:
7503 // 7499 //
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
7851 } 7847 }
7852 7848
7853 // Insert materializations at environment uses. 7849 // Insert materializations at environment uses.
7854 for (intptr_t i = 0; i < exits.length(); i++) { 7850 for (intptr_t i = 0; i < exits.length(); i++) {
7855 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); 7851 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields);
7856 } 7852 }
7857 } 7853 }
7858 7854
7859 7855
7860 } // namespace dart 7856 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/assembler_mips.h ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698