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

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

Issue 10458050: Move ReturnInstr to new scheme (x64 and ia32) and implement more code in new ia32 compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('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) 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_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/flow_graph_builder.h" 7 #include "vm/flow_graph_builder.h"
8 #include "vm/il_printer.h" 8 #include "vm/il_printer.h"
9 #include "vm/object_store.h" 9 #include "vm/object_store.h"
10 10
11 namespace dart { 11 namespace dart {
12 12
13 DECLARE_FLAG(bool, print_flow_graph); 13 DECLARE_FLAG(bool, print_flow_graph);
14 DECLARE_FLAG(bool, trace_optimization); 14 DECLARE_FLAG(bool, trace_optimization);
15 15
16 void FlowGraphOptimizer::ApplyICData() { 16 void FlowGraphOptimizer::ApplyICData() {
17 VisitBlocks(); 17 VisitBlocks();
18 if (FLAG_print_flow_graph) { 18 if (FLAG_print_flow_graph) {
19 OS::Print("After Optimizations:\n"); 19 OS::Print("After Optimizations:\n");
20 intptr_t length = block_order_.length(); 20 FlowGraphPrinter printer(Function::Handle(), block_order_);
21 GrowableArray<BlockEntryInstr*> reverse_postorder(length);
22 for (intptr_t i = length - 1; i >= 0; --i) {
23 reverse_postorder.Add(block_order_[i]);
24 }
25 FlowGraphPrinter printer(Function::Handle(), reverse_postorder);
26 printer.PrintBlocks(); 21 printer.PrintBlocks();
27 } 22 }
28 } 23 }
29 24
30 25
31 void FlowGraphOptimizer::VisitBlocks() { 26 void FlowGraphOptimizer::VisitBlocks() {
32 for (intptr_t i = 0; i < block_order_.length(); ++i) { 27 for (intptr_t i = 0; i < block_order_.length(); ++i) {
33 Instruction* instr = block_order_[i]->Accept(this); 28 Instruction* instr = block_order_[i]->Accept(this);
34 // Compile all successors until an exit, branch, or a block entry. 29 // Compile all successors until an exit, branch, or a block entry.
35 while ((instr != NULL) && !instr->IsBlockEntry()) { 30 while ((instr != NULL) && !instr->IsBlockEntry()) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 instr->computation()->Accept(this); 94 instr->computation()->Accept(this);
100 } 95 }
101 96
102 97
103 void FlowGraphOptimizer::VisitBind(BindInstr* instr) { 98 void FlowGraphOptimizer::VisitBind(BindInstr* instr) {
104 instr->computation()->Accept(this); 99 instr->computation()->Accept(this);
105 } 100 }
106 101
107 102
108 } // namespace dart 103 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698