| 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_H_ | 5 #ifndef V8_OBJECTS_VISITING_H_ |
| 6 #define V8_OBJECTS_VISITING_H_ | 6 #define V8_OBJECTS_VISITING_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/heap/heap.h" | 9 #include "src/heap/heap.h" |
| 10 #include "src/heap/spaces.h" | 10 #include "src/heap/spaces.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 private: | 261 private: |
| 262 INLINE(static int VisitByteArray(Map* map, HeapObject* object)) { | 262 INLINE(static int VisitByteArray(Map* map, HeapObject* object)) { |
| 263 return reinterpret_cast<ByteArray*>(object)->ByteArraySize(); | 263 return reinterpret_cast<ByteArray*>(object)->ByteArraySize(); |
| 264 } | 264 } |
| 265 | 265 |
| 266 INLINE(static int VisitFixedDoubleArray(Map* map, HeapObject* object)) { | 266 INLINE(static int VisitFixedDoubleArray(Map* map, HeapObject* object)) { |
| 267 int length = reinterpret_cast<FixedDoubleArray*>(object)->length(); | 267 int length = reinterpret_cast<FixedDoubleArray*>(object)->length(); |
| 268 return FixedDoubleArray::SizeFor(length); | 268 return FixedDoubleArray::SizeFor(length); |
| 269 } | 269 } |
| 270 | 270 |
| 271 INLINE(static int VisitFixedTypedArray(Map* map, HeapObject* object)) { | |
| 272 return reinterpret_cast<FixedTypedArrayBase*>(object)->size(); | |
| 273 } | |
| 274 | |
| 275 INLINE(static int VisitJSObject(Map* map, HeapObject* object)) { | 271 INLINE(static int VisitJSObject(Map* map, HeapObject* object)) { |
| 276 return JSObjectVisitor::Visit(map, object); | 272 return JSObjectVisitor::Visit(map, object); |
| 277 } | 273 } |
| 278 | 274 |
| 279 INLINE(static int VisitSeqOneByteString(Map* map, HeapObject* object)) { | 275 INLINE(static int VisitSeqOneByteString(Map* map, HeapObject* object)) { |
| 280 return SeqOneByteString::cast(object) | 276 return SeqOneByteString::cast(object) |
| 281 ->SeqOneByteStringSize(map->instance_type()); | 277 ->SeqOneByteStringSize(map->instance_type()); |
| 282 } | 278 } |
| 283 | 279 |
| 284 INLINE(static int VisitSeqTwoByteString(Map* map, HeapObject* object)) { | 280 INLINE(static int VisitSeqTwoByteString(Map* map, HeapObject* object)) { |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 // the next element. Given the head of the list, this function removes dead | 427 // the next element. Given the head of the list, this function removes dead |
| 432 // elements from the list and if requested records slots for next-element | 428 // elements from the list and if requested records slots for next-element |
| 433 // pointers. The template parameter T is a WeakListVisitor that defines how to | 429 // pointers. The template parameter T is a WeakListVisitor that defines how to |
| 434 // access the next-element pointers. | 430 // access the next-element pointers. |
| 435 template <class T> | 431 template <class T> |
| 436 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer); | 432 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer); |
| 437 } // namespace internal | 433 } // namespace internal |
| 438 } // namespace v8 | 434 } // namespace v8 |
| 439 | 435 |
| 440 #endif // V8_OBJECTS_VISITING_H_ | 436 #endif // V8_OBJECTS_VISITING_H_ |
| OLD | NEW |