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

Unified Diff: runtime/vm/scavenger.cc

Issue 1173043002: Reuse empty StoreBufferBlocks. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Reset 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
Index: runtime/vm/scavenger.cc
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index f92fe62e2efaa4b828dda6bb2192a581f5e87bf6..2ad8e1fed97c1af36767652143d218d8105835c9 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -526,14 +526,15 @@ void Scavenger::IterateStoreBuffers(Isolate* isolate,
MSAN_UNPOISON(pending, sizeof(*pending));
intptr_t count = pending->Count();
total_count += count;
- for (intptr_t i = 0; i < count; i++) {
- RawObject* raw_object = pending->At(i);
+ while (!pending->IsEmpty()) {
+ RawObject* raw_object = pending->Pop();
ASSERT(raw_object->IsRemembered());
raw_object->ClearRememberedBit();
visitor->VisitingOldObject(raw_object);
raw_object->VisitPointers(visitor);
}
- delete pending;
+ pending->Reset();
+ isolate->store_buffer()->PushBlock(pending);
pending = next;
}
heap_->RecordData(kStoreBufferEntries, total_count);

Powered by Google App Engine
This is Rietveld 408576698