| 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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 TimerScope timer(FLAG_compiler_stats, | 712 TimerScope timer(FLAG_compiler_stats, |
| 713 &CompilerStats::graphcompiler_timer, | 713 &CompilerStats::graphcompiler_timer, |
| 714 isolate); | 714 isolate); |
| 715 graph_compiler.CompileGraph(); | 715 graph_compiler.CompileGraph(); |
| 716 pipeline->FinalizeCompilation(); | 716 pipeline->FinalizeCompilation(); |
| 717 } | 717 } |
| 718 { | 718 { |
| 719 TimerScope timer(FLAG_compiler_stats, | 719 TimerScope timer(FLAG_compiler_stats, |
| 720 &CompilerStats::codefinalizer_timer, | 720 &CompilerStats::codefinalizer_timer, |
| 721 isolate); | 721 isolate); |
| 722 // CreateDeoptInfo uses the object pool and needs to be done before |
| 723 // FinalizeCode. |
| 724 const Array& deopt_info_array = Array::Handle( |
| 725 graph_compiler.CreateDeoptInfo(&assembler)); |
| 722 const Code& code = Code::Handle( | 726 const Code& code = Code::Handle( |
| 723 Code::FinalizeCode(function, &assembler, optimized)); | 727 Code::FinalizeCode(function, &assembler, optimized)); |
| 724 code.set_is_optimized(optimized); | 728 code.set_is_optimized(optimized); |
| 725 code.set_inlined_intervals(graph_compiler.inlined_code_intervals()); | 729 code.set_inlined_intervals(graph_compiler.inlined_code_intervals()); |
| 726 code.set_inlined_id_to_function( | 730 code.set_inlined_id_to_function( |
| 727 Array::Handle(graph_compiler.InliningIdToFunction())); | 731 Array::Handle(graph_compiler.InliningIdToFunction())); |
| 728 graph_compiler.FinalizePcDescriptors(code); | 732 graph_compiler.FinalizePcDescriptors(code); |
| 729 graph_compiler.FinalizeDeoptInfo(code); | 733 code.set_deopt_info_array(deopt_info_array); |
| 730 graph_compiler.FinalizeStackmaps(code); | 734 graph_compiler.FinalizeStackmaps(code); |
| 731 graph_compiler.FinalizeVarDescriptors(code); | 735 graph_compiler.FinalizeVarDescriptors(code); |
| 732 graph_compiler.FinalizeExceptionHandlers(code); | 736 graph_compiler.FinalizeExceptionHandlers(code); |
| 733 graph_compiler.FinalizeStaticCallTargetsTable(code); | 737 graph_compiler.FinalizeStaticCallTargetsTable(code); |
| 734 | 738 |
| 735 if (optimized) { | 739 if (optimized) { |
| 736 if (osr_id == Isolate::kNoDeoptId) { | 740 if (osr_id == Isolate::kNoDeoptId) { |
| 737 CodePatcher::PatchEntry(Code::Handle(function.CurrentCode())); | 741 CodePatcher::PatchEntry(Code::Handle(function.CurrentCode())); |
| 738 if (FLAG_trace_compiler || FLAG_trace_patching) { | 742 if (FLAG_trace_compiler || FLAG_trace_patching) { |
| 739 if (FLAG_trace_compiler) { | 743 if (FLAG_trace_compiler) { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 ISL_Print("%4" Pd ": 0x%" Px " %s (%s)\n", | 859 ISL_Print("%4" Pd ": 0x%" Px " %s (%s)\n", |
| 856 i, | 860 i, |
| 857 start + offset.Value(), | 861 start + offset.Value(), |
| 858 DeoptInfo::ToCString(deopt_table, info), | 862 DeoptInfo::ToCString(deopt_table, info), |
| 859 DeoptReasonToCString( | 863 DeoptReasonToCString( |
| 860 static_cast<ICData::DeoptReasonId>(reason))); | 864 static_cast<ICData::DeoptReasonId>(reason))); |
| 861 } | 865 } |
| 862 ISL_Print("}\n"); | 866 ISL_Print("}\n"); |
| 863 } | 867 } |
| 864 | 868 |
| 865 const Array& object_table = Array::Handle(code.object_table()); | 869 const Array& object_pool = Array::Handle(code.ObjectPool()); |
| 866 if (object_table.Length() > 0) { | |
| 867 ISL_Print("Object Table: {\n"); | |
| 868 for (intptr_t i = 0; i < object_table.Length(); i++) { | |
| 869 ISL_Print(" %" Pd ": %s\n", i, | |
| 870 Object::Handle(object_table.At(i)).ToCString()); | |
| 871 } | |
| 872 ISL_Print("}\n"); | |
| 873 } | |
| 874 | |
| 875 const Array& object_pool = Array::Handle( | |
| 876 Instructions::Handle(code.instructions()).object_pool()); | |
| 877 if (object_pool.Length() > 0) { | 870 if (object_pool.Length() > 0) { |
| 878 ISL_Print("Object Pool: {\n"); | 871 ISL_Print("Object Pool: {\n"); |
| 879 for (intptr_t i = 0; i < object_pool.Length(); i++) { | 872 for (intptr_t i = 0; i < object_pool.Length(); i++) { |
| 880 ISL_Print(" %" Pd ": %s\n", i, | 873 ISL_Print(" %" Pd ": %s\n", i, |
| 881 Object::Handle(object_pool.At(i)).ToCString()); | 874 Object::Handle(object_pool.At(i)).ToCString()); |
| 882 } | 875 } |
| 883 ISL_Print("}\n"); | 876 ISL_Print("}\n"); |
| 884 } | 877 } |
| 885 | 878 |
| 886 ISL_Print("Stackmaps for function '%s' {\n", function_fullname); | 879 ISL_Print("Stackmaps for function '%s' {\n", function_fullname); |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1275 const Object& result = | 1268 const Object& result = |
| 1276 PassiveObject::Handle(isolate->object_store()->sticky_error()); | 1269 PassiveObject::Handle(isolate->object_store()->sticky_error()); |
| 1277 isolate->object_store()->clear_sticky_error(); | 1270 isolate->object_store()->clear_sticky_error(); |
| 1278 return result.raw(); | 1271 return result.raw(); |
| 1279 } | 1272 } |
| 1280 UNREACHABLE(); | 1273 UNREACHABLE(); |
| 1281 return Object::null(); | 1274 return Object::null(); |
| 1282 } | 1275 } |
| 1283 | 1276 |
| 1284 } // namespace dart | 1277 } // namespace dart |
| OLD | NEW |