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

Unified Diff: runtime/vm/isolate.h

Issue 1541073002: Implement safepointing of threads (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address-code-review-comments Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/isolate.h
diff --git a/runtime/vm/isolate.h b/runtime/vm/isolate.h
index 513b68e799f29b2d7026d376bb1626f0bcf49dc8..bbde4c0a16c4a408425b6ef1a0a828b2eac54a2e 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() {
@@ -687,17 +692,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).
@@ -720,6 +718,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;

Powered by Google App Engine
This is Rietveld 408576698