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

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

Issue 2440683002: [heap] Move typed slot filtering logic into sweeper. (Closed)
Patch Set: fix test Created 4 years, 2 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.cc ('k') | src/heap/slot-set.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "src/heap/remembered-set.h"
6 #include "src/heap/heap-inl.h"
7 #include "src/heap/heap.h"
8 #include "src/heap/mark-compact.h"
9 #include "src/heap/slot-set.h"
10 #include "src/heap/spaces.h"
11 #include "src/heap/store-buffer.h"
12 #include "src/macro-assembler.h"
13
14 namespace v8 {
15 namespace internal {
16
17 template <PointerDirection direction>
18 void RememberedSet<direction>::ClearInvalidTypedSlots(Heap* heap,
19 MemoryChunk* chunk) {
20 STATIC_ASSERT(direction == OLD_TO_NEW);
21 DCHECK(chunk->owner()->identity() == CODE_SPACE);
22 TypedSlotSet* slots = GetTypedSlotSet(chunk);
23 if (slots != nullptr) {
24 slots->Iterate(
25 [heap, chunk](SlotType type, Address host_addr, Address addr) {
26 if (Marking::IsBlack(ObjectMarking::MarkBitFrom(host_addr))) {
27 return KEEP_SLOT;
28 } else {
29 return REMOVE_SLOT;
30 }
31 },
32 TypedSlotSet::KEEP_EMPTY_CHUNKS);
33 }
34 }
35
36 template <PointerDirection direction>
37 bool RememberedSet<direction>::IsValidSlot(Heap* heap, MemoryChunk* chunk,
38 Object** slot) {
39 STATIC_ASSERT(direction == OLD_TO_NEW);
40 // If the target object is not black, the source slot must be part
41 // of a non-black (dead) object.
42 return heap->mark_compact_collector()->IsSlotInBlackObject(
43 chunk, reinterpret_cast<Address>(slot));
44 }
45
46 template void RememberedSet<OLD_TO_NEW>::ClearInvalidTypedSlots(
47 Heap* heap, MemoryChunk* chunk);
48
49 } // namespace internal
50 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/heap/slot-set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698