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

Unified Diff: runtime/vm/gc_marker.cc

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/assembler_test.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/gc_marker.cc
diff --git a/runtime/vm/gc_marker.cc b/runtime/vm/gc_marker.cc
index 34811cba9eae787d740c8af390100ebf370f6358..234bf973476eb04b5b2b17c9dc278fa104761486 100644
--- a/runtime/vm/gc_marker.cc
+++ b/runtime/vm/gc_marker.cc
@@ -128,6 +128,7 @@ class MarkingVisitor : public ObjectPointerVisitor {
MarkingStack* marking_stack,
bool visit_function_code)
: ObjectPointerVisitor(isolate),
+ thread_(Thread::Current()),
heap_(heap),
vm_heap_(Dart::vm_isolate()->heap()),
class_table_(isolate->class_table()),
@@ -136,6 +137,7 @@ class MarkingVisitor : public ObjectPointerVisitor {
visiting_old_object_(NULL),
visit_function_code_(visit_function_code) {
ASSERT(heap_ != vm_heap_);
+ ASSERT(thread_->isolate() == isolate);
}
MarkingStack* marking_stack() const { return marking_stack_; }
@@ -226,7 +228,7 @@ class MarkingVisitor : public ObjectPointerVisitor {
!visiting_old_object_->IsRemembered()) {
ASSERT(p != NULL);
visiting_old_object_->SetRememberedBitUnsynchronized();
- isolate()->store_buffer()->AddObjectGC(visiting_old_object_);
+ thread_->StoreBufferAddObjectGC(visiting_old_object_);
}
return;
}
@@ -285,6 +287,7 @@ class MarkingVisitor : public ObjectPointerVisitor {
}
}
+ Thread* thread_;
Heap* heap_;
Heap* vm_heap_;
ClassTable* class_table_;
@@ -338,6 +341,7 @@ void GCMarker::Prologue(Isolate* isolate, bool invoke_api_callbacks) {
if (invoke_api_callbacks && (isolate->gc_prologue_callback() != NULL)) {
(isolate->gc_prologue_callback())();
}
+ Thread::PrepareForGC();
// The store buffers will be rebuilt as part of marking, reset them now.
isolate->store_buffer()->Reset();
}
« no previous file with comments | « runtime/vm/assembler_test.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698