Chromium Code Reviews| Index: runtime/vm/scavenger.cc |
| diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc |
| index 0c1a5a209b642fd9d9f607b1cd96b19bd2947d39..487ca5efd63c70a37f6cd7f6ff54f99a159a3b33 100644 |
| --- a/runtime/vm/scavenger.cc |
| +++ b/runtime/vm/scavenger.cc |
| @@ -391,6 +391,13 @@ 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. |
| + StoreBufferBlock* block = isolate->store_buffer_block(); |
| + isolate->store_buffer()->ProcessBlock(block); |
|
siva
2013/04/19 18:27:41
Why is it not ok to just call
block->ProcessBuffer
Vyacheslav Egorov (Google)
2013/04/19 19:40:20
ProcessBuffer would use normal AddPointer and thus
|
| + heap_->RecordData(kStoreBufferBlockEntries, block->Count()); |
| + block->Reset(); |
|
siva
2013/04/19 18:27:41
This reset would not be needed if you did a
block-
Vyacheslav Egorov (Google)
2013/04/19 19:40:20
Done.
|
| + |
| // Iterating through the store buffers. |
| // Grab the deduplication sets out of the store buffer. |
| StoreBuffer::DedupSet* pending = isolate->store_buffer()->DedupSets(); |
| @@ -417,16 +424,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); |
| } |