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

Side by Side Diff: src/heap/remembered-set.cc

Issue 1420423009: [heap] Black allocation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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/mark-compact-inl.h ('k') | src/heap/scavenger.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 #include "src/heap/remembered-set.h" 5 #include "src/heap/remembered-set.h"
6 #include "src/heap/heap-inl.h" 6 #include "src/heap/heap-inl.h"
7 #include "src/heap/heap.h" 7 #include "src/heap/heap.h"
8 #include "src/heap/mark-compact.h" 8 #include "src/heap/mark-compact.h"
9 #include "src/heap/slot-set.h" 9 #include "src/heap/slot-set.h"
10 #include "src/heap/spaces.h" 10 #include "src/heap/spaces.h"
(...skipping 24 matching lines...) Expand all
35 Iterate(heap, [heap](Address addr) { 35 Iterate(heap, [heap](Address addr) {
36 HeapObject* obj = 36 HeapObject* obj =
37 heap->mark_compact_collector()->FindBlackObjectBySlotSlow(addr); 37 heap->mark_compact_collector()->FindBlackObjectBySlotSlow(addr);
38 if (obj == nullptr) { 38 if (obj == nullptr) {
39 // The slot is in dead object. 39 // The slot is in dead object.
40 MemoryChunk* chunk = MemoryChunk::FromAnyPointerAddress(heap, addr); 40 MemoryChunk* chunk = MemoryChunk::FromAnyPointerAddress(heap, addr);
41 AllocationSpace owner = chunk->owner()->identity(); 41 AllocationSpace owner = chunk->owner()->identity();
42 // The old to old remembered set should not have dead slots. 42 // The old to old remembered set should not have dead slots.
43 CHECK_NE(direction, OLD_TO_OLD); 43 CHECK_NE(direction, OLD_TO_OLD);
44 // The old to new remembered set is allowed to have slots in dead 44 // The old to new remembered set is allowed to have slots in dead
45 // objects only in map and large object space because these spaces cannot 45 // objects only in map and large object space because these space
46 // have raw untaged pointers. 46 // cannot have raw untagged pointers.
47 CHECK(owner == MAP_SPACE || owner == LO_SPACE); 47 CHECK(owner == MAP_SPACE || owner == LO_SPACE);
48 } else { 48 } else {
49 int offset = static_cast<int>(addr - obj->address()); 49 int offset = static_cast<int>(addr - obj->address());
50 CHECK(obj->IsValidSlot(offset)); 50 CHECK(obj->IsValidSlot(offset));
51 } 51 }
52 return KEEP_SLOT; 52 return KEEP_SLOT;
53 }); 53 });
54 } 54 }
55 55
56 template <PointerDirection direction> 56 template <PointerDirection direction>
(...skipping 10 matching lines...) Expand all
67 heap->mark_compact_collector()->IsSlotInLiveObject( 67 heap->mark_compact_collector()->IsSlotInLiveObject(
68 reinterpret_cast<Address>(slot)); 68 reinterpret_cast<Address>(slot));
69 } 69 }
70 70
71 template void RememberedSet<OLD_TO_NEW>::ClearInvalidSlots(Heap* heap); 71 template void RememberedSet<OLD_TO_NEW>::ClearInvalidSlots(Heap* heap);
72 template void RememberedSet<OLD_TO_NEW>::VerifyValidSlots(Heap* heap); 72 template void RememberedSet<OLD_TO_NEW>::VerifyValidSlots(Heap* heap);
73 template void RememberedSet<OLD_TO_OLD>::VerifyValidSlots(Heap* heap); 73 template void RememberedSet<OLD_TO_OLD>::VerifyValidSlots(Heap* heap);
74 74
75 } // namespace internal 75 } // namespace internal
76 } // namespace v8 76 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/mark-compact-inl.h ('k') | src/heap/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698