| 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 } |
| 108 return JSArrayBufferBodyVisitor::Visit(map, object); | 113 return JSArrayBufferBodyVisitor::Visit(map, object); |
| 109 } | 114 } |
| 110 | 115 |
| 111 | 116 |
| 112 template <typename StaticVisitor> | 117 template <typename StaticVisitor> |
| 113 int StaticNewSpaceVisitor<StaticVisitor>::VisitBytecodeArray( | 118 int StaticNewSpaceVisitor<StaticVisitor>::VisitBytecodeArray( |
| 114 Map* map, HeapObject* object) { | 119 Map* map, HeapObject* object) { |
| 115 VisitPointers( | 120 VisitPointers( |
| 116 map->GetHeap(), object, | 121 map->GetHeap(), object, |
| 117 HeapObject::RawField(object, BytecodeArray::kConstantPoolOffset), | 122 HeapObject::RawField(object, BytecodeArray::kConstantPoolOffset), |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, | 732 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, |
| 728 void> JSFunctionWeakCodeBodyVisitor; | 733 void> JSFunctionWeakCodeBodyVisitor; |
| 729 JSFunctionWeakCodeBodyVisitor::Visit(map, object); | 734 JSFunctionWeakCodeBodyVisitor::Visit(map, object); |
| 730 } | 735 } |
| 731 | 736 |
| 732 | 737 |
| 733 } // namespace internal | 738 } // namespace internal |
| 734 } // namespace v8 | 739 } // namespace v8 |
| 735 | 740 |
| 736 #endif // V8_OBJECTS_VISITING_INL_H_ | 741 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |