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

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

Issue 2783873002: [heap] Reland: Make SlotSet allocation thread-safe and refactor code. (Closed)
Patch Set: comment Created 3 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') | 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 275
276 void Page::MarkNeverAllocateForTesting() { 276 void Page::MarkNeverAllocateForTesting() {
277 DCHECK(this->owner()->identity() != NEW_SPACE); 277 DCHECK(this->owner()->identity() != NEW_SPACE);
278 DCHECK(!IsFlagSet(NEVER_ALLOCATE_ON_PAGE)); 278 DCHECK(!IsFlagSet(NEVER_ALLOCATE_ON_PAGE));
279 SetFlag(NEVER_ALLOCATE_ON_PAGE); 279 SetFlag(NEVER_ALLOCATE_ON_PAGE);
280 reinterpret_cast<PagedSpace*>(owner())->free_list()->EvictFreeListItems(this); 280 reinterpret_cast<PagedSpace*>(owner())->free_list()->EvictFreeListItems(this);
281 } 281 }
282 282
283 void Page::MarkEvacuationCandidate() { 283 void Page::MarkEvacuationCandidate() {
284 DCHECK(!IsFlagSet(NEVER_EVACUATE)); 284 DCHECK(!IsFlagSet(NEVER_EVACUATE));
285 DCHECK_NULL(old_to_old_slots_); 285 DCHECK_NULL(slot_set<OLD_TO_OLD>());
286 DCHECK_NULL(typed_old_to_old_slots_); 286 DCHECK_NULL(typed_slot_set<OLD_TO_OLD>());
287 SetFlag(EVACUATION_CANDIDATE); 287 SetFlag(EVACUATION_CANDIDATE);
288 reinterpret_cast<PagedSpace*>(owner())->free_list()->EvictFreeListItems(this); 288 reinterpret_cast<PagedSpace*>(owner())->free_list()->EvictFreeListItems(this);
289 } 289 }
290 290
291 void Page::ClearEvacuationCandidate() { 291 void Page::ClearEvacuationCandidate() {
292 if (!IsFlagSet(COMPACTION_WAS_ABORTED)) { 292 if (!IsFlagSet(COMPACTION_WAS_ABORTED)) {
293 DCHECK_NULL(old_to_old_slots_); 293 DCHECK_NULL(slot_set<OLD_TO_OLD>());
294 DCHECK_NULL(typed_old_to_old_slots_); 294 DCHECK_NULL(typed_slot_set<OLD_TO_OLD>());
295 } 295 }
296 ClearFlag(EVACUATION_CANDIDATE); 296 ClearFlag(EVACUATION_CANDIDATE);
297 InitializeFreeListCategories(); 297 InitializeFreeListCategories();
298 } 298 }
299 299
300 MemoryChunkIterator::MemoryChunkIterator(Heap* heap) 300 MemoryChunkIterator::MemoryChunkIterator(Heap* heap)
301 : heap_(heap), 301 : heap_(heap),
302 state_(kOldSpaceState), 302 state_(kOldSpaceState),
303 old_iterator_(heap->old_space()->begin()), 303 old_iterator_(heap->old_space()->begin()),
304 code_iterator_(heap->code_space()->begin()), 304 code_iterator_(heap->code_space()->begin()),
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 other->allocation_info_.Reset(nullptr, nullptr); 621 other->allocation_info_.Reset(nullptr, nullptr);
622 return true; 622 return true;
623 } 623 }
624 return false; 624 return false;
625 } 625 }
626 626
627 } // namespace internal 627 } // namespace internal
628 } // namespace v8 628 } // namespace v8
629 629
630 #endif // V8_HEAP_SPACES_INL_H_ 630 #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
This is Rietveld 408576698