| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 kVisitStruct9, | 99 kVisitStruct9, |
| 100 kVisitStructGeneric, | 100 kVisitStructGeneric, |
| 101 | 101 |
| 102 kVisitConsString, | 102 kVisitConsString, |
| 103 kVisitOddball, | 103 kVisitOddball, |
| 104 kVisitCode, | 104 kVisitCode, |
| 105 kVisitMap, | 105 kVisitMap, |
| 106 kVisitPropertyCell, | 106 kVisitPropertyCell, |
| 107 kVisitSharedFunctionInfo, | 107 kVisitSharedFunctionInfo, |
| 108 kVisitJSFunction, | 108 kVisitJSFunction, |
| 109 kVisitJSWeakMap, |
| 109 kVisitJSRegExp, | 110 kVisitJSRegExp, |
| 110 | 111 |
| 111 kVisitorIdCount, | 112 kVisitorIdCount, |
| 112 kMinObjectSizeInWords = 2 | 113 kMinObjectSizeInWords = 2 |
| 113 }; | 114 }; |
| 114 | 115 |
| 115 // Visitor ID should fit in one byte. | 116 // Visitor ID should fit in one byte. |
| 116 STATIC_ASSERT(kVisitorIdCount <= 256); | 117 STATIC_ASSERT(kVisitorIdCount <= 256); |
| 117 | 118 |
| 118 // Determine which specialized visitor should be used for given instance type | 119 // Determine which specialized visitor should be used for given instance type |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 private: | 286 private: |
| 286 static inline int VisitByteArray(Map* map, HeapObject* object) { | 287 static inline int VisitByteArray(Map* map, HeapObject* object) { |
| 287 return reinterpret_cast<ByteArray*>(object)->ByteArraySize(); | 288 return reinterpret_cast<ByteArray*>(object)->ByteArraySize(); |
| 288 } | 289 } |
| 289 | 290 |
| 290 static inline int VisitFixedDoubleArray(Map* map, HeapObject* object) { | 291 static inline int VisitFixedDoubleArray(Map* map, HeapObject* object) { |
| 291 int length = reinterpret_cast<FixedDoubleArray*>(object)->length(); | 292 int length = reinterpret_cast<FixedDoubleArray*>(object)->length(); |
| 292 return FixedDoubleArray::SizeFor(length); | 293 return FixedDoubleArray::SizeFor(length); |
| 293 } | 294 } |
| 294 | 295 |
| 296 static inline int VisitJSObject(Map* map, HeapObject* object) { |
| 297 return JSObjectVisitor::Visit(map, object); |
| 298 } |
| 299 |
| 295 static inline int VisitSeqAsciiString(Map* map, HeapObject* object) { | 300 static inline int VisitSeqAsciiString(Map* map, HeapObject* object) { |
| 296 return SeqAsciiString::cast(object)-> | 301 return SeqAsciiString::cast(object)-> |
| 297 SeqAsciiStringSize(map->instance_type()); | 302 SeqAsciiStringSize(map->instance_type()); |
| 298 } | 303 } |
| 299 | 304 |
| 300 static inline int VisitJSRegExp(Map* map, HeapObject* object) { | |
| 301 return JSObjectVisitor::Visit(map, object); | |
| 302 } | |
| 303 | |
| 304 static inline int VisitSeqTwoByteString(Map* map, HeapObject* object) { | 305 static inline int VisitSeqTwoByteString(Map* map, HeapObject* object) { |
| 305 return SeqTwoByteString::cast(object)-> | 306 return SeqTwoByteString::cast(object)-> |
| 306 SeqTwoByteStringSize(map->instance_type()); | 307 SeqTwoByteStringSize(map->instance_type()); |
| 307 } | 308 } |
| 308 | 309 |
| 309 static inline int VisitFreeSpace(Map* map, HeapObject* object) { | 310 static inline int VisitFreeSpace(Map* map, HeapObject* object) { |
| 310 return FreeSpace::cast(object)->Size(); | 311 return FreeSpace::cast(object)->Size(); |
| 311 } | 312 } |
| 312 | 313 |
| 313 class DataObjectVisitor { | 314 class DataObjectVisitor { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 337 | 338 |
| 338 | 339 |
| 339 template<typename StaticVisitor> | 340 template<typename StaticVisitor> |
| 340 VisitorDispatchTable<typename StaticNewSpaceVisitor<StaticVisitor>::Callback> | 341 VisitorDispatchTable<typename StaticNewSpaceVisitor<StaticVisitor>::Callback> |
| 341 StaticNewSpaceVisitor<StaticVisitor>::table_; | 342 StaticNewSpaceVisitor<StaticVisitor>::table_; |
| 342 | 343 |
| 343 | 344 |
| 344 } } // namespace v8::internal | 345 } } // namespace v8::internal |
| 345 | 346 |
| 346 #endif // V8_OBJECTS_VISITING_H_ | 347 #endif // V8_OBJECTS_VISITING_H_ |
| OLD | NEW |