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_.Register(kVisitDataObject, | 77 table_.RegisterSpecializations<ObjectEvacuationStrategy<DATA_OBJECT>, |
78 &ObjectEvacuationStrategy<DATA_OBJECT>::Visit); | 78 kVisitDataObject, kVisitDataObjectGeneric>(); |
79 | 79 |
80 table_.Register(kVisitJSObjectFast, | 80 table_.RegisterSpecializations<ObjectEvacuationStrategy<POINTER_OBJECT>, |
81 &ObjectEvacuationStrategy<POINTER_OBJECT>::Visit); | 81 kVisitJSObject, kVisitJSObjectGeneric>(); |
82 table_.Register(kVisitJSObject, | |
83 &ObjectEvacuationStrategy<POINTER_OBJECT>::Visit); | |
84 | 82 |
85 table_.Register(kVisitJSApiObject, | 83 table_ |
86 &ObjectEvacuationStrategy<POINTER_OBJECT>::Visit); | 84 .RegisterSpecializations<ObjectEvacuationStrategy<POINTER_OBJECT>, |
| 85 kVisitJSApiObject, kVisitJSApiObjectGeneric>(); |
87 | 86 |
88 table_.Register(kVisitStruct, | 87 table_.RegisterSpecializations<ObjectEvacuationStrategy<POINTER_OBJECT>, |
89 &ObjectEvacuationStrategy<POINTER_OBJECT>::Visit); | 88 kVisitStruct, kVisitStructGeneric>(); |
90 } | 89 } |
91 | 90 |
92 static VisitorDispatchTable<ScavengingCallback>* GetTable() { | 91 static VisitorDispatchTable<ScavengingCallback>* GetTable() { |
93 return &table_; | 92 return &table_; |
94 } | 93 } |
95 | 94 |
96 static void EvacuateThinStringNoShortcut(Map* map, HeapObject** slot, | 95 static void EvacuateThinStringNoShortcut(Map* map, HeapObject** slot, |
97 HeapObject* object) { | 96 HeapObject* object) { |
98 EvacuateObject<POINTER_OBJECT, kWordAligned>(map, slot, object, | 97 EvacuateObject<POINTER_OBJECT, kWordAligned>(map, slot, object, |
99 ThinString::kSize); | 98 ThinString::kSize); |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 void ScavengeVisitor::ScavengePointer(Object** p) { | 468 void ScavengeVisitor::ScavengePointer(Object** p) { |
470 Object* object = *p; | 469 Object* object = *p; |
471 if (!heap_->InNewSpace(object)) return; | 470 if (!heap_->InNewSpace(object)) return; |
472 | 471 |
473 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), | 472 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), |
474 reinterpret_cast<HeapObject*>(object)); | 473 reinterpret_cast<HeapObject*>(object)); |
475 } | 474 } |
476 | 475 |
477 } // namespace internal | 476 } // namespace internal |
478 } // namespace v8 | 477 } // namespace v8 |
OLD | NEW |