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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 category->Relink(); | 281 category->Relink(); |
282 }); | 282 }); |
283 DCHECK_EQ(page->AvailableInFreeList(), page->available_in_free_list()); | 283 DCHECK_EQ(page->AvailableInFreeList(), page->available_in_free_list()); |
284 return added; | 284 return added; |
285 } | 285 } |
286 | 286 |
287 MemoryChunk* MemoryChunk::FromAnyPointerAddress(Heap* heap, Address addr) { | 287 MemoryChunk* MemoryChunk::FromAnyPointerAddress(Heap* heap, Address addr) { |
288 MemoryChunk* chunk = MemoryChunk::FromAddress(addr); | 288 MemoryChunk* chunk = MemoryChunk::FromAddress(addr); |
289 uintptr_t offset = addr - chunk->address(); | 289 uintptr_t offset = addr - chunk->address(); |
290 if (offset < MemoryChunk::kHeaderSize || !chunk->HasPageHeader()) { | 290 if (offset < MemoryChunk::kHeaderSize || !chunk->HasPageHeader()) { |
291 chunk = heap->lo_space()->FindPage(addr); | 291 chunk = heap->lo_space()->FindPageThreadSafe(addr); |
292 } | 292 } |
293 return chunk; | 293 return chunk; |
294 } | 294 } |
295 | 295 |
296 Page* Page::FromAnyPointerAddress(Heap* heap, Address addr) { | 296 Page* Page::FromAnyPointerAddress(Heap* heap, Address addr) { |
297 return static_cast<Page*>(MemoryChunk::FromAnyPointerAddress(heap, addr)); | 297 return static_cast<Page*>(MemoryChunk::FromAnyPointerAddress(heap, addr)); |
298 } | 298 } |
299 | 299 |
300 void Page::MarkNeverAllocateForTesting() { | 300 void Page::MarkNeverAllocateForTesting() { |
301 DCHECK(this->owner()->identity() != NEW_SPACE); | 301 DCHECK(this->owner()->identity() != NEW_SPACE); |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 other->allocation_info_.Reset(nullptr, nullptr); | 628 other->allocation_info_.Reset(nullptr, nullptr); |
629 return true; | 629 return true; |
630 } | 630 } |
631 return false; | 631 return false; |
632 } | 632 } |
633 | 633 |
634 } // namespace internal | 634 } // namespace internal |
635 } // namespace v8 | 635 } // namespace v8 |
636 | 636 |
637 #endif // V8_HEAP_SPACES_INL_H_ | 637 #endif // V8_HEAP_SPACES_INL_H_ |
OLD | NEW |