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

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

Issue 2995543004: [vm, gc] Require a safepoint for heap iteration. (Closed)
Patch Set: . Created 3 years, 4 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
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 #ifndef RUNTIME_VM_ISOLATE_H_ 5 #ifndef RUNTIME_VM_ISOLATE_H_
6 #define RUNTIME_VM_ISOLATE_H_ 6 #define RUNTIME_VM_ISOLATE_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "vm/atomic.h" 10 #include "vm/atomic.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 static inline Isolate* Current() { 171 static inline Isolate* Current() {
172 Thread* thread = Thread::Current(); 172 Thread* thread = Thread::Current();
173 return thread == NULL ? NULL : thread->isolate(); 173 return thread == NULL ? NULL : thread->isolate();
174 } 174 }
175 175
176 // Register a newly introduced class. 176 // Register a newly introduced class.
177 void RegisterClass(const Class& cls); 177 void RegisterClass(const Class& cls);
178 void RegisterClassAt(intptr_t index, const Class& cls); 178 void RegisterClassAt(intptr_t index, const Class& cls);
179 void ValidateClassTable(); 179 void ValidateClassTable();
180 180
181 // Visit all object pointers.
182 void IterateObjectPointers(ObjectPointerVisitor* visitor,
183 bool validate_frames);
184 void IterateStackPointers(ObjectPointerVisitor* visitor,
185 bool validate_frames);
186
187 // Visits weak object pointers. 181 // Visits weak object pointers.
188 void VisitWeakPersistentHandles(HandleVisitor* visitor); 182 void VisitWeakPersistentHandles(HandleVisitor* visitor);
189 183
190 // Prepares all threads in an isolate for Garbage Collection. 184 // Prepares all threads in an isolate for Garbage Collection.
191 void PrepareForGC(); 185 void PrepareForGC();
192 186
193 StoreBuffer* store_buffer() { return store_buffer_; } 187 StoreBuffer* store_buffer() { return store_buffer_; }
194 188
195 ThreadRegistry* thread_registry() const { return thread_registry_; } 189 ThreadRegistry* thread_registry() const { return thread_registry_; }
196 SafepointHandler* safepoint_handler() const { return safepoint_handler_; } 190 SafepointHandler* safepoint_handler() const { return safepoint_handler_; }
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 static bool creation_enabled_; 916 static bool creation_enabled_;
923 917
924 #define REUSABLE_FRIEND_DECLARATION(name) \ 918 #define REUSABLE_FRIEND_DECLARATION(name) \
925 friend class Reusable##name##HandleScope; 919 friend class Reusable##name##HandleScope;
926 REUSABLE_HANDLE_LIST(REUSABLE_FRIEND_DECLARATION) 920 REUSABLE_HANDLE_LIST(REUSABLE_FRIEND_DECLARATION)
927 #undef REUSABLE_FRIEND_DECLARATION 921 #undef REUSABLE_FRIEND_DECLARATION
928 922
929 friend class Become; // VisitObjectPointers 923 friend class Become; // VisitObjectPointers
930 friend class GCMarker; // VisitObjectPointers 924 friend class GCMarker; // VisitObjectPointers
931 friend class SafepointHandler; 925 friend class SafepointHandler;
926 friend class ObjectGraph; // VisitObjectPointers
932 friend class Scavenger; // VisitObjectPointers 927 friend class Scavenger; // VisitObjectPointers
933 friend class ObjectGraph; // VisitObjectPointers 928 friend class HeapIterationScope; // VisitObjectPointers
934 friend class ServiceIsolate; 929 friend class ServiceIsolate;
935 friend class Thread; 930 friend class Thread;
936 friend class Timeline; 931 friend class Timeline;
937 friend class NoReloadScope; // reload_block 932 friend class NoReloadScope; // reload_block
938 933
939 DISALLOW_COPY_AND_ASSIGN(Isolate); 934 DISALLOW_COPY_AND_ASSIGN(Isolate);
940 }; 935 };
941 936
942 // When we need to execute code in an isolate, we use the 937 // When we need to execute code in an isolate, we use the
943 // StartIsolateScope. 938 // StartIsolateScope.
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 intptr_t* spawn_count_; 1055 intptr_t* spawn_count_;
1061 1056
1062 Dart_IsolateFlags isolate_flags_; 1057 Dart_IsolateFlags isolate_flags_;
1063 bool paused_; 1058 bool paused_;
1064 bool errors_are_fatal_; 1059 bool errors_are_fatal_;
1065 }; 1060 };
1066 1061
1067 } // namespace dart 1062 } // namespace dart
1068 1063
1069 #endif // RUNTIME_VM_ISOLATE_H_ 1064 #endif // RUNTIME_VM_ISOLATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698