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

Unified Diff: runtime/vm/scavenger.cc

Issue 14348026: Drain StoreBufferBlock into store buffer instead of iterating over it directly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: unify draining Created 7 years, 8 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 | « no previous file | runtime/vm/store_buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scavenger.cc
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index 0c1a5a209b642fd9d9f607b1cd96b19bd2947d39..586d72181e0b4212bf002b2c325372ba4b57d7ec 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -391,6 +391,15 @@ void Scavenger::Epilogue(Isolate* isolate, bool invoke_api_callbacks) {
void Scavenger::IterateStoreBuffers(Isolate* isolate,
ScavengerVisitor* visitor) {
+ // Drain store buffer block into store buffer to deduplicate it. It might be
+ // full of large objects repeated multiple times.
+ // Use DrainBlock directly instead of ProcessBlock because we are in the
+ // middle of a scavenge cycle and thus do not care if we are temporary
+ // running over the max number of deduplication sets.
+ StoreBufferBlock* block = isolate->store_buffer_block();
+ heap_->RecordData(kStoreBufferBlockEntries, block->Count());
+ isolate->store_buffer()->DrainBlock(block);
+
// Iterating through the store buffers.
// Grab the deduplication sets out of the store buffer.
StoreBuffer::DedupSet* pending = isolate->store_buffer()->DedupSets();
@@ -417,16 +426,6 @@ void Scavenger::IterateStoreBuffers(Isolate* isolate,
pending = next;
}
heap_->RecordData(kStoreBufferEntries, entries);
- StoreBufferBlock* block = isolate->store_buffer_block();
- entries = block->Count();
- for (intptr_t i = 0; i < entries; i++) {
- RawObject* raw_object = reinterpret_cast<RawObject*>(block->At(i));
- ASSERT(raw_object->IsHeapObject());
- visitor->VisitingOldObject(raw_object);
- raw_object->VisitPointers(visitor);
- }
- block->Reset();
- heap_->RecordData(kStoreBufferBlockEntries, entries);
// Done iterating through old objects remembered in the store buffers.
visitor->VisitingOldObject(NULL);
}
« no previous file with comments | « no previous file | runtime/vm/store_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698