OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_SCAVENGER_INL_H_ | 5 #ifndef V8_HEAP_SCAVENGER_INL_H_ |
6 #define V8_HEAP_SCAVENGER_INL_H_ | 6 #define V8_HEAP_SCAVENGER_INL_H_ |
7 | 7 |
8 #include "src/heap/scavenger.h" | 8 #include "src/heap/scavenger.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 if (heap->InToSpace(object)) { | 55 if (heap->InToSpace(object)) { |
56 return KEEP_SLOT; | 56 return KEEP_SLOT; |
57 } | 57 } |
58 } | 58 } |
59 // Slots can point to "to" space if the slot has been recorded multiple | 59 // Slots can point to "to" space if the slot has been recorded multiple |
60 // times in the remembered set. We remove the redundant slot now. | 60 // times in the remembered set. We remove the redundant slot now. |
61 return REMOVE_SLOT; | 61 return REMOVE_SLOT; |
62 } | 62 } |
63 | 63 |
64 // static | 64 // static |
65 template <PromotionMode promotion_mode> | 65 void StaticScavengeVisitor::VisitPointer(Heap* heap, HeapObject* obj, |
66 void StaticScavengeVisitor<promotion_mode>::VisitPointer(Heap* heap, | 66 Object** p) { |
67 HeapObject* obj, | |
68 Object** p) { | |
69 Object* object = *p; | 67 Object* object = *p; |
70 if (!heap->InNewSpace(object)) return; | 68 if (!heap->InNewSpace(object)) return; |
71 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), | 69 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), |
72 reinterpret_cast<HeapObject*>(object)); | 70 reinterpret_cast<HeapObject*>(object)); |
73 } | 71 } |
74 | 72 |
75 } // namespace internal | 73 } // namespace internal |
76 } // namespace v8 | 74 } // namespace v8 |
77 | 75 |
78 #endif // V8_HEAP_SCAVENGER_INL_H_ | 76 #endif // V8_HEAP_SCAVENGER_INL_H_ |
OLD | NEW |