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

Unified Diff: runtime/vm/store_buffer.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: do not reset block inside ProcessBlock 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
« runtime/vm/scavenger.cc ('K') | « runtime/vm/store_buffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« runtime/vm/scavenger.cc ('K') | « runtime/vm/store_buffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698