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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 return page; | 263 return page; |
264 } | 264 } |
265 | 265 |
266 // -------------------------------------------------------------------------- | 266 // -------------------------------------------------------------------------- |
267 // PagedSpace | 267 // PagedSpace |
268 | 268 |
269 template <Page::InitializationMode mode> | 269 template <Page::InitializationMode mode> |
270 Page* Page::Initialize(Heap* heap, MemoryChunk* chunk, Executability executable, | 270 Page* Page::Initialize(Heap* heap, MemoryChunk* chunk, Executability executable, |
271 PagedSpace* owner) { | 271 PagedSpace* owner) { |
272 Page* page = reinterpret_cast<Page*>(chunk); | 272 Page* page = reinterpret_cast<Page*>(chunk); |
| 273 page->mutex_ = new base::Mutex(); |
273 DCHECK(page->area_size() <= kAllocatableMemory); | 274 DCHECK(page->area_size() <= kAllocatableMemory); |
274 DCHECK(chunk->owner() == owner); | 275 DCHECK(chunk->owner() == owner); |
275 | 276 |
276 owner->IncreaseCapacity(page->area_size()); | 277 owner->IncreaseCapacity(page->area_size()); |
277 heap->incremental_marking()->SetOldSpacePageFlags(chunk); | 278 heap->incremental_marking()->SetOldSpacePageFlags(chunk); |
278 | 279 |
279 // Make sure that categories are initialized before freeing the area. | 280 // Make sure that categories are initialized before freeing the area. |
280 page->InitializeFreeListCategories(); | 281 page->InitializeFreeListCategories(); |
281 // In the case we do not free the memory, we effectively account for the whole | 282 // In the case we do not free the memory, we effectively account for the whole |
282 // page as allocated memory that cannot be used for further allocations. | 283 // page as allocated memory that cannot be used for further allocations. |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 other->allocation_info_.Reset(nullptr, nullptr); | 714 other->allocation_info_.Reset(nullptr, nullptr); |
714 return true; | 715 return true; |
715 } | 716 } |
716 return false; | 717 return false; |
717 } | 718 } |
718 | 719 |
719 } // namespace internal | 720 } // namespace internal |
720 } // namespace v8 | 721 } // namespace v8 |
721 | 722 |
722 #endif // V8_HEAP_SPACES_INL_H_ | 723 #endif // V8_HEAP_SPACES_INL_H_ |
OLD | NEW |