| 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 3479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3490 pipeline->FinalizeCompilation(flow_graph); | 3490 pipeline->FinalizeCompilation(flow_graph); |
| 3491 } | 3491 } |
| 3492 { | 3492 { |
| 3493 #ifndef PRODUCT | 3493 #ifndef PRODUCT |
| 3494 TimelineDurationScope tds(thread(), compiler_timeline, | 3494 TimelineDurationScope tds(thread(), compiler_timeline, |
| 3495 "FinalizeCompilation"); | 3495 "FinalizeCompilation"); |
| 3496 #endif // !PRODUCT | 3496 #endif // !PRODUCT |
| 3497 ASSERT(thread()->IsMutatorThread()); | 3497 ASSERT(thread()->IsMutatorThread()); |
| 3498 FinalizeCompilation(&assembler, &graph_compiler, flow_graph); | 3498 FinalizeCompilation(&assembler, &graph_compiler, flow_graph); |
| 3499 } | 3499 } |
| 3500 // Mark that this isolate now has compiled code. | |
| 3501 isolate()->set_has_compiled_code(true); | |
| 3502 // Exit the loop and the function with the correct result value. | 3500 // Exit the loop and the function with the correct result value. |
| 3503 is_compiled = true; | 3501 is_compiled = true; |
| 3504 done = true; | 3502 done = true; |
| 3505 } else { | 3503 } else { |
| 3506 // We bailed out or we encountered an error. | 3504 // We bailed out or we encountered an error. |
| 3507 const Error& error = Error::Handle(thread()->sticky_error()); | 3505 const Error& error = Error::Handle(thread()->sticky_error()); |
| 3508 | 3506 |
| 3509 if (error.raw() == Object::branch_offset_error().raw()) { | 3507 if (error.raw() == Object::branch_offset_error().raw()) { |
| 3510 // Compilation failed due to an out of range branch offset in the | 3508 // Compilation failed due to an out of range branch offset in the |
| 3511 // assembler. We try again (done = false) with far branches enabled. | 3509 // assembler. We try again (done = false) with far branches enabled. |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3655 | 3653 |
| 3656 ASSERT(FLAG_precompiled_mode); | 3654 ASSERT(FLAG_precompiled_mode); |
| 3657 const bool optimized = function.IsOptimizable(); // False for natives. | 3655 const bool optimized = function.IsOptimizable(); // False for natives. |
| 3658 DartPrecompilationPipeline pipeline(zone, field_type_map); | 3656 DartPrecompilationPipeline pipeline(zone, field_type_map); |
| 3659 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); | 3657 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); |
| 3660 } | 3658 } |
| 3661 | 3659 |
| 3662 #endif // DART_PRECOMPILER | 3660 #endif // DART_PRECOMPILER |
| 3663 | 3661 |
| 3664 } // namespace dart | 3662 } // namespace dart |
| OLD | NEW |