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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 table_.template RegisterSpecializations<StructVisitor, kVisitStruct, | 98 table_.template RegisterSpecializations<StructVisitor, kVisitStruct, |
99 kVisitStructGeneric>(); | 99 kVisitStructGeneric>(); |
100 } | 100 } |
101 | 101 |
102 | 102 |
103 template <typename StaticVisitor> | 103 template <typename StaticVisitor> |
104 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer( | 104 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer( |
105 Map* map, HeapObject* object) { | 105 Map* map, HeapObject* object) { |
106 typedef FlexibleBodyVisitor<StaticVisitor, JSArrayBuffer::BodyDescriptor, int> | 106 typedef FlexibleBodyVisitor<StaticVisitor, JSArrayBuffer::BodyDescriptor, int> |
107 JSArrayBufferBodyVisitor; | 107 JSArrayBufferBodyVisitor; |
108 | |
109 if (!JSArrayBuffer::cast(object)->is_external()) { | |
110 Heap* heap = map->GetHeap(); | |
111 heap->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(object)); | |
112 } | |
113 return JSArrayBufferBodyVisitor::Visit(map, object); | 108 return JSArrayBufferBodyVisitor::Visit(map, object); |
114 } | 109 } |
115 | 110 |
116 | 111 |
117 template <typename StaticVisitor> | 112 template <typename StaticVisitor> |
118 int StaticNewSpaceVisitor<StaticVisitor>::VisitBytecodeArray( | 113 int StaticNewSpaceVisitor<StaticVisitor>::VisitBytecodeArray( |
119 Map* map, HeapObject* object) { | 114 Map* map, HeapObject* object) { |
120 VisitPointers( | 115 VisitPointers( |
121 map->GetHeap(), object, | 116 map->GetHeap(), object, |
122 HeapObject::RawField(object, BytecodeArray::kConstantPoolOffset), | 117 HeapObject::RawField(object, BytecodeArray::kConstantPoolOffset), |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, | 727 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, |
733 void> JSFunctionWeakCodeBodyVisitor; | 728 void> JSFunctionWeakCodeBodyVisitor; |
734 JSFunctionWeakCodeBodyVisitor::Visit(map, object); | 729 JSFunctionWeakCodeBodyVisitor::Visit(map, object); |
735 } | 730 } |
736 | 731 |
737 | 732 |
738 } // namespace internal | 733 } // namespace internal |
739 } // namespace v8 | 734 } // namespace v8 |
740 | 735 |
741 #endif // V8_OBJECTS_VISITING_INL_H_ | 736 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |