Chromium Code Reviews

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

Issue 2764473002: [heap] Make SlotSet allocation thread-safe and refactor code. (Closed)
Patch Set: format Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « src/heap/spaces.cc ('k') | no next file » | 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 308 matching lines...)
319 319
320 void Page::MarkNeverAllocateForTesting() { 320 void Page::MarkNeverAllocateForTesting() {
321 DCHECK(this->owner()->identity() != NEW_SPACE); 321 DCHECK(this->owner()->identity() != NEW_SPACE);
322 DCHECK(!IsFlagSet(NEVER_ALLOCATE_ON_PAGE)); 322 DCHECK(!IsFlagSet(NEVER_ALLOCATE_ON_PAGE));
323 SetFlag(NEVER_ALLOCATE_ON_PAGE); 323 SetFlag(NEVER_ALLOCATE_ON_PAGE);
324 reinterpret_cast<PagedSpace*>(owner())->free_list()->EvictFreeListItems(this); 324 reinterpret_cast<PagedSpace*>(owner())->free_list()->EvictFreeListItems(this);
325 } 325 }
326 326
327 void Page::MarkEvacuationCandidate() { 327 void Page::MarkEvacuationCandidate() {
328 DCHECK(!IsFlagSet(NEVER_EVACUATE)); 328 DCHECK(!IsFlagSet(NEVER_EVACUATE));
329 DCHECK_NULL(old_to_old_slots_); 329 DCHECK_NULL(slot_set<OLD_TO_OLD>());
330 DCHECK_NULL(typed_old_to_old_slots_); 330 DCHECK_NULL(typed_slot_set<OLD_TO_OLD>());
331 SetFlag(EVACUATION_CANDIDATE); 331 SetFlag(EVACUATION_CANDIDATE);
332 reinterpret_cast<PagedSpace*>(owner())->free_list()->EvictFreeListItems(this); 332 reinterpret_cast<PagedSpace*>(owner())->free_list()->EvictFreeListItems(this);
333 } 333 }
334 334
335 void Page::ClearEvacuationCandidate() { 335 void Page::ClearEvacuationCandidate() {
336 if (!IsFlagSet(COMPACTION_WAS_ABORTED)) { 336 if (!IsFlagSet(COMPACTION_WAS_ABORTED)) {
337 DCHECK_NULL(old_to_old_slots_); 337 DCHECK_NULL(slot_set<OLD_TO_OLD>());
338 DCHECK_NULL(typed_old_to_old_slots_); 338 DCHECK_NULL(typed_slot_set<OLD_TO_OLD>());
339 } 339 }
340 ClearFlag(EVACUATION_CANDIDATE); 340 ClearFlag(EVACUATION_CANDIDATE);
341 InitializeFreeListCategories(); 341 InitializeFreeListCategories();
342 } 342 }
343 343
344 MemoryChunkIterator::MemoryChunkIterator(Heap* heap) 344 MemoryChunkIterator::MemoryChunkIterator(Heap* heap)
345 : heap_(heap), 345 : heap_(heap),
346 state_(kOldSpaceState), 346 state_(kOldSpaceState),
347 old_iterator_(heap->old_space()->begin()), 347 old_iterator_(heap->old_space()->begin()),
348 code_iterator_(heap->code_space()->begin()), 348 code_iterator_(heap->code_space()->begin()),
(...skipping 316 matching lines...)
665 other->allocation_info_.Reset(nullptr, nullptr); 665 other->allocation_info_.Reset(nullptr, nullptr);
666 return true; 666 return true;
667 } 667 }
668 return false; 668 return false;
669 } 669 }
670 670
671 } // namespace internal 671 } // namespace internal
672 } // namespace v8 672 } // namespace v8
673 673
674 #endif // V8_HEAP_SPACES_INL_H_ 674 #endif // V8_HEAP_SPACES_INL_H_
OLDNEW
« no previous file with comments | « src/heap/spaces.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine