Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Side by Side Diff: src/heap/spaces-inl.h

Issue 1853783002: [heap] Non-contiguous young generation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Hannes comment Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/spaces.cc ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 bool NewSpace::FromSpaceContains(Object* o) { return from_space_.Contains(o); } 244 bool NewSpace::FromSpaceContains(Object* o) { return from_space_.Contains(o); }
245 245
246 // -------------------------------------------------------------------------- 246 // --------------------------------------------------------------------------
247 // AllocationResult 247 // AllocationResult
248 248
249 AllocationSpace AllocationResult::RetrySpace() { 249 AllocationSpace AllocationResult::RetrySpace() {
250 DCHECK(IsRetry()); 250 DCHECK(IsRetry());
251 return static_cast<AllocationSpace>(Smi::cast(object_)->value()); 251 return static_cast<AllocationSpace>(Smi::cast(object_)->value());
252 } 252 }
253 253
254 NewSpacePage* NewSpacePage::Initialize(Heap* heap, MemoryChunk* chunk,
255 Executability executable,
256 SemiSpace* owner) {
257 DCHECK_EQ(executable, Executability::NOT_EXECUTABLE);
258 bool in_to_space = (owner->id() != kFromSpace);
259 chunk->SetFlag(in_to_space ? MemoryChunk::IN_TO_SPACE
260 : MemoryChunk::IN_FROM_SPACE);
261 DCHECK(!chunk->IsFlagSet(in_to_space ? MemoryChunk::IN_FROM_SPACE
262 : MemoryChunk::IN_TO_SPACE));
263 NewSpacePage* page = static_cast<NewSpacePage*>(chunk);
264 heap->incremental_marking()->SetNewSpacePageFlags(page);
265 return page;
266 }
254 267
255 // -------------------------------------------------------------------------- 268 // --------------------------------------------------------------------------
256 // PagedSpace 269 // PagedSpace
257 270
258 Page* Page::Initialize(Heap* heap, MemoryChunk* chunk, Executability executable, 271 Page* Page::Initialize(Heap* heap, MemoryChunk* chunk, Executability executable,
259 PagedSpace* owner) { 272 PagedSpace* owner) {
260 Page* page = reinterpret_cast<Page*>(chunk); 273 Page* page = reinterpret_cast<Page*>(chunk);
261 page->mutex_ = new base::Mutex(); 274 page->mutex_ = new base::Mutex();
262 DCHECK(page->area_size() <= kAllocatableMemory); 275 DCHECK(page->area_size() <= kAllocatableMemory);
263 DCHECK(chunk->owner() == owner); 276 DCHECK(chunk->owner() == owner);
277
264 owner->IncreaseCapacity(page->area_size()); 278 owner->IncreaseCapacity(page->area_size());
265 heap->incremental_marking()->SetOldSpacePageFlags(chunk); 279 heap->incremental_marking()->SetOldSpacePageFlags(chunk);
266 280
267 // Make sure that categories are initialized before freeing the area. 281 // Make sure that categories are initialized before freeing the area.
268 page->InitializeFreeListCategories(); 282 page->InitializeFreeListCategories();
269 owner->Free(page->area_start(), page->area_size()); 283 owner->Free(page->area_start(), page->area_size());
270 284
271 return page; 285 return page;
272 } 286 }
273 287
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 other->allocation_info_.Reset(nullptr, nullptr); 704 other->allocation_info_.Reset(nullptr, nullptr);
691 return true; 705 return true;
692 } 706 }
693 return false; 707 return false;
694 } 708 }
695 709
696 } // namespace internal 710 } // namespace internal
697 } // namespace v8 711 } // namespace v8
698 712
699 #endif // V8_HEAP_SPACES_INL_H_ 713 #endif // V8_HEAP_SPACES_INL_H_
OLDNEW
« no previous file with comments | « src/heap/spaces.cc ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698