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.h" | 8 #include "src/heap/heap.h" |
9 #include "src/heap/objects-visiting-inl.h" | 9 #include "src/heap/objects-visiting-inl.h" |
10 #include "src/heap/scavenger-inl.h" | 10 #include "src/heap/scavenger-inl.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 &ObjectEvacuationStrategy<POINTER_OBJECT>::Visit); | 71 &ObjectEvacuationStrategy<POINTER_OBJECT>::Visit); |
72 | 72 |
73 table_.Register(kVisitJSFunction, &EvacuateJSFunction); | 73 table_.Register(kVisitJSFunction, &EvacuateJSFunction); |
74 | 74 |
75 table_.RegisterSpecializations<ObjectEvacuationStrategy<DATA_OBJECT>, | 75 table_.RegisterSpecializations<ObjectEvacuationStrategy<DATA_OBJECT>, |
76 kVisitDataObject, kVisitDataObjectGeneric>(); | 76 kVisitDataObject, kVisitDataObjectGeneric>(); |
77 | 77 |
78 table_.RegisterSpecializations<ObjectEvacuationStrategy<POINTER_OBJECT>, | 78 table_.RegisterSpecializations<ObjectEvacuationStrategy<POINTER_OBJECT>, |
79 kVisitJSObject, kVisitJSObjectGeneric>(); | 79 kVisitJSObject, kVisitJSObjectGeneric>(); |
80 | 80 |
| 81 table_ |
| 82 .RegisterSpecializations<ObjectEvacuationStrategy<POINTER_OBJECT>, |
| 83 kVisitJSApiObject, kVisitJSApiObjectGeneric>(); |
| 84 |
81 table_.RegisterSpecializations<ObjectEvacuationStrategy<POINTER_OBJECT>, | 85 table_.RegisterSpecializations<ObjectEvacuationStrategy<POINTER_OBJECT>, |
82 kVisitStruct, kVisitStructGeneric>(); | 86 kVisitStruct, kVisitStructGeneric>(); |
83 } | 87 } |
84 | 88 |
85 static VisitorDispatchTable<ScavengingCallback>* GetTable() { | 89 static VisitorDispatchTable<ScavengingCallback>* GetTable() { |
86 return &table_; | 90 return &table_; |
87 } | 91 } |
88 | 92 |
89 private: | 93 private: |
90 enum ObjectContents { DATA_OBJECT, POINTER_OBJECT }; | 94 enum ObjectContents { DATA_OBJECT, POINTER_OBJECT }; |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 | 465 |
462 void ScavengeVisitor::ScavengePointer(Object** p) { | 466 void ScavengeVisitor::ScavengePointer(Object** p) { |
463 Object* object = *p; | 467 Object* object = *p; |
464 if (!heap_->InNewSpace(object)) return; | 468 if (!heap_->InNewSpace(object)) return; |
465 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), | 469 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), |
466 reinterpret_cast<HeapObject*>(object)); | 470 reinterpret_cast<HeapObject*>(object)); |
467 } | 471 } |
468 | 472 |
469 } // namespace internal | 473 } // namespace internal |
470 } // namespace v8 | 474 } // namespace v8 |
OLD | NEW |