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/layout-descriptor.h" | 9 #include "src/layout-descriptor.h" |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 | 23 |
24 // Base class for all static visitors. | 24 // Base class for all static visitors. |
25 class StaticVisitorBase : public AllStatic { | 25 class StaticVisitorBase : public AllStatic { |
26 public: | 26 public: |
27 #define VISITOR_ID_LIST(V) \ | 27 #define VISITOR_ID_LIST(V) \ |
28 V(SeqOneByteString) \ | 28 V(SeqOneByteString) \ |
29 V(SeqTwoByteString) \ | 29 V(SeqTwoByteString) \ |
30 V(ShortcutCandidate) \ | 30 V(ShortcutCandidate) \ |
31 V(ByteArray) \ | 31 V(ByteArray) \ |
| 32 V(BytecodeArray) \ |
32 V(FreeSpace) \ | 33 V(FreeSpace) \ |
33 V(FixedArray) \ | 34 V(FixedArray) \ |
34 V(FixedDoubleArray) \ | 35 V(FixedDoubleArray) \ |
35 V(FixedTypedArray) \ | 36 V(FixedTypedArray) \ |
36 V(FixedFloat64Array) \ | 37 V(FixedFloat64Array) \ |
37 V(NativeContext) \ | 38 V(NativeContext) \ |
38 V(AllocationSite) \ | 39 V(AllocationSite) \ |
39 V(DataObject2) \ | 40 V(DataObject2) \ |
40 V(DataObject3) \ | 41 V(DataObject3) \ |
41 V(DataObject4) \ | 42 V(DataObject4) \ |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 heap, HeapObject::RawField(object, | 314 heap, HeapObject::RawField(object, |
314 JSFunction::kCodeEntryOffset + kPointerSize), | 315 JSFunction::kCodeEntryOffset + kPointerSize), |
315 HeapObject::RawField(object, JSFunction::kNonWeakFieldsEndOffset)); | 316 HeapObject::RawField(object, JSFunction::kNonWeakFieldsEndOffset)); |
316 return JSFunction::kSize; | 317 return JSFunction::kSize; |
317 } | 318 } |
318 | 319 |
319 INLINE(static int VisitByteArray(Map* map, HeapObject* object)) { | 320 INLINE(static int VisitByteArray(Map* map, HeapObject* object)) { |
320 return reinterpret_cast<ByteArray*>(object)->ByteArraySize(); | 321 return reinterpret_cast<ByteArray*>(object)->ByteArraySize(); |
321 } | 322 } |
322 | 323 |
| 324 INLINE(static int VisitBytecodeArray(Map* map, HeapObject* object)) { |
| 325 return reinterpret_cast<BytecodeArray*>(object)->BytecodeArraySize(); |
| 326 } |
| 327 |
323 INLINE(static int VisitFixedDoubleArray(Map* map, HeapObject* object)) { | 328 INLINE(static int VisitFixedDoubleArray(Map* map, HeapObject* object)) { |
324 int length = reinterpret_cast<FixedDoubleArray*>(object)->length(); | 329 int length = reinterpret_cast<FixedDoubleArray*>(object)->length(); |
325 return FixedDoubleArray::SizeFor(length); | 330 return FixedDoubleArray::SizeFor(length); |
326 } | 331 } |
327 | 332 |
328 INLINE(static int VisitFixedTypedArray(Map* map, HeapObject* object)) { | 333 INLINE(static int VisitFixedTypedArray(Map* map, HeapObject* object)) { |
329 return reinterpret_cast<FixedTypedArrayBase*>(object)->size(); | 334 return reinterpret_cast<FixedTypedArrayBase*>(object)->size(); |
330 } | 335 } |
331 | 336 |
332 INLINE(static int VisitJSObject(Map* map, HeapObject* object)) { | 337 INLINE(static int VisitJSObject(Map* map, HeapObject* object)) { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 // the next element. Given the head of the list, this function removes dead | 494 // the next element. Given the head of the list, this function removes dead |
490 // elements from the list and if requested records slots for next-element | 495 // elements from the list and if requested records slots for next-element |
491 // pointers. The template parameter T is a WeakListVisitor that defines how to | 496 // pointers. The template parameter T is a WeakListVisitor that defines how to |
492 // access the next-element pointers. | 497 // access the next-element pointers. |
493 template <class T> | 498 template <class T> |
494 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer); | 499 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer); |
495 } | 500 } |
496 } // namespace v8::internal | 501 } // namespace v8::internal |
497 | 502 |
498 #endif // V8_OBJECTS_VISITING_H_ | 503 #endif // V8_OBJECTS_VISITING_H_ |
OLD | NEW |