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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 282 |
283 static inline int IterateBody(Map* map, HeapObject* obj) { | 283 static inline int IterateBody(Map* map, HeapObject* obj) { |
284 return table_.GetVisitor(map)(map, obj); | 284 return table_.GetVisitor(map)(map, obj); |
285 } | 285 } |
286 | 286 |
287 static inline void VisitPointers(Heap* heap, Object** start, Object** end) { | 287 static inline void VisitPointers(Heap* heap, Object** start, Object** end) { |
288 for (Object** p = start; p < end; p++) StaticVisitor::VisitPointer(heap, p); | 288 for (Object** p = start; p < end; p++) StaticVisitor::VisitPointer(heap, p); |
289 } | 289 } |
290 | 290 |
291 private: | 291 private: |
| 292 static inline int VisitJSFunction(Map* map, HeapObject* object) { |
| 293 Heap* heap = map->GetHeap(); |
| 294 VisitPointers(heap, |
| 295 HeapObject::RawField(object, JSFunction::kPropertiesOffset), |
| 296 HeapObject::RawField(object, JSFunction::kCodeEntryOffset)); |
| 297 |
| 298 // Don't visit code entry. We are using this visitor only during scavenges. |
| 299 |
| 300 VisitPointers( |
| 301 heap, |
| 302 HeapObject::RawField(object, |
| 303 JSFunction::kCodeEntryOffset + kPointerSize), |
| 304 HeapObject::RawField(object, |
| 305 JSFunction::kNonWeakFieldsEndOffset)); |
| 306 return JSFunction::kSize; |
| 307 } |
| 308 |
292 static inline int VisitByteArray(Map* map, HeapObject* object) { | 309 static inline int VisitByteArray(Map* map, HeapObject* object) { |
293 return reinterpret_cast<ByteArray*>(object)->ByteArraySize(); | 310 return reinterpret_cast<ByteArray*>(object)->ByteArraySize(); |
294 } | 311 } |
295 | 312 |
296 static inline int VisitFixedDoubleArray(Map* map, HeapObject* object) { | 313 static inline int VisitFixedDoubleArray(Map* map, HeapObject* object) { |
297 int length = reinterpret_cast<FixedDoubleArray*>(object)->length(); | 314 int length = reinterpret_cast<FixedDoubleArray*>(object)->length(); |
298 return FixedDoubleArray::SizeFor(length); | 315 return FixedDoubleArray::SizeFor(length); |
299 } | 316 } |
300 | 317 |
301 static inline int VisitJSObject(Map* map, HeapObject* object) { | 318 static inline int VisitJSObject(Map* map, HeapObject* object) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 | 360 |
344 | 361 |
345 template<typename StaticVisitor> | 362 template<typename StaticVisitor> |
346 VisitorDispatchTable<typename StaticNewSpaceVisitor<StaticVisitor>::Callback> | 363 VisitorDispatchTable<typename StaticNewSpaceVisitor<StaticVisitor>::Callback> |
347 StaticNewSpaceVisitor<StaticVisitor>::table_; | 364 StaticNewSpaceVisitor<StaticVisitor>::table_; |
348 | 365 |
349 | 366 |
350 } } // namespace v8::internal | 367 } } // namespace v8::internal |
351 | 368 |
352 #endif // V8_OBJECTS_VISITING_H_ | 369 #endif // V8_OBJECTS_VISITING_H_ |
OLD | NEW |