Chromium Code Reviews| Index: runtime/vm/store_buffer.cc |
| diff --git a/runtime/vm/store_buffer.cc b/runtime/vm/store_buffer.cc |
| index ebfd64a6705e0c30331cbcb304b006e733a785d5..c1c80c631e8af72536c5609b8e7e08f48f7cedb0 100644 |
| --- a/runtime/vm/store_buffer.cc |
| +++ b/runtime/vm/store_buffer.cc |
| @@ -61,15 +61,24 @@ void StoreBuffer::Reset() { |
| } |
| -void StoreBuffer::AddPointer(uword address) { |
| +bool StoreBuffer::AddPointerInternal(uword address) { |
| ASSERT(dedup_sets_ != NULL); |
| ASSERT(Isolate::Current()->heap()->OldContains(address)); |
| ASSERT((address & kSmiTagMask) != kSmiTag); |
| if (!dedup_sets_->set()->Add(address)) { |
| - // Add a new DedupSet. Schedule an interrupt if we have run over the max |
| - // number of DedupSets. |
| + // Add a new DedupSet. |
| dedup_sets_ = new DedupSet(dedup_sets_); |
| count_++; |
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| + |
| +void StoreBuffer::AddPointer(uword address) { |
| + if (AddPointerInternal(address)) { |
| + // Had to create a new DedupSet. Schedule an interrupt if we have run over |
| + // the max number of DedupSets. |
| // TODO(iposva): Fix magic number. |
| if (count_ > 100) { |
| Isolate::Current()->ScheduleInterrupts(Isolate::kStoreBufferInterrupt); |
| @@ -77,4 +86,12 @@ void StoreBuffer::AddPointer(uword address) { |
| } |
| } |
| + |
| +void StoreBuffer::ProcessBlock(StoreBufferBlock* block) { |
| + intptr_t entries = block->Count(); |
| + for (intptr_t i = 0; i < entries; i++) { |
| + AddPointerInternal(block->At(i)); |
| + } |
| +} |
|
siva
2013/04/19 18:27:41
This function may not be needed if ProcessBuffer w
Vyacheslav Egorov (Google)
2013/04/19 19:40:20
Done.
|
| + |
| } // namespace dart |