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 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 code.set_deopt_info_array(deopt_info_array); | 751 code.set_deopt_info_array(deopt_info_array); |
752 | 752 |
753 graph_compiler.FinalizeStackmaps(code); | 753 graph_compiler.FinalizeStackmaps(code); |
754 graph_compiler.FinalizeVarDescriptors(code); | 754 graph_compiler.FinalizeVarDescriptors(code); |
755 graph_compiler.FinalizeExceptionHandlers(code); | 755 graph_compiler.FinalizeExceptionHandlers(code); |
756 graph_compiler.FinalizeStaticCallTargetsTable(code); | 756 graph_compiler.FinalizeStaticCallTargetsTable(code); |
757 | 757 |
758 if (optimized) { | 758 if (optimized) { |
759 // We may not have previous code if 'always_optimize' is set. | 759 // We may not have previous code if 'always_optimize' is set. |
760 if ((osr_id == Isolate::kNoDeoptId) && function.HasCode()) { | 760 if ((osr_id == Isolate::kNoDeoptId) && function.HasCode()) { |
761 CodePatcher::PatchEntry(Code::Handle(function.CurrentCode())); | 761 CodePatcher::PatchEntry( |
| 762 Code::Handle(function.CurrentCode()), |
| 763 Code::Handle(StubCode::FixCallersTarget_entry()->code())); |
762 if (FLAG_trace_compiler || FLAG_trace_patching) { | 764 if (FLAG_trace_compiler || FLAG_trace_patching) { |
763 if (FLAG_trace_compiler) { | 765 if (FLAG_trace_compiler) { |
764 THR_Print(" "); | 766 THR_Print(" "); |
765 } | 767 } |
766 THR_Print("Patch unoptimized '%s' entry point %#" Px "\n", | 768 THR_Print("Patch unoptimized '%s' entry point %#" Px "\n", |
767 function.ToFullyQualifiedCString(), | 769 function.ToFullyQualifiedCString(), |
768 Code::Handle(function.unoptimized_code()).EntryPoint()); | 770 Code::Handle(function.unoptimized_code()).EntryPoint()); |
769 } | 771 } |
770 } | 772 } |
771 function.AttachCode(code); | 773 function.AttachCode(code); |
(...skipping 11 matching lines...) Expand all Loading... |
783 const Field* field = (*flow_graph->guarded_fields())[i]; | 785 const Field* field = (*flow_graph->guarded_fields())[i]; |
784 field->RegisterDependentCode(code); | 786 field->RegisterDependentCode(code); |
785 } | 787 } |
786 } else { // not optimized. | 788 } else { // not optimized. |
787 if (!Compiler::always_optimize() && | 789 if (!Compiler::always_optimize() && |
788 (function.ic_data_array() == Array::null())) { | 790 (function.ic_data_array() == Array::null())) { |
789 function.SaveICDataMap(graph_compiler.deopt_id_to_ic_data()); | 791 function.SaveICDataMap(graph_compiler.deopt_id_to_ic_data()); |
790 } | 792 } |
791 function.set_unoptimized_code(code); | 793 function.set_unoptimized_code(code); |
792 function.AttachCode(code); | 794 function.AttachCode(code); |
793 ASSERT(CodePatcher::CodeIsPatchable(code)); | |
794 } | 795 } |
795 if (parsed_function->HasDeferredPrefixes()) { | 796 if (parsed_function->HasDeferredPrefixes()) { |
796 ASSERT(!FLAG_load_deferred_eagerly); | 797 ASSERT(!FLAG_load_deferred_eagerly); |
797 ZoneGrowableArray<const LibraryPrefix*>* prefixes = | 798 ZoneGrowableArray<const LibraryPrefix*>* prefixes = |
798 parsed_function->deferred_prefixes(); | 799 parsed_function->deferred_prefixes(); |
799 for (intptr_t i = 0; i < prefixes->length(); i++) { | 800 for (intptr_t i = 0; i < prefixes->length(); i++) { |
800 (*prefixes)[i]->RegisterDependentCode(code); | 801 (*prefixes)[i]->RegisterDependentCode(code); |
801 } | 802 } |
802 } | 803 } |
803 } | 804 } |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1419 const Object& result = | 1420 const Object& result = |
1420 PassiveObject::Handle(isolate->object_store()->sticky_error()); | 1421 PassiveObject::Handle(isolate->object_store()->sticky_error()); |
1421 isolate->object_store()->clear_sticky_error(); | 1422 isolate->object_store()->clear_sticky_error(); |
1422 return result.raw(); | 1423 return result.raw(); |
1423 } | 1424 } |
1424 UNREACHABLE(); | 1425 UNREACHABLE(); |
1425 return Object::null(); | 1426 return Object::null(); |
1426 } | 1427 } |
1427 | 1428 |
1428 } // namespace dart | 1429 } // namespace dart |
OLD | NEW |