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 #include "src/heap/scavenger.h" | 5 #include "src/heap/scavenger.h" |
6 | 6 |
7 #include "src/contexts.h" | 7 #include "src/contexts.h" |
8 #include "src/heap/heap-inl.h" | 8 #include "src/heap/heap-inl.h" |
9 #include "src/heap/incremental-marking.h" | 9 #include "src/heap/incremental-marking.h" |
10 #include "src/heap/objects-visiting-inl.h" | 10 #include "src/heap/objects-visiting-inl.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 SharedFunctionInfo::kSize>); | 67 SharedFunctionInfo::kSize>); |
68 | 68 |
69 table_.Register(kVisitJSWeakCollection, | 69 table_.Register(kVisitJSWeakCollection, |
70 &ObjectEvacuationStrategy<POINTER_OBJECT>::Visit); | 70 &ObjectEvacuationStrategy<POINTER_OBJECT>::Visit); |
71 | 71 |
72 table_.Register(kVisitJSRegExp, | 72 table_.Register(kVisitJSRegExp, |
73 &ObjectEvacuationStrategy<POINTER_OBJECT>::Visit); | 73 &ObjectEvacuationStrategy<POINTER_OBJECT>::Visit); |
74 | 74 |
75 table_.Register(kVisitJSFunction, &EvacuateJSFunction); | 75 table_.Register(kVisitJSFunction, &EvacuateJSFunction); |
76 | 76 |
77 table_.RegisterSpecializations<ObjectEvacuationStrategy<DATA_OBJECT>, | 77 table_.Register(kVisitDataObject, |
78 kVisitDataObject, kVisitDataObjectGeneric>(); | 78 &ObjectEvacuationStrategy<DATA_OBJECT>::Visit); |
79 | 79 |
80 table_.RegisterSpecializations<ObjectEvacuationStrategy<POINTER_OBJECT>, | 80 table_.Register(kVisitJSObjectFast, |
81 kVisitJSObject, kVisitJSObjectGeneric>(); | 81 &ObjectEvacuationStrategy<POINTER_OBJECT>::Visit); |
| 82 table_.Register(kVisitJSObject, |
| 83 &ObjectEvacuationStrategy<POINTER_OBJECT>::Visit); |
82 | 84 |
83 table_ | 85 table_.Register(kVisitJSApiObject, |
84 .RegisterSpecializations<ObjectEvacuationStrategy<POINTER_OBJECT>, | 86 &ObjectEvacuationStrategy<POINTER_OBJECT>::Visit); |
85 kVisitJSApiObject, kVisitJSApiObjectGeneric>(); | |
86 | 87 |
87 table_.RegisterSpecializations<ObjectEvacuationStrategy<POINTER_OBJECT>, | 88 table_.Register(kVisitStruct, |
88 kVisitStruct, kVisitStructGeneric>(); | 89 &ObjectEvacuationStrategy<POINTER_OBJECT>::Visit); |
89 } | 90 } |
90 | 91 |
91 static VisitorDispatchTable<ScavengingCallback>* GetTable() { | 92 static VisitorDispatchTable<ScavengingCallback>* GetTable() { |
92 return &table_; | 93 return &table_; |
93 } | 94 } |
94 | 95 |
95 static void EvacuateThinStringNoShortcut(Map* map, HeapObject** slot, | 96 static void EvacuateThinStringNoShortcut(Map* map, HeapObject** slot, |
96 HeapObject* object) { | 97 HeapObject* object) { |
97 EvacuateObject<POINTER_OBJECT, kWordAligned>(map, slot, object, | 98 EvacuateObject<POINTER_OBJECT, kWordAligned>(map, slot, object, |
98 ThinString::kSize); | 99 ThinString::kSize); |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 void ScavengeVisitor::ScavengePointer(Object** p) { | 469 void ScavengeVisitor::ScavengePointer(Object** p) { |
469 Object* object = *p; | 470 Object* object = *p; |
470 if (!heap_->InNewSpace(object)) return; | 471 if (!heap_->InNewSpace(object)) return; |
471 | 472 |
472 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), | 473 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), |
473 reinterpret_cast<HeapObject*>(object)); | 474 reinterpret_cast<HeapObject*>(object)); |
474 } | 475 } |
475 | 476 |
476 } // namespace internal | 477 } // namespace internal |
477 } // namespace v8 | 478 } // namespace v8 |
OLD | NEW |