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_OBJECTS_VISITING_INL_H_ | 5 #ifndef V8_OBJECTS_VISITING_INL_H_ |
6 #define V8_OBJECTS_VISITING_INL_H_ | 6 #define V8_OBJECTS_VISITING_INL_H_ |
7 | 7 |
8 #include "src/heap/array-buffer-tracker.h" | 8 #include "src/heap/array-buffer-tracker.h" |
9 #include "src/heap/objects-visiting.h" | 9 #include "src/heap/objects-visiting.h" |
10 #include "src/ic/ic-state.h" | 10 #include "src/ic/ic-state.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 kVisitFixedFloat64Array, | 53 kVisitFixedFloat64Array, |
54 &FlexibleBodyVisitor<StaticVisitor, FixedTypedArrayBase::BodyDescriptor, | 54 &FlexibleBodyVisitor<StaticVisitor, FixedTypedArrayBase::BodyDescriptor, |
55 int>::Visit); | 55 int>::Visit); |
56 | 56 |
57 table_.Register( | 57 table_.Register( |
58 kVisitNativeContext, | 58 kVisitNativeContext, |
59 &FixedBodyVisitor<StaticVisitor, Context::ScavengeBodyDescriptor, | 59 &FixedBodyVisitor<StaticVisitor, Context::ScavengeBodyDescriptor, |
60 int>::Visit); | 60 int>::Visit); |
61 | 61 |
62 table_.Register(kVisitByteArray, &VisitByteArray); | 62 table_.Register(kVisitByteArray, &VisitByteArray); |
63 table_.Register(kVisitBytecodeArray, &VisitBytecodeArray); | |
64 | 63 |
65 table_.Register( | 64 table_.Register( |
66 kVisitSharedFunctionInfo, | 65 kVisitSharedFunctionInfo, |
67 &FixedBodyVisitor<StaticVisitor, SharedFunctionInfo::BodyDescriptor, | 66 &FixedBodyVisitor<StaticVisitor, SharedFunctionInfo::BodyDescriptor, |
68 int>::Visit); | 67 int>::Visit); |
69 | 68 |
70 table_.Register(kVisitSeqOneByteString, &VisitSeqOneByteString); | 69 table_.Register(kVisitSeqOneByteString, &VisitSeqOneByteString); |
71 | 70 |
72 table_.Register(kVisitSeqTwoByteString, &VisitSeqTwoByteString); | 71 table_.Register(kVisitSeqTwoByteString, &VisitSeqTwoByteString); |
73 | 72 |
(...skipping 22 matching lines...) Expand all Loading... |
96 | 95 |
97 table_.template RegisterSpecializations<JSObjectVisitor, kVisitJSObject, | 96 table_.template RegisterSpecializations<JSObjectVisitor, kVisitJSObject, |
98 kVisitJSObjectGeneric>(); | 97 kVisitJSObjectGeneric>(); |
99 | 98 |
100 // Not using specialized Api object visitor for newspace. | 99 // Not using specialized Api object visitor for newspace. |
101 table_.template RegisterSpecializations<JSObjectVisitor, kVisitJSApiObject, | 100 table_.template RegisterSpecializations<JSObjectVisitor, kVisitJSApiObject, |
102 kVisitJSApiObjectGeneric>(); | 101 kVisitJSApiObjectGeneric>(); |
103 | 102 |
104 table_.template RegisterSpecializations<StructVisitor, kVisitStruct, | 103 table_.template RegisterSpecializations<StructVisitor, kVisitStruct, |
105 kVisitStructGeneric>(); | 104 kVisitStructGeneric>(); |
| 105 |
| 106 table_.Register(kVisitBytecodeArray, &UnreachableVisitor); |
| 107 table_.Register(kVisitSharedFunctionInfo, &UnreachableVisitor); |
106 } | 108 } |
107 | 109 |
108 template <typename StaticVisitor> | 110 template <typename StaticVisitor> |
109 int StaticNewSpaceVisitor<StaticVisitor>::VisitBytecodeArray( | |
110 Map* map, HeapObject* object) { | |
111 VisitPointers( | |
112 map->GetHeap(), object, | |
113 HeapObject::RawField(object, BytecodeArray::kConstantPoolOffset), | |
114 HeapObject::RawField(object, BytecodeArray::kFrameSizeOffset)); | |
115 return reinterpret_cast<BytecodeArray*>(object)->BytecodeArraySize(); | |
116 } | |
117 | |
118 | |
119 template <typename StaticVisitor> | |
120 void StaticMarkingVisitor<StaticVisitor>::Initialize() { | 111 void StaticMarkingVisitor<StaticVisitor>::Initialize() { |
121 table_.Register(kVisitShortcutCandidate, | 112 table_.Register(kVisitShortcutCandidate, |
122 &FixedBodyVisitor<StaticVisitor, ConsString::BodyDescriptor, | 113 &FixedBodyVisitor<StaticVisitor, ConsString::BodyDescriptor, |
123 void>::Visit); | 114 void>::Visit); |
124 | 115 |
125 table_.Register(kVisitConsString, | 116 table_.Register(kVisitConsString, |
126 &FixedBodyVisitor<StaticVisitor, ConsString::BodyDescriptor, | 117 &FixedBodyVisitor<StaticVisitor, ConsString::BodyDescriptor, |
127 void>::Visit); | 118 void>::Visit); |
128 | 119 |
129 table_.Register(kVisitSlicedString, | 120 table_.Register(kVisitSlicedString, |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, | 648 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, |
658 void> JSFunctionWeakCodeBodyVisitor; | 649 void> JSFunctionWeakCodeBodyVisitor; |
659 JSFunctionWeakCodeBodyVisitor::Visit(map, object); | 650 JSFunctionWeakCodeBodyVisitor::Visit(map, object); |
660 } | 651 } |
661 | 652 |
662 | 653 |
663 } // namespace internal | 654 } // namespace internal |
664 } // namespace v8 | 655 } // namespace v8 |
665 | 656 |
666 #endif // V8_OBJECTS_VISITING_INL_H_ | 657 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |