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

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

Issue 10830109: Add type propagation phase in optimizing compiler (work in progress). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | « no previous file | runtime/vm/flow_graph_builder.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/compiler.h" 5 #include "vm/compiler.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/ast_printer.h" 8 #include "vm/ast_printer.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // because it is a 'natural' order for the human reader of the 166 // because it is a 'natural' order for the human reader of the
167 // generated code. 167 // generated code.
168 intptr_t length = graph_builder.postorder_block_entries().length(); 168 intptr_t length = graph_builder.postorder_block_entries().length();
169 for (intptr_t i = length - 1; i >= 0; --i) { 169 for (intptr_t i = length - 1; i >= 0; --i) {
170 block_order.Add(graph_builder.postorder_block_entries()[i]); 170 block_order.Add(graph_builder.postorder_block_entries()[i]);
171 } 171 }
172 if (optimized) { 172 if (optimized) {
173 FlowGraphOptimizer optimizer(block_order); 173 FlowGraphOptimizer optimizer(block_order);
174 optimizer.ApplyICData(); 174 optimizer.ApplyICData();
175 175
176 // Propagate types and eliminate more type tests.
177 FlowGraphTypePropagator propagator(parsed_function, block_order);
178 propagator.PropagateTypes();
179
176 if (use_ssa) { 180 if (use_ssa) {
177 // Perform register allocation on the SSA graph. 181 // Perform register allocation on the SSA graph.
178 FlowGraphAllocator allocator(block_order, &graph_builder); 182 FlowGraphAllocator allocator(block_order, &graph_builder);
179 allocator.AllocateRegisters(); 183 allocator.AllocateRegisters();
180 } 184 }
181 if (FLAG_print_flow_graph) { 185 if (FLAG_print_flow_graph) {
182 OS::Print("After Optimizations:\n"); 186 OS::Print("After Optimizations:\n");
183 FlowGraphPrinter printer(Function::Handle(), block_order); 187 FlowGraphPrinter printer(Function::Handle(), block_order);
184 printer.PrintBlocks(); 188 printer.PrintBlocks();
185 } 189 }
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 isolate->object_store()->clear_sticky_error(); 493 isolate->object_store()->clear_sticky_error();
490 isolate->set_long_jump_base(base); 494 isolate->set_long_jump_base(base);
491 return result.raw(); 495 return result.raw();
492 } 496 }
493 UNREACHABLE(); 497 UNREACHABLE();
494 return Object::null(); 498 return Object::null();
495 } 499 }
496 500
497 501
498 } // namespace dart 502 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698