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

Unified Diff: src/store-buffer.cc

Issue 7189066: Simple non-incremental compaction by evacuation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 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
« src/mark-compact-inl.h ('K') | « src/store-buffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/store-buffer.cc
diff --git a/src/store-buffer.cc b/src/store-buffer.cc
index 027c2f39eaaa954f700e9a715f512478275efe8f..18e972185d81c72ec48bf5821356e77683796471 100644
--- a/src/store-buffer.cc
+++ b/src/store-buffer.cc
@@ -555,13 +555,9 @@ void StoreBuffer::FindPointersToNewSpaceOnPage(
}
-
-void StoreBuffer::IteratePointersToNewSpace(ObjectSlotCallback slot_callback) {
- // We do not sort or remove duplicated entries from the store buffer because
- // we expect that callback will rebuild the store buffer thus removing
- // all duplicates and pointers to old space.
- bool some_pages_to_scan = PrepareForIteration();
-
+template<StoreBuffer::IterationMode mode>
+void StoreBuffer::IteratePointersInStoreBuffer(
+ ObjectSlotCallback slot_callback) {
Address* limit = old_top_;
old_top_ = old_start_;
{
@@ -571,6 +567,11 @@ void StoreBuffer::IteratePointersToNewSpace(ObjectSlotCallback slot_callback) {
Address* saved_top = old_top_;
#endif
Object** slot = reinterpret_cast<Object**>(*current);
+
+ // TODO(gc): we want to skip slots on evacuation candidates
+ // but we can't simply figure that out from slot address
+ // because slot can belong to a large object.
Erik Corry 2011/06/20 20:41:26 Pity. I was looking forward to seeing how you wou
+
Object* object = *slot;
if (heap_->InFromSpace(object)) {
HeapObject* heap_object = reinterpret_cast<HeapObject*>(object);
@@ -582,6 +583,26 @@ void StoreBuffer::IteratePointersToNewSpace(ObjectSlotCallback slot_callback) {
ASSERT(old_top_ == saved_top + 1 || old_top_ == saved_top);
}
}
+
Erik Corry 2011/06/20 20:41:26 Spurious blank line.
Vyacheslav Egorov (Chromium) 2011/06/21 11:44:48 Done.
+}
+
+
+void StoreBuffer::IteratePointersToNewSpace(ObjectSlotCallback slot_callback,
+ IterationMode mode) {
+ // We do not sort or remove duplicated entries from the store buffer because
+ // we expect that callback will rebuild the store buffer thus removing
+ // all duplicates and pointers to old space.
+ bool some_pages_to_scan = PrepareForIteration();
+
+ if (mode == SKIP_SLOTS_IN_EVACUATION_CANDIDATES) {
+ IteratePointersInStoreBuffer<SKIP_SLOTS_IN_EVACUATION_CANDIDATES>(
+ slot_callback);
+ } else {
+ ASSERT(mode == VISIT_ALL_SLOTS);
+ IteratePointersInStoreBuffer<VISIT_ALL_SLOTS>(slot_callback);
+ }
+
+
// We are done scanning all the pointers that were in the store buffer, but
// there may be some pages marked scan_on_scavenge that have pointers to new
// space that are not in the store buffer. We must scan them now. As we
« src/mark-compact-inl.h ('K') | « src/store-buffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698