OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/isolate.h" | 5 #include "vm/isolate.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "platform/json.h" | 9 #include "platform/json.h" |
10 #include "lib/mirrors.h" | 10 #include "lib/mirrors.h" |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 invoked_functions[i]->ToFullyQualifiedCString()); | 711 invoked_functions[i]->ToFullyQualifiedCString()); |
712 } | 712 } |
713 } | 713 } |
714 | 714 |
715 | 715 |
716 class FinalizeWeakPersistentHandlesVisitor : public HandleVisitor { | 716 class FinalizeWeakPersistentHandlesVisitor : public HandleVisitor { |
717 public: | 717 public: |
718 FinalizeWeakPersistentHandlesVisitor() : HandleVisitor(Isolate::Current()) { | 718 FinalizeWeakPersistentHandlesVisitor() : HandleVisitor(Isolate::Current()) { |
719 } | 719 } |
720 | 720 |
721 void VisitHandle(uword addr, bool is_prologue_weak) { | 721 void VisitHandle(uword addr) { |
722 FinalizablePersistentHandle* handle = | 722 FinalizablePersistentHandle* handle = |
723 reinterpret_cast<FinalizablePersistentHandle*>(addr); | 723 reinterpret_cast<FinalizablePersistentHandle*>(addr); |
724 handle->UpdateUnreachable(isolate(), is_prologue_weak); | 724 handle->UpdateUnreachable(isolate()); |
725 } | 725 } |
726 | 726 |
727 private: | 727 private: |
728 DISALLOW_COPY_AND_ASSIGN(FinalizeWeakPersistentHandlesVisitor); | 728 DISALLOW_COPY_AND_ASSIGN(FinalizeWeakPersistentHandlesVisitor); |
729 }; | 729 }; |
730 | 730 |
731 | 731 |
732 void Isolate::Shutdown() { | 732 void Isolate::Shutdown() { |
733 ASSERT(this == Isolate::Current()); | 733 ASSERT(this == Isolate::Current()); |
734 ASSERT(top_resource() == NULL); | 734 ASSERT(top_resource() == NULL); |
(...skipping 22 matching lines...) Expand all Loading... |
757 } | 757 } |
758 | 758 |
759 // Write out profiler data if requested. | 759 // Write out profiler data if requested. |
760 Profiler::WriteProfile(this); | 760 Profiler::WriteProfile(this); |
761 | 761 |
762 // Write out the coverage data if collection has been enabled. | 762 // Write out the coverage data if collection has been enabled. |
763 CodeCoverage::Write(this); | 763 CodeCoverage::Write(this); |
764 | 764 |
765 // Finalize any weak persistent handles with a non-null referent. | 765 // Finalize any weak persistent handles with a non-null referent. |
766 FinalizeWeakPersistentHandlesVisitor visitor; | 766 FinalizeWeakPersistentHandlesVisitor visitor; |
767 api_state()->weak_persistent_handles().VisitHandles(&visitor, false); | 767 api_state()->weak_persistent_handles().VisitHandles(&visitor); |
768 api_state()->prologue_weak_persistent_handles().VisitHandles( | 768 api_state()->prologue_weak_persistent_handles().VisitHandles(&visitor); |
769 &visitor, true); | |
770 | 769 |
771 CompilerStats::Print(); | 770 CompilerStats::Print(); |
772 if (FLAG_trace_isolates) { | 771 if (FLAG_trace_isolates) { |
773 heap()->PrintSizes(); | 772 heap()->PrintSizes(); |
774 megamorphic_cache_table()->PrintSizes(); | 773 megamorphic_cache_table()->PrintSizes(); |
775 Symbols::DumpStats(); | 774 Symbols::DumpStats(); |
776 OS::Print("[-] Stopping isolate:\n" | 775 OS::Print("[-] Stopping isolate:\n" |
777 "\tisolate: %s\n", name()); | 776 "\tisolate: %s\n", name()); |
778 } | 777 } |
779 } | 778 } |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 return func.raw(); | 1094 return func.raw(); |
1096 } | 1095 } |
1097 | 1096 |
1098 | 1097 |
1099 void IsolateSpawnState::Cleanup() { | 1098 void IsolateSpawnState::Cleanup() { |
1100 SwitchIsolateScope switch_scope(isolate()); | 1099 SwitchIsolateScope switch_scope(isolate()); |
1101 Dart::ShutdownIsolate(); | 1100 Dart::ShutdownIsolate(); |
1102 } | 1101 } |
1103 | 1102 |
1104 } // namespace dart | 1103 } // namespace dart |
OLD | NEW |