Index: src/spaces.cc |
=================================================================== |
--- src/spaces.cc (revision 5368) |
+++ src/spaces.cc (working copy) |
@@ -68,6 +68,12 @@ |
} |
+HeapObjectIterator::HeapObjectIterator(Page* page, |
+ HeapObjectCallback size_func) { |
+ Initialize(page->ObjectAreaStart(), page->AllocationTop(), size_func); |
+} |
+ |
+ |
void HeapObjectIterator::Initialize(Address cur, Address end, |
HeapObjectCallback size_f) { |
cur_addr_ = cur; |
@@ -2721,6 +2727,22 @@ |
return Failure::Exception(); |
} |
+ |
+LargeObjectChunk* LargeObjectSpace::FindChunkContainingPc(Address pc) { |
+ // TODO(853): Change this implementation to only find executable |
+ // chunks and use some kind of hash-based approach to speed it up. |
+ for (LargeObjectChunk* chunk = first_chunk_; |
+ chunk != NULL; |
+ chunk = chunk->next()) { |
+ Address chunk_address = chunk->address(); |
+ if (chunk_address <= pc && pc < chunk_address + chunk->size()) { |
+ return chunk; |
+ } |
+ } |
+ return NULL; |
+} |
+ |
+ |
void LargeObjectSpace::IterateDirtyRegions(ObjectSlotCallback copy_object) { |
LargeObjectIterator it(this); |
for (HeapObject* object = it.next(); object != NULL; object = it.next()) { |