Return false from PagedSpace::Contains if the page from an address is not valid.
authorager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 19 Oct 2010 09:16:57 +0000 (09:16 +0000)
committerager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 19 Oct 2010 09:16:57 +0000 (09:16 +0000)
This can happen on Mac where C++ code can be in the 4-8K range.
Review URL: http://codereview.chromium.org/3781020

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5656 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/spaces-inl.h
src/spaces.h

index 26214a3..8a0dd07 100644 (file)
@@ -407,8 +407,7 @@ void MemoryAllocator::UnprotectChunkFromPage(Page* page) {
 
 bool PagedSpace::Contains(Address addr) {
   Page* p = Page::FromAddress(addr);
-  ASSERT(p->is_valid());
-
+  if (!p->is_valid()) return false;
   return MemoryAllocator::IsPageInSpace(p, this);
 }
 
index 2fdb96f..0e6a91e 100644 (file)
@@ -2194,7 +2194,6 @@ class LargeObjectSpace : public Space {
   // if such a page doesn't exist.
   LargeObjectChunk* FindChunkContainingPc(Address pc);
 
-
   // Iterates objects covered by dirty regions.
   void IterateDirtyRegions(ObjectSlotCallback func);