Index: runtime/vm/isolate.h |
diff --git a/runtime/vm/isolate.h b/runtime/vm/isolate.h |
index 95068b7c7b755c22b423bdc2d0f44fab5dea33a9..211d41364b0f868b3fd28ecabb18be333893cbfc 100644 |
--- a/runtime/vm/isolate.h |
+++ b/runtime/vm/isolate.h |
@@ -56,6 +56,7 @@ class RawError; |
class RawFloat32x4; |
class RawInt32x4; |
class RawUserTag; |
+class SafepointHandler; |
class SampleBuffer; |
class SendPort; |
class ServiceIdZone; |
@@ -126,9 +127,13 @@ class Isolate : public BaseIsolate { |
// Visits weak object pointers. |
void VisitWeakPersistentHandles(HandleVisitor* visitor); |
+ // Prepares all threads in an isolate for Garbage Collection. |
+ void PrepareForGC(); |
+ |
StoreBuffer* store_buffer() { return store_buffer_; } |
- ThreadRegistry* thread_registry() { return thread_registry_; } |
+ ThreadRegistry* thread_registry() const { return thread_registry_; } |
+ SafepointHandler* safepoint_handler() const { return safepoint_handler_; } |
ClassTable* class_table() { return &class_table_; } |
static intptr_t class_table_offset() { |
@@ -692,17 +697,10 @@ class Isolate : public BaseIsolate { |
void set_registered_service_extension_handlers( |
const GrowableObjectArray& value); |
- void ClearMutatorThread() { |
- mutator_thread_ = NULL; |
- } |
- void MakeCurrentThreadMutator(Thread* thread) { |
- ASSERT(thread == Thread::Current()); |
- DEBUG_ASSERT(IsIsolateOf(thread)); |
- mutator_thread_ = thread; |
- } |
-#if defined(DEBUG) |
- bool IsIsolateOf(Thread* thread); |
-#endif // DEBUG |
+ Monitor* threads_lock() const; |
+ Thread* ScheduleThread(bool is_mutator, bool bypass_safepoint = false); |
+ void UnscheduleThread( |
+ Thread* thread, bool is_mutator, bool bypass_sfepoint = false); |
// DEPRECATED: Use Thread's methods instead. During migration, these default |
// to using the mutator thread (which must also be the current thread). |
@@ -725,6 +723,7 @@ class Isolate : public BaseIsolate { |
bool single_step_; |
ThreadRegistry* thread_registry_; |
+ SafepointHandler* safepoint_handler_; |
Dart_MessageNotifyCallback message_notify_callback_; |
char* name_; |
char* debugger_name_; |
@@ -859,6 +858,7 @@ REUSABLE_HANDLE_LIST(REUSABLE_FRIEND_DECLARATION) |
#undef REUSABLE_FRIEND_DECLARATION |
friend class GCMarker; // VisitObjectPointers |
+ friend class SafepointHandler; |
friend class Scavenger; // VisitObjectPointers |
friend class ServiceIsolate; |
friend class Thread; |