| 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/block_scheduler.h" | 10 #include "vm/block_scheduler.h" |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 } | 420 } |
| 421 } | 421 } |
| 422 } | 422 } |
| 423 | 423 |
| 424 flow_graph = pipeline->BuildFlowGraph(parsed_function, | 424 flow_graph = pipeline->BuildFlowGraph(parsed_function, |
| 425 *ic_data_array, | 425 *ic_data_array, |
| 426 osr_id); | 426 osr_id); |
| 427 } | 427 } |
| 428 | 428 |
| 429 const bool print_flow_graph = | 429 const bool print_flow_graph = |
| 430 FLAG_print_flow_graph || | 430 (FLAG_print_flow_graph || |
| 431 (optimized && FLAG_print_flow_graph_optimized); | 431 (optimized && FLAG_print_flow_graph_optimized)) && |
| 432 FlowGraphPrinter::ShouldPrint(function); |
| 432 | 433 |
| 433 if (print_flow_graph) { | 434 if (print_flow_graph) { |
| 434 if (osr_id == Isolate::kNoDeoptId) { | 435 if (osr_id == Isolate::kNoDeoptId) { |
| 435 FlowGraphPrinter::PrintGraph("Before Optimizations", flow_graph); | 436 FlowGraphPrinter::PrintGraph("Before Optimizations", flow_graph); |
| 436 } else { | 437 } else { |
| 437 FlowGraphPrinter::PrintGraph("For OSR", flow_graph); | 438 FlowGraphPrinter::PrintGraph("For OSR", flow_graph); |
| 438 } | 439 } |
| 439 } | 440 } |
| 440 | 441 |
| 441 BlockScheduler block_scheduler(flow_graph); | 442 BlockScheduler block_scheduler(flow_graph); |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 if (FLAG_trace_compiler) { | 993 if (FLAG_trace_compiler) { |
| 993 OS::Print("--> '%s' entry: %#" Px " size: %" Pd " time: %" Pd64 " us\n", | 994 OS::Print("--> '%s' entry: %#" Px " size: %" Pd " time: %" Pd64 " us\n", |
| 994 function.ToFullyQualifiedCString(), | 995 function.ToFullyQualifiedCString(), |
| 995 Code::Handle(function.CurrentCode()).EntryPoint(), | 996 Code::Handle(function.CurrentCode()).EntryPoint(), |
| 996 Code::Handle(function.CurrentCode()).Size(), | 997 Code::Handle(function.CurrentCode()).Size(), |
| 997 per_compile_timer.TotalElapsedTime()); | 998 per_compile_timer.TotalElapsedTime()); |
| 998 } | 999 } |
| 999 | 1000 |
| 1000 isolate->debugger()->NotifyCompilation(function); | 1001 isolate->debugger()->NotifyCompilation(function); |
| 1001 | 1002 |
| 1002 if (FLAG_disassemble) { | 1003 if (FLAG_disassemble && FlowGraphPrinter::ShouldPrint(function)) { |
| 1003 DisassembleCode(function, optimized); | 1004 DisassembleCode(function, optimized); |
| 1004 } else if (FLAG_disassemble_optimized && optimized) { | 1005 } else if (FLAG_disassemble_optimized && |
| 1006 optimized && |
| 1007 FlowGraphPrinter::ShouldPrint(function)) { |
| 1005 // TODO(fschneider): Print unoptimized code along with the optimized code. | 1008 // TODO(fschneider): Print unoptimized code along with the optimized code. |
| 1006 OS::Print("*** BEGIN CODE\n"); | 1009 OS::Print("*** BEGIN CODE\n"); |
| 1007 DisassembleCode(function, true); | 1010 DisassembleCode(function, true); |
| 1008 OS::Print("*** END CODE\n"); | 1011 OS::Print("*** END CODE\n"); |
| 1009 } | 1012 } |
| 1010 | 1013 |
| 1011 return Error::null(); | 1014 return Error::null(); |
| 1012 } else { | 1015 } else { |
| 1013 Error& error = Error::Handle(); | 1016 Error& error = Error::Handle(); |
| 1014 // We got an error during compilation. | 1017 // We got an error during compilation. |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 const Object& result = | 1209 const Object& result = |
| 1207 PassiveObject::Handle(isolate->object_store()->sticky_error()); | 1210 PassiveObject::Handle(isolate->object_store()->sticky_error()); |
| 1208 isolate->object_store()->clear_sticky_error(); | 1211 isolate->object_store()->clear_sticky_error(); |
| 1209 return result.raw(); | 1212 return result.raw(); |
| 1210 } | 1213 } |
| 1211 UNREACHABLE(); | 1214 UNREACHABLE(); |
| 1212 return Object::null(); | 1215 return Object::null(); |
| 1213 } | 1216 } |
| 1214 | 1217 |
| 1215 } // namespace dart | 1218 } // namespace dart |
| OLD | NEW |