OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 class StaticVisitorBase : public AllStatic { | 47 class StaticVisitorBase : public AllStatic { |
48 public: | 48 public: |
49 #define VISITOR_ID_LIST(V) \ | 49 #define VISITOR_ID_LIST(V) \ |
50 V(SeqOneByteString) \ | 50 V(SeqOneByteString) \ |
51 V(SeqTwoByteString) \ | 51 V(SeqTwoByteString) \ |
52 V(ShortcutCandidate) \ | 52 V(ShortcutCandidate) \ |
53 V(ByteArray) \ | 53 V(ByteArray) \ |
54 V(FreeSpace) \ | 54 V(FreeSpace) \ |
55 V(FixedArray) \ | 55 V(FixedArray) \ |
56 V(FixedDoubleArray) \ | 56 V(FixedDoubleArray) \ |
| 57 V(ConstantPoolArray) \ |
57 V(NativeContext) \ | 58 V(NativeContext) \ |
58 V(AllocationSite) \ | 59 V(AllocationSite) \ |
59 V(DataObject2) \ | 60 V(DataObject2) \ |
60 V(DataObject3) \ | 61 V(DataObject3) \ |
61 V(DataObject4) \ | 62 V(DataObject4) \ |
62 V(DataObject5) \ | 63 V(DataObject5) \ |
63 V(DataObject6) \ | 64 V(DataObject6) \ |
64 V(DataObject7) \ | 65 V(DataObject7) \ |
65 V(DataObject8) \ | 66 V(DataObject8) \ |
66 V(DataObject9) \ | 67 V(DataObject9) \ |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 | 315 |
315 INLINE(static int VisitByteArray(Map* map, HeapObject* object)) { | 316 INLINE(static int VisitByteArray(Map* map, HeapObject* object)) { |
316 return reinterpret_cast<ByteArray*>(object)->ByteArraySize(); | 317 return reinterpret_cast<ByteArray*>(object)->ByteArraySize(); |
317 } | 318 } |
318 | 319 |
319 INLINE(static int VisitFixedDoubleArray(Map* map, HeapObject* object)) { | 320 INLINE(static int VisitFixedDoubleArray(Map* map, HeapObject* object)) { |
320 int length = reinterpret_cast<FixedDoubleArray*>(object)->length(); | 321 int length = reinterpret_cast<FixedDoubleArray*>(object)->length(); |
321 return FixedDoubleArray::SizeFor(length); | 322 return FixedDoubleArray::SizeFor(length); |
322 } | 323 } |
323 | 324 |
| 325 INLINE(static int VisitConstantPoolArray(Map* map, HeapObject* object)) { |
| 326 ConstantPoolArray* constantPoolArray = |
| 327 reinterpret_cast<ConstantPoolArray*>(object); |
| 328 return ConstantPoolArray::SizeFor(constantPoolArray->length(), |
| 329 constantPoolArray->first_int32_index()); |
| 330 } |
| 331 |
324 INLINE(static int VisitJSObject(Map* map, HeapObject* object)) { | 332 INLINE(static int VisitJSObject(Map* map, HeapObject* object)) { |
325 return JSObjectVisitor::Visit(map, object); | 333 return JSObjectVisitor::Visit(map, object); |
326 } | 334 } |
327 | 335 |
328 INLINE(static int VisitSeqOneByteString(Map* map, HeapObject* object)) { | 336 INLINE(static int VisitSeqOneByteString(Map* map, HeapObject* object)) { |
329 return SeqOneByteString::cast(object)-> | 337 return SeqOneByteString::cast(object)-> |
330 SeqOneByteStringSize(map->instance_type()); | 338 SeqOneByteStringSize(map->instance_type()); |
331 } | 339 } |
332 | 340 |
333 INLINE(static int VisitSeqTwoByteString(Map* map, HeapObject* object)) { | 341 INLINE(static int VisitSeqTwoByteString(Map* map, HeapObject* object)) { |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 | 476 |
469 | 477 |
470 template<typename StaticVisitor> | 478 template<typename StaticVisitor> |
471 VisitorDispatchTable<typename StaticMarkingVisitor<StaticVisitor>::Callback> | 479 VisitorDispatchTable<typename StaticMarkingVisitor<StaticVisitor>::Callback> |
472 StaticMarkingVisitor<StaticVisitor>::table_; | 480 StaticMarkingVisitor<StaticVisitor>::table_; |
473 | 481 |
474 | 482 |
475 } } // namespace v8::internal | 483 } } // namespace v8::internal |
476 | 484 |
477 #endif // V8_OBJECTS_VISITING_H_ | 485 #endif // V8_OBJECTS_VISITING_H_ |
OLD | NEW |