| 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/spaces.h" | 8 #include "src/heap/spaces.h" |
| 9 #include "src/heap-profiler.h" | 9 #include "src/heap-profiler.h" |
| 10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } | 135 } |
| 136 | 136 |
| 137 #endif | 137 #endif |
| 138 | 138 |
| 139 | 139 |
| 140 // -------------------------------------------------------------------------- | 140 // -------------------------------------------------------------------------- |
| 141 // PagedSpace | 141 // PagedSpace |
| 142 Page* Page::Initialize(Heap* heap, MemoryChunk* chunk, Executability executable, | 142 Page* Page::Initialize(Heap* heap, MemoryChunk* chunk, Executability executable, |
| 143 PagedSpace* owner) { | 143 PagedSpace* owner) { |
| 144 Page* page = reinterpret_cast<Page*>(chunk); | 144 Page* page = reinterpret_cast<Page*>(chunk); |
| 145 page->mutex_ = new base::Mutex(); |
| 145 DCHECK(page->area_size() <= kMaxRegularHeapObjectSize); | 146 DCHECK(page->area_size() <= kMaxRegularHeapObjectSize); |
| 146 DCHECK(chunk->owner() == owner); | 147 DCHECK(chunk->owner() == owner); |
| 147 owner->IncreaseCapacity(page->area_size()); | 148 owner->IncreaseCapacity(page->area_size()); |
| 148 owner->Free(page->area_start(), page->area_size()); | 149 owner->Free(page->area_start(), page->area_size()); |
| 149 | 150 |
| 150 heap->incremental_marking()->SetOldSpacePageFlags(chunk); | 151 heap->incremental_marking()->SetOldSpacePageFlags(chunk); |
| 151 | 152 |
| 152 return page; | 153 return page; |
| 153 } | 154 } |
| 154 | 155 |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 | 405 |
| 405 | 406 |
| 406 intptr_t LargeObjectSpace::Available() { | 407 intptr_t LargeObjectSpace::Available() { |
| 407 return ObjectSizeFor(heap()->isolate()->memory_allocator()->Available()); | 408 return ObjectSizeFor(heap()->isolate()->memory_allocator()->Available()); |
| 408 } | 409 } |
| 409 | 410 |
| 410 } | 411 } |
| 411 } // namespace v8::internal | 412 } // namespace v8::internal |
| 412 | 413 |
| 413 #endif // V8_HEAP_SPACES_INL_H_ | 414 #endif // V8_HEAP_SPACES_INL_H_ |
| OLD | NEW |