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

Unified Diff: runtime/vm/thread.h

Issue 1168483003: Thread-local store buffers, v2 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review comments. Created 5 years, 6 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
« no previous file with comments | « runtime/vm/stub_code_x64.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.h
diff --git a/runtime/vm/thread.h b/runtime/vm/thread.h
index 457f1a4ed6c32c3996d1b18286ae85f82902dc67..3a8dacda14fe84f0f24d16c59ae1dde5a3da9f3d 100644
--- a/runtime/vm/thread.h
+++ b/runtime/vm/thread.h
@@ -8,6 +8,7 @@
#include "vm/base_isolate.h"
#include "vm/globals.h"
#include "vm/os_thread.h"
+#include "vm/store_buffer.h"
namespace dart {
@@ -41,6 +42,11 @@ class Thread {
static void EnterIsolateAsHelper(Isolate* isolate);
static void ExitIsolateAsHelper();
+ // Called when the current thread transitions from mutator to collector.
+ // Empties the store buffer block into the isolate.
+ // TODO(koda): Always run GC in separate thread.
+ static void PrepareForGC();
+
#if defined(TARGET_OS_WINDOWS)
// Clears the state of the current thread and frees the allocation.
static void CleanUp();
@@ -65,13 +71,26 @@ class Thread {
CHA* cha() const;
void set_cha(CHA* value);
+ void StoreBufferAddObject(RawObject* obj);
+ void StoreBufferAddObjectGC(RawObject* obj);
+#if defined(TESTING)
+ bool StoreBufferContains(RawObject* obj) const {
+ return store_buffer_block_->Contains(obj);
+ }
+#endif
+ void StoreBufferBlockProcess(bool check_threshold);
+ static intptr_t store_buffer_block_offset() {
+ return OFFSET_OF(Thread, store_buffer_block_);
+ }
+
private:
static ThreadLocalKey thread_key_;
Isolate* isolate_;
+ StoreBufferBlock* store_buffer_block_;
Thread()
- : isolate_(NULL) {}
+ : isolate_(NULL), store_buffer_block_(NULL) {}
static void SetCurrent(Thread* current);
« no previous file with comments | « runtime/vm/stub_code_x64.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698