| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 static inline int VisitSeqAsciiString(Map* map, HeapObject* object) { | 288 static inline int VisitSeqAsciiString(Map* map, HeapObject* object) { |
| 289 return SeqAsciiString::cast(object)-> | 289 return SeqAsciiString::cast(object)-> |
| 290 SeqAsciiStringSize(map->instance_type()); | 290 SeqAsciiStringSize(map->instance_type()); |
| 291 } | 291 } |
| 292 | 292 |
| 293 static inline int VisitSeqTwoByteString(Map* map, HeapObject* object) { | 293 static inline int VisitSeqTwoByteString(Map* map, HeapObject* object) { |
| 294 return SeqTwoByteString::cast(object)-> | 294 return SeqTwoByteString::cast(object)-> |
| 295 SeqTwoByteStringSize(map->instance_type()); | 295 SeqTwoByteStringSize(map->instance_type()); |
| 296 } | 296 } |
| 297 | 297 |
| 298 static inline int VisitFreeSpace(Map* map, HeapObject* object) { |
| 299 return FreeSpace::cast(object)->Size(); |
| 300 } |
| 301 |
| 298 class DataObjectVisitor { | 302 class DataObjectVisitor { |
| 299 public: | 303 public: |
| 300 template<int object_size> | 304 template<int object_size> |
| 301 static inline int VisitSpecialized(Map* map, HeapObject* object) { | 305 static inline int VisitSpecialized(Map* map, HeapObject* object) { |
| 302 return object_size; | 306 return object_size; |
| 303 } | 307 } |
| 304 | 308 |
| 305 static inline int Visit(Map* map, HeapObject* object) { | 309 static inline int Visit(Map* map, HeapObject* object) { |
| 306 return map->instance_size(); | 310 return map->instance_size(); |
| 307 } | 311 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 322 | 326 |
| 323 | 327 |
| 324 template<typename StaticVisitor> | 328 template<typename StaticVisitor> |
| 325 VisitorDispatchTable<typename StaticNewSpaceVisitor<StaticVisitor>::Callback> | 329 VisitorDispatchTable<typename StaticNewSpaceVisitor<StaticVisitor>::Callback> |
| 326 StaticNewSpaceVisitor<StaticVisitor>::table_; | 330 StaticNewSpaceVisitor<StaticVisitor>::table_; |
| 327 | 331 |
| 328 | 332 |
| 329 } } // namespace v8::internal | 333 } } // namespace v8::internal |
| 330 | 334 |
| 331 #endif // V8_OBJECTS_VISITING_H_ | 335 #endif // V8_OBJECTS_VISITING_H_ |
| OLD | NEW |