| OLD | NEW |
| 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 | 8 |
| 9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
| 10 #include "vm/code_generator.h" | 10 #include "vm/code_generator.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 allocator.AllocateRegisters(); | 237 allocator.AllocateRegisters(); |
| 238 | 238 |
| 239 if (FLAG_print_flow_graph) { | 239 if (FLAG_print_flow_graph) { |
| 240 OS::Print("After Optimizations:\n"); | 240 OS::Print("After Optimizations:\n"); |
| 241 FlowGraphPrinter printer(*flow_graph); | 241 FlowGraphPrinter printer(*flow_graph); |
| 242 printer.PrintBlocks(); | 242 printer.PrintBlocks(); |
| 243 } | 243 } |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 | 246 |
| 247 bool is_leaf = false; | |
| 248 if (optimized) { | |
| 249 FlowGraphAnalyzer analyzer(*flow_graph); | |
| 250 analyzer.Analyze(); | |
| 251 is_leaf = analyzer.is_leaf(); | |
| 252 } | |
| 253 Assembler assembler; | 247 Assembler assembler; |
| 254 FlowGraphCompiler graph_compiler(&assembler, | 248 FlowGraphCompiler graph_compiler(&assembler, |
| 255 *flow_graph, | 249 *flow_graph, |
| 256 optimized, | 250 optimized); |
| 257 is_leaf); | |
| 258 { | 251 { |
| 259 TimerScope timer(FLAG_compiler_stats, | 252 TimerScope timer(FLAG_compiler_stats, |
| 260 &CompilerStats::graphcompiler_timer, | 253 &CompilerStats::graphcompiler_timer, |
| 261 isolate); | 254 isolate); |
| 262 graph_compiler.CompileGraph(); | 255 graph_compiler.CompileGraph(); |
| 263 } | 256 } |
| 264 { | 257 { |
| 265 TimerScope timer(FLAG_compiler_stats, | 258 TimerScope timer(FLAG_compiler_stats, |
| 266 &CompilerStats::codefinalizer_timer, | 259 &CompilerStats::codefinalizer_timer, |
| 267 isolate); | 260 isolate); |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 result = isolate->object_store()->sticky_error(); | 589 result = isolate->object_store()->sticky_error(); |
| 597 isolate->object_store()->clear_sticky_error(); | 590 isolate->object_store()->clear_sticky_error(); |
| 598 isolate->set_long_jump_base(base); | 591 isolate->set_long_jump_base(base); |
| 599 return result.raw(); | 592 return result.raw(); |
| 600 } | 593 } |
| 601 UNREACHABLE(); | 594 UNREACHABLE(); |
| 602 return Object::null(); | 595 return Object::null(); |
| 603 } | 596 } |
| 604 | 597 |
| 605 } // namespace dart | 598 } // namespace dart |
| OLD | NEW |