OLD | NEW |
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" |
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) { | |
16 if (space == heap()->old_space()) { | |
17 return sweeping_list_old_space_; | |
18 } else if (space == heap()->code_space()) { | |
19 return sweeping_list_code_space_; | |
20 } | |
21 DCHECK_EQ(space, heap()->map_space()); | |
22 return sweeping_list_map_space_; | |
23 } | |
24 | |
25 | |
26 void MarkCompactCollector::PushBlack(HeapObject* obj) { | 15 void MarkCompactCollector::PushBlack(HeapObject* obj) { |
27 DCHECK(Marking::IsBlack(Marking::MarkBitFrom(obj))); | 16 DCHECK(Marking::IsBlack(Marking::MarkBitFrom(obj))); |
28 if (marking_deque_.Push(obj)) { | 17 if (marking_deque_.Push(obj)) { |
29 MemoryChunk::IncrementLiveBytesFromGC(obj, obj->Size()); | 18 MemoryChunk::IncrementLiveBytesFromGC(obj, obj->Size()); |
30 } else { | 19 } else { |
31 Marking::BlackToGrey(obj); | 20 Marking::BlackToGrey(obj); |
32 } | 21 } |
33 } | 22 } |
34 | 23 |
35 | 24 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 174 } |
186 if (object != nullptr) return object; | 175 if (object != nullptr) return object; |
187 } | 176 } |
188 return nullptr; | 177 return nullptr; |
189 } | 178 } |
190 | 179 |
191 } // namespace internal | 180 } // namespace internal |
192 } // namespace v8 | 181 } // namespace v8 |
193 | 182 |
194 #endif // V8_HEAP_MARK_COMPACT_INL_H_ | 183 #endif // V8_HEAP_MARK_COMPACT_INL_H_ |
OLD | NEW |