Revision: 8401
Author: [email protected]
Date: Thu Jun 23 07:52:03 2011
Log: Revert 3899 because it tanked V8 benchmark suite. We need an
approach that resizes the store buffer according to the heap
size.
Review URL: http://codereview.chromium.org/7248006
http://code.google.com/p/v8/source/detail?r=8401
Modified:
/branches/experimental/gc/src/store-buffer.cc
/branches/experimental/gc/src/store-buffer.h
=======================================
--- /branches/experimental/gc/src/store-buffer.cc Thu Jun 23 07:09:36 2011
+++ /branches/experimental/gc/src/store-buffer.cc Thu Jun 23 07:52:03 2011
@@ -395,7 +395,7 @@
void StoreBuffer::Verify() {
#ifdef DEBUG
VerifyPointers(heap_->old_pointer_space(),
- &StoreBuffer::FindPointersToNewSpaceInRegionDontRecord);
+ &StoreBuffer::FindPointersToNewSpaceInRegion);
VerifyPointers(heap_->map_space(),
&StoreBuffer::FindPointersToNewSpaceInMapsRegion);
VerifyPointers(heap_->lo_space());
@@ -410,7 +410,6 @@
}
-template<StoreBuffer::RecordNewSpacePointers record>
void StoreBuffer::FindPointersToNewSpaceInRegion(
Address start, Address end, ObjectSlotCallback slot_callback) {
for (Address slot_address = start;
@@ -421,34 +420,12 @@
HeapObject* object = reinterpret_cast<HeapObject*>(*slot);
ASSERT(object->IsHeapObject());
slot_callback(reinterpret_cast<HeapObject**>(slot), object);
- if (record == kRecord) {
- if (heap_->InNewSpace(*slot)) {
- EnterDirectlyIntoStoreBuffer(slot_address);
- }
+ if (heap_->InNewSpace(*slot)) {
+ EnterDirectlyIntoStoreBuffer(slot_address);
}
}
}
}
-
-
-void StoreBuffer::FindPointersToNewSpaceInRegionRecord(
- StoreBuffer* store_buffer,
- Address start,
- Address end,
- ObjectSlotCallback slot_callback) {
- store_buffer->FindPointersToNewSpaceInRegion<kRecord>(
- start, end, slot_callback);
-}
-
-
-void StoreBuffer::FindPointersToNewSpaceInRegionDontRecord(
- StoreBuffer* store_buffer,
- Address start,
- Address end,
- ObjectSlotCallback slot_callback) {
- store_buffer->FindPointersToNewSpaceInRegion<kDontRecord>(
- start, end, slot_callback);
-}
// Compute start address of the first map following given addr.
@@ -480,16 +457,15 @@
Address pointer_fields_start = map_address +
Map::kPointerFieldsBeginOffset;
Address pointer_fields_end = map_address +
Map::kPointerFieldsEndOffset;
- FindPointersToNewSpaceInRegion<kRecord>(pointer_fields_start,
- pointer_fields_end,
- slot_callback);
+ FindPointersToNewSpaceInRegion(pointer_fields_start,
+ pointer_fields_end,
+ slot_callback);
map_address += Map::kSize;
}
}
void StoreBuffer::FindPointersToNewSpaceInMapsRegion(
- StoreBuffer* store_buffer,
Address start,
Address end,
ObjectSlotCallback slot_callback) {
@@ -499,9 +475,9 @@
ASSERT(map_aligned_start == start);
ASSERT(map_aligned_end == end);
- store_buffer->FindPointersToNewSpaceInMaps(map_aligned_start,
- map_aligned_end,
- slot_callback);
+ FindPointersToNewSpaceInMaps(map_aligned_start,
+ map_aligned_end,
+ slot_callback);
}
@@ -541,10 +517,9 @@
visitable_end == space->top()) {
if (visitable_start != visitable_end) {
// After calling this the special garbage section may have moved.
- (*region_callback)(this,
- visitable_start,
- visitable_end,
- slot_callback);
+ (this->*region_callback)(visitable_start,
+ visitable_end,
+ slot_callback);
if (visitable_end >= space->top() && visitable_end <
space->limit()) {
visitable_end = space->limit();
visitable_start = visitable_end;
@@ -573,10 +548,9 @@
}
ASSERT(visitable_end == end_of_page);
if (visitable_start != visitable_end) {
- (*region_callback)(this,
- visitable_start,
- visitable_end,
- slot_callback);
+ (this->*region_callback)(visitable_start,
+ visitable_end,
+ slot_callback);
}
}
@@ -644,20 +618,7 @@
ASSERT(array->IsFixedArray());
Address start = array->address();
Address end = start + array->Size();
- const int kLump = 10000;
- for (Address current = start; current < end; current += kLump) {
- if (chunk->scan_on_scavenge()) {
- FindPointersToNewSpaceInRegion<kDontRecord>(
- current,
- Min(end, current + kLump),
- slot_callback);
- } else {
- FindPointersToNewSpaceInRegion<kRecord>(
- current,
- Min(end, current + kLump),
- slot_callback);
- }
- }
+ FindPointersToNewSpaceInRegion(start, end, slot_callback);
} else {
Page* page = reinterpret_cast<Page*>(chunk);
PagedSpace* owner = reinterpret_cast<PagedSpace*>(page->owner());
@@ -666,7 +627,7 @@
page,
(owner == heap_->map_space() ?
&StoreBuffer::FindPointersToNewSpaceInMapsRegion :
- &StoreBuffer::FindPointersToNewSpaceInRegionRecord),
+ &StoreBuffer::FindPointersToNewSpaceInRegion),
slot_callback);
}
}
=======================================
--- /branches/experimental/gc/src/store-buffer.h Thu Jun 23 07:09:36 2011
+++ /branches/experimental/gc/src/store-buffer.h Thu Jun 23 07:52:03 2011
@@ -41,11 +41,8 @@
typedef void (*ObjectSlotCallback)(HeapObject** from, HeapObject* to);
-typedef void RegionCallback(
- StoreBuffer* store_buffer,
- Address start,
- Address end,
- ObjectSlotCallback slot_callback);
+typedef void (StoreBuffer::*RegionCallback)(
+ Address start, Address end, ObjectSlotCallback slot_callback);
// Used to implement the write barrier by collecting addresses of pointers
// between spaces.
@@ -84,7 +81,7 @@
// surviving old-to-new pointers into the store buffer to rebuild it.
void IteratePointersToNewSpace(ObjectSlotCallback callback);
- static const int kStoreBufferOverflowBit = 1 << 12;
+ static const int kStoreBufferOverflowBit = 1 << 16;
static const int kStoreBufferSize = kStoreBufferOverflowBit;
static const int kStoreBufferLength = kStoreBufferSize / sizeof(Address);
static const int kOldStoreBufferLength = kStoreBufferLength * 64;
@@ -157,30 +154,9 @@
bool HashTablesAreZapped();
void ExemptPopularPages(int prime_sample_step, int threshold);
- enum RecordNewSpacePointers {
- kDontRecord,
- kRecord
- };
-
- template<RecordNewSpacePointers record>
- inline void FindPointersToNewSpaceInRegion(Address start,
- Address end,
- ObjectSlotCallback
slot_callback);
-
- // It seems gcc doesn't want to take the address of a templated method,
- // so we create a new method so that we can give the address. Also,
- // pointers to methods tend to have gnarly implementations.
- static void FindPointersToNewSpaceInRegionRecord(
- StoreBuffer* store_buffer,
- Address start,
- Address end,
- ObjectSlotCallback slot_callback);
-
- static void FindPointersToNewSpaceInRegionDontRecord(
- StoreBuffer* store_buffer,
- Address start,
- Address end,
- ObjectSlotCallback slot_callback);
+ void FindPointersToNewSpaceInRegion(Address start,
+ Address end,
+ ObjectSlotCallback slot_callback);
// For each region of pointers on a page in use from an old space call
// visit_pointer_region callback.
@@ -198,8 +174,7 @@
Address end,
ObjectSlotCallback slot_callback);
- static void FindPointersToNewSpaceInMapsRegion(
- StoreBuffer* store_buffer,
+ void FindPointersToNewSpaceInMapsRegion(
Address start,
Address end,
ObjectSlotCallback slot_callback);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev