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 #ifndef V8_HEAP_SPACES_INL_H_ | 5 #ifndef V8_HEAP_SPACES_INL_H_ |
6 #define V8_HEAP_SPACES_INL_H_ | 6 #define V8_HEAP_SPACES_INL_H_ |
7 | 7 |
8 #include "src/heap/incremental-marking.h" | 8 #include "src/heap/incremental-marking.h" |
9 #include "src/heap/spaces.h" | 9 #include "src/heap/spaces.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 chunk = heap->lo_space()->FindPage(addr); | 375 chunk = heap->lo_space()->FindPage(addr); |
376 } | 376 } |
377 return chunk; | 377 return chunk; |
378 } | 378 } |
379 | 379 |
380 Page* Page::FromAnyPointerAddress(Heap* heap, Address addr) { | 380 Page* Page::FromAnyPointerAddress(Heap* heap, Address addr) { |
381 return static_cast<Page*>(MemoryChunk::FromAnyPointerAddress(heap, addr)); | 381 return static_cast<Page*>(MemoryChunk::FromAnyPointerAddress(heap, addr)); |
382 } | 382 } |
383 | 383 |
384 void Page::MarkNeverAllocateForTesting() { | 384 void Page::MarkNeverAllocateForTesting() { |
| 385 DCHECK(this->owner()->identity() != NEW_SPACE); |
385 DCHECK(!IsFlagSet(NEVER_ALLOCATE_ON_PAGE)); | 386 DCHECK(!IsFlagSet(NEVER_ALLOCATE_ON_PAGE)); |
386 SetFlag(NEVER_ALLOCATE_ON_PAGE); | 387 SetFlag(NEVER_ALLOCATE_ON_PAGE); |
387 reinterpret_cast<PagedSpace*>(owner())->free_list()->EvictFreeListItems(this); | 388 reinterpret_cast<PagedSpace*>(owner())->free_list()->EvictFreeListItems(this); |
388 } | 389 } |
389 | 390 |
390 void Page::MarkEvacuationCandidate() { | 391 void Page::MarkEvacuationCandidate() { |
391 DCHECK(!IsFlagSet(NEVER_EVACUATE)); | 392 DCHECK(!IsFlagSet(NEVER_EVACUATE)); |
392 DCHECK_NULL(old_to_old_slots_); | 393 DCHECK_NULL(old_to_old_slots_); |
393 DCHECK_NULL(typed_old_to_old_slots_); | 394 DCHECK_NULL(typed_old_to_old_slots_); |
394 SetFlag(EVACUATION_CANDIDATE); | 395 SetFlag(EVACUATION_CANDIDATE); |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 other->allocation_info_.Reset(nullptr, nullptr); | 715 other->allocation_info_.Reset(nullptr, nullptr); |
715 return true; | 716 return true; |
716 } | 717 } |
717 return false; | 718 return false; |
718 } | 719 } |
719 | 720 |
720 } // namespace internal | 721 } // namespace internal |
721 } // namespace v8 | 722 } // namespace v8 |
722 | 723 |
723 #endif // V8_HEAP_SPACES_INL_H_ | 724 #endif // V8_HEAP_SPACES_INL_H_ |
OLD | NEW |