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

Side by Side Diff: src/heap/mark-compact-inl.h

Issue 2857713002: [heap] Make non-atomic markbit operations consistent with atomic ones. (Closed)
Patch Set: remove dcheck Created 3 years, 7 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_MARK_COMPACT_INL_H_ 5 #ifndef V8_HEAP_MARK_COMPACT_INL_H_
6 #define V8_HEAP_MARK_COMPACT_INL_H_ 6 #define V8_HEAP_MARK_COMPACT_INL_H_
7 7
8 #include "src/heap/mark-compact.h" 8 #include "src/heap/mark-compact.h"
9 #include "src/heap/remembered-set.h" 9 #include "src/heap/remembered-set.h"
10 #include "src/isolate.h" 10 #include "src/isolate.h"
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 32
33 void MarkCompactCollector::UnshiftBlack(HeapObject* obj) { 33 void MarkCompactCollector::UnshiftBlack(HeapObject* obj) {
34 DCHECK(ObjectMarking::IsBlack(obj, MarkingState::Internal(obj))); 34 DCHECK(ObjectMarking::IsBlack(obj, MarkingState::Internal(obj)));
35 if (!marking_deque()->Unshift(obj)) { 35 if (!marking_deque()->Unshift(obj)) {
36 ObjectMarking::BlackToGrey(obj, MarkingState::Internal(obj)); 36 ObjectMarking::BlackToGrey(obj, MarkingState::Internal(obj));
37 } 37 }
38 } 38 }
39 39
40 void MarkCompactCollector::MarkObject(HeapObject* obj) { 40 void MarkCompactCollector::MarkObject(HeapObject* obj) {
41 if (ObjectMarking::IsWhite<MarkBit::NON_ATOMIC>( 41 if (ObjectMarking::WhiteToBlack<MarkBit::NON_ATOMIC>(
42 obj, MarkingState::Internal(obj))) { 42 obj, MarkingState::Internal(obj))) {
43 ObjectMarking::WhiteToBlack<MarkBit::NON_ATOMIC>(
44 obj, MarkingState::Internal(obj));
45 PushBlack(obj); 43 PushBlack(obj);
46 } 44 }
47 } 45 }
48 46
49 void MinorMarkCompactCollector::MarkObject(HeapObject* obj) { 47 void MinorMarkCompactCollector::MarkObject(HeapObject* obj) {
50 if (ObjectMarking::IsWhite<MarkBit::NON_ATOMIC>( 48 if (ObjectMarking::WhiteToBlack<MarkBit::NON_ATOMIC>(
51 obj, MarkingState::External(obj))) { 49 obj, MarkingState::External(obj))) {
52 ObjectMarking::WhiteToBlack<MarkBit::NON_ATOMIC>(
53 obj, MarkingState::External(obj));
54 PushBlack(obj); 50 PushBlack(obj);
55 } 51 }
56 } 52 }
57 53
58 void MarkCompactCollector::RecordSlot(HeapObject* object, Object** slot, 54 void MarkCompactCollector::RecordSlot(HeapObject* object, Object** slot,
59 Object* target) { 55 Object* target) {
60 Page* target_page = Page::FromAddress(reinterpret_cast<Address>(target)); 56 Page* target_page = Page::FromAddress(reinterpret_cast<Address>(target));
61 Page* source_page = Page::FromAddress(reinterpret_cast<Address>(object)); 57 Page* source_page = Page::FromAddress(reinterpret_cast<Address>(object));
62 if (target_page->IsEvacuationCandidate() && 58 if (target_page->IsEvacuationCandidate() &&
63 !ShouldSkipEvacuationSlotRecording(object)) { 59 !ShouldSkipEvacuationSlotRecording(object)) {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 248 }
253 if (object != nullptr) return object; 249 if (object != nullptr) return object;
254 } 250 }
255 return nullptr; 251 return nullptr;
256 } 252 }
257 253
258 } // namespace internal 254 } // namespace internal
259 } // namespace v8 255 } // namespace v8
260 256
261 #endif // V8_HEAP_MARK_COMPACT_INL_H_ 257 #endif // V8_HEAP_MARK_COMPACT_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698