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

Unified Diff: runtime/vm/thread.h

Issue 1292353004: Safepointing in GC (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Scavenger again. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/thread.h
diff --git a/runtime/vm/thread.h b/runtime/vm/thread.h
index 69cc4ecd17b2f70a429bd02bd899675a274b5496..8a57c2b18c49b5ebcd49f2e93b650989236e1fbf 100644
--- a/runtime/vm/thread.h
+++ b/runtime/vm/thread.h
@@ -38,6 +38,9 @@ class Zone;
CACHED_VM_OBJECTS_LIST(V) \
CACHED_ADDRESSES_LIST(V)
+// TODO(koda): Merge thread.h and thread_registry.h.
+typedef int64_t SafepointId;
+static const SafepointId kNoSafepointId = -1;
// A VM thread; may be executing Dart code or performing helper tasks like
// garbage collection or compilation. The Thread structure associated with
@@ -63,7 +66,13 @@ class Thread {
// "helper" to gain limited concurrent access to the isolate. One example is
// SweeperTask (which uses the class table, which is copy-on-write).
// TODO(koda): Properly synchronize heap access to expand allowed operations.
- static void EnterIsolateAsHelper(Isolate* isolate);
+ //
+ // If 'pass_safepoint' is set to the current rendezvous (returned by
+ // ThreadRegistry::SafepointThreads), the thread will be allowed free passage
+ // into the isolate while this rendezvous is in progress.
+ static void EnterIsolateAsHelper(
+ Isolate* isolate,
+ SafepointId pass_safepoint = kNoSafepointId);
static void ExitIsolateAsHelper();
// Called when the current thread transitions from mutator to collector.
@@ -233,6 +242,7 @@ CACHED_CONSTANTS_LIST(DEFINE_OFFSET_METHOD)
Heap* heap_;
State state_;
StoreBufferBlock* store_buffer_block_;
+ SafepointId pass_safepoint_;
#define DECLARE_MEMBERS(type_name, member_name, expr, default_init_value) \
type_name member_name;
CACHED_CONSTANTS_LIST(DECLARE_MEMBERS)
« runtime/vm/gc_sweeper.cc ('K') | « runtime/vm/scavenger.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698