Revision: 22208
Author: [email protected]
Date: Thu Jul 3 16:55:17 2014 UTC
Log: Use the HeapObjectIterator to scan-on-scavenge map pages.
Deserializing the partial snapshot may prematurely stop using a map page,
adding a free-space filler at the end. Scan-on-scavenge of map-space did
not expect anything but maps, and would interpret the uninitialized memory
as pointers. Using the heap iterator we can skip over free space and only
visit maps.
BUG=390732
LOG=y
[email protected]
Review URL: https://codereview.chromium.org/364063007
http://code.google.com/p/v8/source/detail?r=22208
Modified:
/branches/bleeding_edge/src/store-buffer.cc
/branches/bleeding_edge/src/store-buffer.h
=======================================
--- /branches/bleeding_edge/src/store-buffer.cc Wed Jul 2 13:00:36 2014 UTC
+++ /branches/bleeding_edge/src/store-buffer.cc Thu Jul 3 16:55:17 2014 UTC
@@ -415,49 +415,6 @@
Address page = Page::FromAllocationTop(addr)->area_start();
return page + ((addr - page) / Map::kSize * Map::kSize);
}
-
-
-void StoreBuffer::FindPointersToNewSpaceInMaps(
- Address start,
- Address end,
- ObjectSlotCallback slot_callback,
- bool clear_maps) {
- ASSERT(MapStartAlign(start) == start);
- ASSERT(MapEndAlign(end) == end);
-
- Address map_address = start;
- while (map_address < end) {
- ASSERT(!heap_->InNewSpace(Memory::Object_at(map_address)));
- ASSERT(Memory::Object_at(map_address)->IsMap());
-
- Address pointer_fields_start = map_address +
Map::kPointerFieldsBeginOffset;
- Address pointer_fields_end = map_address +
Map::kPointerFieldsEndOffset;
-
- FindPointersToNewSpaceInRegion(pointer_fields_start,
- pointer_fields_end,
- slot_callback,
- clear_maps);
- map_address += Map::kSize;
- }
-}
-
-
-void StoreBuffer::FindPointersToNewSpaceInMapsRegion(
- Address start,
- Address end,
- ObjectSlotCallback slot_callback,
- bool clear_maps) {
- Address map_aligned_start = MapStartAlign(start);
- Address map_aligned_end = MapEndAlign(end);
-
- ASSERT(map_aligned_start == start);
- ASSERT(map_aligned_start <= map_aligned_end && map_aligned_end <= end);
-
- FindPointersToNewSpaceInMaps(map_aligned_start,
- map_aligned_end,
- slot_callback,
- clear_maps);
-}
void StoreBuffer::IteratePointersInStoreBuffer(
@@ -549,8 +506,18 @@
Address start = page->area_start();
Address end = page->area_end();
if (owner == heap_->map_space()) {
- FindPointersToNewSpaceInMapsRegion(
- start, end, slot_callback, clear_maps);
+ ASSERT(page->WasSweptPrecisely());
+ HeapObjectIterator iterator(page, NULL);
+ for (HeapObject* heap_object = iterator.Next(); heap_object !=
NULL;
+ heap_object = iterator.Next()) {
+ // We skip free space objects.
+ if (!heap_object->IsFiller()) {
+ FindPointersToNewSpaceInRegion(
+ heap_object->address() + HeapObject::kHeaderSize,
+ heap_object->address() + heap_object->Size(),
slot_callback,
+ clear_maps);
+ }
+ }
} else {
FindPointersToNewSpaceInRegion(
start, end, slot_callback, clear_maps);
=======================================
--- /branches/bleeding_edge/src/store-buffer.h Mon Jun 30 13:25:46 2014 UTC
+++ /branches/bleeding_edge/src/store-buffer.h Thu Jul 3 16:55:17 2014 UTC
@@ -167,18 +167,6 @@
RegionCallback region_callback,
ObjectSlotCallback slot_callback);
- void FindPointersToNewSpaceInMaps(
- Address start,
- Address end,
- ObjectSlotCallback slot_callback,
- bool clear_maps);
-
- void FindPointersToNewSpaceInMapsRegion(
- Address start,
- Address end,
- ObjectSlotCallback slot_callback,
- bool clear_maps);
-
void IteratePointersInStoreBuffer(ObjectSlotCallback slot_callback,
bool clear_maps);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.