| 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 29 matching lines...) Expand all Loading... |
| 40 // field which contains an index of specialized visitor to use. | 40 // field which contains an index of specialized visitor to use. |
| 41 | 41 |
| 42 namespace v8 { | 42 namespace v8 { |
| 43 namespace internal { | 43 namespace internal { |
| 44 | 44 |
| 45 | 45 |
| 46 // Base class for all static visitors. | 46 // Base class for all static visitors. |
| 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(SeqAsciiString) \ | 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(NativeContext) \ | 57 V(NativeContext) \ |
| 58 V(DataObject2) \ | 58 V(DataObject2) \ |
| 59 V(DataObject3) \ | 59 V(DataObject3) \ |
| 60 V(DataObject4) \ | 60 V(DataObject4) \ |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 | 311 |
| 312 static inline int VisitFixedDoubleArray(Map* map, HeapObject* object) { | 312 static inline int VisitFixedDoubleArray(Map* map, HeapObject* object) { |
| 313 int length = reinterpret_cast<FixedDoubleArray*>(object)->length(); | 313 int length = reinterpret_cast<FixedDoubleArray*>(object)->length(); |
| 314 return FixedDoubleArray::SizeFor(length); | 314 return FixedDoubleArray::SizeFor(length); |
| 315 } | 315 } |
| 316 | 316 |
| 317 static inline int VisitJSObject(Map* map, HeapObject* object) { | 317 static inline int VisitJSObject(Map* map, HeapObject* object) { |
| 318 return JSObjectVisitor::Visit(map, object); | 318 return JSObjectVisitor::Visit(map, object); |
| 319 } | 319 } |
| 320 | 320 |
| 321 static inline int VisitSeqAsciiString(Map* map, HeapObject* object) { | 321 static inline int VisitSeqOneByteString(Map* map, HeapObject* object) { |
| 322 return SeqAsciiString::cast(object)-> | 322 return SeqOneByteString::cast(object)-> |
| 323 SeqAsciiStringSize(map->instance_type()); | 323 SeqOneByteStringSize(map->instance_type()); |
| 324 } | 324 } |
| 325 | 325 |
| 326 static inline int VisitSeqTwoByteString(Map* map, HeapObject* object) { | 326 static inline int VisitSeqTwoByteString(Map* map, HeapObject* object) { |
| 327 return SeqTwoByteString::cast(object)-> | 327 return SeqTwoByteString::cast(object)-> |
| 328 SeqTwoByteStringSize(map->instance_type()); | 328 SeqTwoByteStringSize(map->instance_type()); |
| 329 } | 329 } |
| 330 | 330 |
| 331 static inline int VisitFreeSpace(Map* map, HeapObject* object) { | 331 static inline int VisitFreeSpace(Map* map, HeapObject* object) { |
| 332 return FreeSpace::cast(object)->Size(); | 332 return FreeSpace::cast(object)->Size(); |
| 333 } | 333 } |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 449 |
| 450 | 450 |
| 451 template<typename StaticVisitor> | 451 template<typename StaticVisitor> |
| 452 VisitorDispatchTable<typename StaticMarkingVisitor<StaticVisitor>::Callback> | 452 VisitorDispatchTable<typename StaticMarkingVisitor<StaticVisitor>::Callback> |
| 453 StaticMarkingVisitor<StaticVisitor>::table_; | 453 StaticMarkingVisitor<StaticVisitor>::table_; |
| 454 | 454 |
| 455 | 455 |
| 456 } } // namespace v8::internal | 456 } } // namespace v8::internal |
| 457 | 457 |
| 458 #endif // V8_OBJECTS_VISITING_H_ | 458 #endif // V8_OBJECTS_VISITING_H_ |
| OLD | NEW |