| OLD | NEW | 
|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "src/heap/spaces.h" | 5 #include "src/heap/spaces.h" | 
| 6 | 6 | 
| 7 #include <utility> | 7 #include <utility> | 
| 8 | 8 | 
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" | 
| 10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" | 
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 49          owner == page->heap()->code_space()); | 49          owner == page->heap()->code_space()); | 
| 50 #endif  // DEBUG | 50 #endif  // DEBUG | 
| 51 } | 51 } | 
| 52 | 52 | 
| 53 // We have hit the end of the page and should advance to the next block of | 53 // We have hit the end of the page and should advance to the next block of | 
| 54 // objects.  This happens at the end of the page. | 54 // objects.  This happens at the end of the page. | 
| 55 bool HeapObjectIterator::AdvanceToNextPage() { | 55 bool HeapObjectIterator::AdvanceToNextPage() { | 
| 56   DCHECK_EQ(cur_addr_, cur_end_); | 56   DCHECK_EQ(cur_addr_, cur_end_); | 
| 57   if (current_page_ == page_range_.end()) return false; | 57   if (current_page_ == page_range_.end()) return false; | 
| 58   Page* cur_page = *(current_page_++); | 58   Page* cur_page = *(current_page_++); | 
| 59   space_->heap() | 59   Heap* heap = space_->heap(); | 
| 60       ->mark_compact_collector() | 60 | 
| 61       ->sweeper() | 61   heap->mark_compact_collector()->sweeper().SweepOrWaitUntilSweepingCompleted( | 
| 62       .SweepOrWaitUntilSweepingCompleted(cur_page); | 62       cur_page); | 
|  | 63   if (cur_page->IsFlagSet(Page::SWEEP_TO_ITERATE)) | 
|  | 64     heap->minor_mark_compact_collector()->MakeIterable( | 
|  | 65         cur_page, MarkingTreatmentMode::CLEAR, | 
|  | 66         FreeSpaceTreatmentMode::IGNORE_FREE_SPACE); | 
| 63   cur_addr_ = cur_page->area_start(); | 67   cur_addr_ = cur_page->area_start(); | 
| 64   cur_end_ = cur_page->area_end(); | 68   cur_end_ = cur_page->area_end(); | 
| 65   DCHECK(cur_page->SweepingDone()); | 69   DCHECK(cur_page->SweepingDone()); | 
| 66   return true; | 70   return true; | 
| 67 } | 71 } | 
| 68 | 72 | 
| 69 PauseAllocationObserversScope::PauseAllocationObserversScope(Heap* heap) | 73 PauseAllocationObserversScope::PauseAllocationObserversScope(Heap* heap) | 
| 70     : heap_(heap) { | 74     : heap_(heap) { | 
| 71   AllSpaces spaces(heap_); | 75   AllSpaces spaces(heap_); | 
| 72   for (Space* space = spaces.next(); space != NULL; space = spaces.next()) { | 76   for (Space* space = spaces.next(); space != NULL; space = spaces.next()) { | 
| (...skipping 3310 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3383     PrintF("\n"); | 3387     PrintF("\n"); | 
| 3384   } | 3388   } | 
| 3385   printf(" --------------------------------------\n"); | 3389   printf(" --------------------------------------\n"); | 
| 3386   printf(" Marked: %x, LiveCount: %" V8PRIdPTR "\n", mark_size, | 3390   printf(" Marked: %x, LiveCount: %" V8PRIdPTR "\n", mark_size, | 
| 3387          MarkingState::Internal(this).live_bytes()); | 3391          MarkingState::Internal(this).live_bytes()); | 
| 3388 } | 3392 } | 
| 3389 | 3393 | 
| 3390 #endif  // DEBUG | 3394 #endif  // DEBUG | 
| 3391 }  // namespace internal | 3395 }  // namespace internal | 
| 3392 }  // namespace v8 | 3396 }  // namespace v8 | 
| OLD | NEW | 
|---|