Reset allocation info when we are releasing the page that contains allocation top.
authorvegorov@chromium.org <vegorov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 16 Nov 2011 22:25:56 +0000 (22:25 +0000)
committervegorov@chromium.org <vegorov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 16 Nov 2011 22:25:56 +0000 (22:25 +0000)
R=erik.corry@gmail.com
BUG=103587

Review URL: http://codereview.chromium.org/8575006

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

src/spaces.cc

index 54347c451af3f907f2f237b5cbb182388df89beb..79a66fa2476408f9353a329ae60975aeb2723358 100644 (file)
@@ -768,6 +768,10 @@ void PagedSpace::ReleasePage(Page* page) {
     ASSERT_EQ(Page::kObjectAreaSize, static_cast<int>(size));
   }
 
+  if (Page::FromAllocationTop(allocation_info_.top) == page) {
+    allocation_info_.top = allocation_info_.limit = NULL;
+  }
+
   page->Unlink();
   if (page->IsFlagSet(MemoryChunk::CONTAINS_ONLY_DATA)) {
     heap()->isolate()->memory_allocator()->Free(page);
@@ -2118,7 +2122,7 @@ bool PagedSpace::AdvanceSweeper(intptr_t bytes_to_sweep) {
 void PagedSpace::EvictEvacuationCandidatesFromFreeLists() {
   if (allocation_info_.top >= allocation_info_.limit) return;
 
-  if (Page::FromAddress(allocation_info_.top)->IsEvacuationCandidate()) {
+  if (Page::FromAllocationTop(allocation_info_.top)->IsEvacuationCandidate()) {
     // Create filler object to keep page iterable if it was iterable.
     int remaining =
         static_cast<int>(allocation_info_.limit - allocation_info_.top);