| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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/precompiler.h" | 5 #include "vm/precompiler.h" |
| 6 | 6 |
| 7 #include "vm/aot_optimizer.h" | 7 #include "vm/aot_optimizer.h" |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
| 10 #include "vm/branch_optimizer.h" | 10 #include "vm/branch_optimizer.h" |
| (...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 THR_Print("Setting guarded_cid of %s to %s\n", field.ToCString(), | 1239 THR_Print("Setting guarded_cid of %s to %s\n", field.ToCString(), |
| 1240 pipeline.result_type().ToCString()); | 1240 pipeline.result_type().ToCString()); |
| 1241 } | 1241 } |
| 1242 #endif // !PRODUCT | 1242 #endif // !PRODUCT |
| 1243 field.set_guarded_cid(result_cid); | 1243 field.set_guarded_cid(result_cid); |
| 1244 } | 1244 } |
| 1245 } | 1245 } |
| 1246 | 1246 |
| 1247 if ((FLAG_disassemble || FLAG_disassemble_optimized) && | 1247 if ((FLAG_disassemble || FLAG_disassemble_optimized) && |
| 1248 FlowGraphPrinter::ShouldPrint(parsed_function->function())) { | 1248 FlowGraphPrinter::ShouldPrint(parsed_function->function())) { |
| 1249 Disassembler::DisassembleCode(parsed_function->function(), | 1249 Code& code = Code::Handle(parsed_function->function().CurrentCode()); |
| 1250 Disassembler::DisassembleCode(parsed_function->function(), code, |
| 1250 /* optimized = */ true); | 1251 /* optimized = */ true); |
| 1251 } | 1252 } |
| 1252 return parsed_function->function().raw(); | 1253 return parsed_function->function().raw(); |
| 1253 } | 1254 } |
| 1254 | 1255 |
| 1255 | 1256 |
| 1256 RawObject* Precompiler::EvaluateStaticInitializer(const Field& field) { | 1257 RawObject* Precompiler::EvaluateStaticInitializer(const Field& field) { |
| 1257 ASSERT(field.is_static()); | 1258 ASSERT(field.is_static()); |
| 1258 // The VM sets the field's value to transiton_sentinel prior to | 1259 // The VM sets the field's value to transiton_sentinel prior to |
| 1259 // evaluating the initializer value. | 1260 // evaluating the initializer value. |
| (...skipping 2265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3525 | 3526 |
| 3526 if (trace_compiler) { | 3527 if (trace_compiler) { |
| 3527 THR_Print("--> '%s' entry: %#" Px " size: %" Pd " time: %" Pd64 " us\n", | 3528 THR_Print("--> '%s' entry: %#" Px " size: %" Pd " time: %" Pd64 " us\n", |
| 3528 function.ToFullyQualifiedCString(), | 3529 function.ToFullyQualifiedCString(), |
| 3529 Code::Handle(function.CurrentCode()).PayloadStart(), | 3530 Code::Handle(function.CurrentCode()).PayloadStart(), |
| 3530 Code::Handle(function.CurrentCode()).Size(), | 3531 Code::Handle(function.CurrentCode()).Size(), |
| 3531 per_compile_timer.TotalElapsedTime()); | 3532 per_compile_timer.TotalElapsedTime()); |
| 3532 } | 3533 } |
| 3533 | 3534 |
| 3534 if (FLAG_disassemble && FlowGraphPrinter::ShouldPrint(function)) { | 3535 if (FLAG_disassemble && FlowGraphPrinter::ShouldPrint(function)) { |
| 3535 Disassembler::DisassembleCode(function, optimized); | 3536 Code& code = Code::Handle(function.CurrentCode()); |
| 3537 Disassembler::DisassembleCode(function, code, optimized); |
| 3536 } else if (FLAG_disassemble_optimized && optimized && | 3538 } else if (FLAG_disassemble_optimized && optimized && |
| 3537 FlowGraphPrinter::ShouldPrint(function)) { | 3539 FlowGraphPrinter::ShouldPrint(function)) { |
| 3538 Disassembler::DisassembleCode(function, true); | 3540 Code& code = Code::Handle(function.CurrentCode()); |
| 3541 Disassembler::DisassembleCode(function, code, true); |
| 3539 } | 3542 } |
| 3540 return Error::null(); | 3543 return Error::null(); |
| 3541 } else { | 3544 } else { |
| 3542 Thread* const thread = Thread::Current(); | 3545 Thread* const thread = Thread::Current(); |
| 3543 StackZone stack_zone(thread); | 3546 StackZone stack_zone(thread); |
| 3544 Error& error = Error::Handle(); | 3547 Error& error = Error::Handle(); |
| 3545 // We got an error during compilation. | 3548 // We got an error during compilation. |
| 3546 error = thread->sticky_error(); | 3549 error = thread->sticky_error(); |
| 3547 thread->clear_sticky_error(); | 3550 thread->clear_sticky_error(); |
| 3548 // Precompilation may encounter compile-time errors. | 3551 // Precompilation may encounter compile-time errors. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 3565 | 3568 |
| 3566 ASSERT(FLAG_precompiled_mode); | 3569 ASSERT(FLAG_precompiled_mode); |
| 3567 const bool optimized = function.IsOptimizable(); // False for natives. | 3570 const bool optimized = function.IsOptimizable(); // False for natives. |
| 3568 DartPrecompilationPipeline pipeline(zone, field_type_map); | 3571 DartPrecompilationPipeline pipeline(zone, field_type_map); |
| 3569 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); | 3572 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); |
| 3570 } | 3573 } |
| 3571 | 3574 |
| 3572 #endif // DART_PRECOMPILER | 3575 #endif // DART_PRECOMPILER |
| 3573 | 3576 |
| 3574 } // namespace dart | 3577 } // namespace dart |
| OLD | NEW |