Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: runtime/vm/isolate.cc

Issue 177093010: Use a tag bit for indicating prologue weak persistent handles, this avoids (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/handles_impl.h ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 invoked_functions[i]->ToFullyQualifiedCString()); 721 invoked_functions[i]->ToFullyQualifiedCString());
722 } 722 }
723 } 723 }
724 724
725 725
726 class FinalizeWeakPersistentHandlesVisitor : public HandleVisitor { 726 class FinalizeWeakPersistentHandlesVisitor : public HandleVisitor {
727 public: 727 public:
728 FinalizeWeakPersistentHandlesVisitor() { 728 FinalizeWeakPersistentHandlesVisitor() {
729 } 729 }
730 730
731 void VisitHandle(uword addr) { 731 void VisitHandle(uword addr, bool is_prologue_weak) {
732 FinalizablePersistentHandle* handle = 732 FinalizablePersistentHandle* handle =
733 reinterpret_cast<FinalizablePersistentHandle*>(addr); 733 reinterpret_cast<FinalizablePersistentHandle*>(addr);
734 FinalizablePersistentHandle::Finalize(handle); 734 FinalizablePersistentHandle::Finalize(handle, is_prologue_weak);
735 } 735 }
736 736
737 private: 737 private:
738 DISALLOW_COPY_AND_ASSIGN(FinalizeWeakPersistentHandlesVisitor); 738 DISALLOW_COPY_AND_ASSIGN(FinalizeWeakPersistentHandlesVisitor);
739 }; 739 };
740 740
741 741
742 void Isolate::Shutdown() { 742 void Isolate::Shutdown() {
743 ASSERT(this == Isolate::Current()); 743 ASSERT(this == Isolate::Current());
744 ASSERT(top_resource() == NULL); 744 ASSERT(top_resource() == NULL);
(...skipping 27 matching lines...) Expand all
772 } 772 }
773 773
774 // Write out profiler data if requested. 774 // Write out profiler data if requested.
775 Profiler::WriteProfile(this); 775 Profiler::WriteProfile(this);
776 776
777 // Write out the coverage data if collection has been enabled. 777 // Write out the coverage data if collection has been enabled.
778 CodeCoverage::Write(this); 778 CodeCoverage::Write(this);
779 779
780 // Finalize any weak persistent handles with a non-null referent. 780 // Finalize any weak persistent handles with a non-null referent.
781 FinalizeWeakPersistentHandlesVisitor visitor; 781 FinalizeWeakPersistentHandlesVisitor visitor;
782 api_state()->weak_persistent_handles().VisitHandles(&visitor); 782 api_state()->weak_persistent_handles().VisitHandles(&visitor, false);
783 api_state()->prologue_weak_persistent_handles().VisitHandles(&visitor); 783 api_state()->prologue_weak_persistent_handles().VisitHandles(
784 &visitor, true);
784 785
785 CompilerStats::Print(); 786 CompilerStats::Print();
786 if (FLAG_trace_isolates) { 787 if (FLAG_trace_isolates) {
787 heap()->PrintSizes(); 788 heap()->PrintSizes();
788 megamorphic_cache_table()->PrintSizes(); 789 megamorphic_cache_table()->PrintSizes();
789 Symbols::DumpStats(); 790 Symbols::DumpStats();
790 OS::Print("[-] Stopping isolate:\n" 791 OS::Print("[-] Stopping isolate:\n"
791 "\tisolate: %s\n", name()); 792 "\tisolate: %s\n", name());
792 } 793 }
793 } 794 }
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 return func.raw(); 1080 return func.raw();
1080 } 1081 }
1081 1082
1082 1083
1083 void IsolateSpawnState::Cleanup() { 1084 void IsolateSpawnState::Cleanup() {
1084 SwitchIsolateScope switch_scope(isolate()); 1085 SwitchIsolateScope switch_scope(isolate());
1085 Dart::ShutdownIsolate(); 1086 Dart::ShutdownIsolate();
1086 } 1087 }
1087 1088
1088 } // namespace dart 1089 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/handles_impl.h ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698