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

Unified Diff: src/store-buffer.cc

Issue 6713069: Do not SortUniq store buffer before a regular iteration. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 9 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 | « 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 598b96cea0b398225759e67f31c84baa17ade3ac..8172d2bae1e5a40e557514bf57fff4f2b6e73590 100644
--- a/src/store-buffer.cc
+++ b/src/store-buffer.cc
@@ -96,7 +96,6 @@ void StoreBuffer::TearDown() {
}
-
#if V8_TARGET_ARCH_X64
static int CompareAddresses(const void* void_a, const void* void_b) {
intptr_t a =
@@ -161,6 +160,16 @@ void StoreBuffer::SortUniq() {
}
+void StoreBuffer::PrepareForIteration() {
+ Compact();
+ if (store_buffer_mode() == kStoreBufferDisabled) {
+ old_top_ = old_start_;
+ return;
+ }
+ ZapHashTables();
+}
+
+
#ifdef DEBUG
void StoreBuffer::Clean() {
if (store_buffer_mode() == kStoreBufferDisabled) {
@@ -256,7 +265,10 @@ void StoreBuffer::GCEpilogue(GCType type, GCCallbackFlags flags) {
void StoreBuffer::IteratePointersToNewSpace(ObjectSlotCallback callback) {
if (store_buffer_mode() == kStoreBufferFunctional) {
- SortUniq();
+ // 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.
+ PrepareForIteration();
}
if (store_buffer_mode() != kStoreBufferFunctional) {
old_top_ = old_start_;
@@ -287,14 +299,10 @@ void StoreBuffer::IteratePointersToNewSpace(ObjectSlotCallback callback) {
Object* object = *cell;
// May be invalid if object is not in new space.
HeapObject* heap_object = reinterpret_cast<HeapObject*>(object);
- if (Heap::InNewSpace(object)) {
+ if (Heap::InFromSpace(object)) {
callback(reinterpret_cast<HeapObject**>(cell), heap_object);
}
ASSERT(old_top_ == saved_top + 1 || old_top_ == saved_top);
- ASSERT((old_top_ == saved_top + 1) ==
- (Heap::InNewSpace(*cell) &&
- !Heap::InNewSpace(reinterpret_cast<Address>(cell)) &&
- Memory::Address_at(heap_object->address()) != NULL));
}
}
}
« no previous file with comments | « src/store-buffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698