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

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

Issue 1703823002: Replace slots buffer with remembered set. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 10 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/slots-buffer.h" 9 #include "src/heap/remembered-set.h"
10 #include "src/isolate.h" 10 #include "src/isolate.h"
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 14
15 inline std::vector<Page*>& MarkCompactCollector::sweeping_list(Space* space) { 15 inline std::vector<Page*>& MarkCompactCollector::sweeping_list(Space* space) {
16 if (space == heap()->old_space()) { 16 if (space == heap()->old_space()) {
17 return sweeping_list_old_space_; 17 return sweeping_list_old_space_;
18 } else if (space == heap()->code_space()) { 18 } else if (space == heap()->code_space()) {
19 return sweeping_list_code_space_; 19 return sweeping_list_code_space_;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 bool MarkCompactCollector::IsMarked(Object* obj) { 63 bool MarkCompactCollector::IsMarked(Object* obj) {
64 DCHECK(obj->IsHeapObject()); 64 DCHECK(obj->IsHeapObject());
65 HeapObject* heap_object = HeapObject::cast(obj); 65 HeapObject* heap_object = HeapObject::cast(obj);
66 return Marking::IsBlackOrGrey(Marking::MarkBitFrom(heap_object)); 66 return Marking::IsBlackOrGrey(Marking::MarkBitFrom(heap_object));
67 } 67 }
68 68
69 69
70 void MarkCompactCollector::RecordSlot(HeapObject* object, Object** slot, 70 void MarkCompactCollector::RecordSlot(HeapObject* object, Object** slot,
71 Object* target) { 71 Object* target) {
72 Page* target_page = Page::FromAddress(reinterpret_cast<Address>(target)); 72 Page* target_page = Page::FromAddress(reinterpret_cast<Address>(target));
73 Page* source_page = Page::FromAddress(reinterpret_cast<Address>(object));
73 if (target_page->IsEvacuationCandidate() && 74 if (target_page->IsEvacuationCandidate() &&
74 !ShouldSkipEvacuationSlotRecording(object)) { 75 !ShouldSkipEvacuationSlotRecording(object)) {
75 if (!SlotsBuffer::AddTo(slots_buffer_allocator_, 76 RememberedSet<OLD_TO_OLD>::Insert(source_page,
jochen (gone - plz use gerrit) 2016/02/23 13:10:53 so we now just crash if we can't grow the remember
ulan 2016/02/23 13:19:07 Yes, as discussed offline, the remembered set filt
76 target_page->slots_buffer_address(), slot, 77 reinterpret_cast<Address>(slot));
77 SlotsBuffer::FAIL_ON_OVERFLOW)) {
78 EvictPopularEvacuationCandidate(target_page);
79 }
80 } 78 }
81 } 79 }
82 80
83
84 void MarkCompactCollector::ForceRecordSlot(HeapObject* object, Object** slot,
85 Object* target) {
86 Page* target_page = Page::FromAddress(reinterpret_cast<Address>(target));
87 if (target_page->IsEvacuationCandidate() &&
88 !ShouldSkipEvacuationSlotRecording(object)) {
89 CHECK(SlotsBuffer::AddTo(slots_buffer_allocator_,
90 target_page->slots_buffer_address(), slot,
91 SlotsBuffer::IGNORE_OVERFLOW));
92 }
93 }
94
95 81
96 void CodeFlusher::AddCandidate(SharedFunctionInfo* shared_info) { 82 void CodeFlusher::AddCandidate(SharedFunctionInfo* shared_info) {
97 if (GetNextCandidate(shared_info) == nullptr) { 83 if (GetNextCandidate(shared_info) == nullptr) {
98 SetNextCandidate(shared_info, shared_function_info_candidates_head_); 84 SetNextCandidate(shared_info, shared_function_info_candidates_head_);
99 shared_function_info_candidates_head_ = shared_info; 85 shared_function_info_candidates_head_ = shared_info;
100 } 86 }
101 } 87 }
102 88
103 89
104 void CodeFlusher::AddCandidate(JSFunction* function) { 90 void CodeFlusher::AddCandidate(JSFunction* function) {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 } 183 }
198 if (object != nullptr) return object; 184 if (object != nullptr) return object;
199 } 185 }
200 return nullptr; 186 return nullptr;
201 } 187 }
202 188
203 } // namespace internal 189 } // namespace internal
204 } // namespace v8 190 } // namespace v8
205 191
206 #endif // V8_HEAP_MARK_COMPACT_INL_H_ 192 #endif // V8_HEAP_MARK_COMPACT_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698