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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 (base == kVisitJSObject)); | 144 (base == kVisitJSObject)); |
145 ASSERT(IsAligned(object_size, kPointerSize)); | 145 ASSERT(IsAligned(object_size, kPointerSize)); |
146 ASSERT(kMinObjectSizeInWords * kPointerSize <= object_size); | 146 ASSERT(kMinObjectSizeInWords * kPointerSize <= object_size); |
147 ASSERT(object_size <= Page::kMaxRegularHeapObjectSize); | 147 ASSERT(object_size <= Page::kMaxRegularHeapObjectSize); |
148 | 148 |
149 const VisitorId specialization = static_cast<VisitorId>( | 149 const VisitorId specialization = static_cast<VisitorId>( |
150 base + (object_size >> kPointerSizeLog2) - kMinObjectSizeInWords); | 150 base + (object_size >> kPointerSizeLog2) - kMinObjectSizeInWords); |
151 | 151 |
152 return Min(specialization, generic); | 152 return Min(specialization, generic); |
153 } | 153 } |
| 154 |
| 155 static WeakPointerMode weak_pointer_mode() { |
| 156 return VISIT_WEAK_POINTERS; |
| 157 } |
154 }; | 158 }; |
155 | 159 |
156 | 160 |
157 template<typename Callback> | 161 template<typename Callback> |
158 class VisitorDispatchTable { | 162 class VisitorDispatchTable { |
159 public: | 163 public: |
160 void CopyFrom(VisitorDispatchTable* other) { | 164 void CopyFrom(VisitorDispatchTable* other) { |
161 // We are not using memcpy to guarantee that during update | 165 // We are not using memcpy to guarantee that during update |
162 // every element of callbacks_ array will remain correct | 166 // every element of callbacks_ array will remain correct |
163 // pointer (memcpy might be implemented as a byte copying loop). | 167 // pointer (memcpy might be implemented as a byte copying loop). |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 INLINE(static void VisitCodeTarget(Heap* heap, RelocInfo* rinfo)); | 417 INLINE(static void VisitCodeTarget(Heap* heap, RelocInfo* rinfo)); |
414 INLINE(static void VisitCodeAgeSequence(Heap* heap, RelocInfo* rinfo)); | 418 INLINE(static void VisitCodeAgeSequence(Heap* heap, RelocInfo* rinfo)); |
415 INLINE(static void VisitExternalReference(RelocInfo* rinfo)) { } | 419 INLINE(static void VisitExternalReference(RelocInfo* rinfo)) { } |
416 INLINE(static void VisitRuntimeEntry(RelocInfo* rinfo)) { } | 420 INLINE(static void VisitRuntimeEntry(RelocInfo* rinfo)) { } |
417 | 421 |
418 // TODO(mstarzinger): This should be made protected once refactoring is done. | 422 // TODO(mstarzinger): This should be made protected once refactoring is done. |
419 // Mark non-optimize code for functions inlined into the given optimized | 423 // Mark non-optimize code for functions inlined into the given optimized |
420 // code. This will prevent it from being flushed. | 424 // code. This will prevent it from being flushed. |
421 static void MarkInlinedFunctionsCode(Heap* heap, Code* code); | 425 static void MarkInlinedFunctionsCode(Heap* heap, Code* code); |
422 | 426 |
| 427 static WeakPointerMode weak_pointer_mode() { |
| 428 return SKIP_WEAK_POINTERS; |
| 429 } |
| 430 |
423 protected: | 431 protected: |
424 INLINE(static void VisitMap(Map* map, HeapObject* object)); | 432 INLINE(static void VisitMap(Map* map, HeapObject* object)); |
425 INLINE(static void VisitCode(Map* map, HeapObject* object)); | 433 INLINE(static void VisitCode(Map* map, HeapObject* object)); |
426 INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object)); | 434 INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object)); |
427 INLINE(static void VisitConstantPoolArray(Map* map, HeapObject* object)); | 435 INLINE(static void VisitConstantPoolArray(Map* map, HeapObject* object)); |
428 INLINE(static void VisitJSFunction(Map* map, HeapObject* object)); | 436 INLINE(static void VisitJSFunction(Map* map, HeapObject* object)); |
429 INLINE(static void VisitJSRegExp(Map* map, HeapObject* object)); | 437 INLINE(static void VisitJSRegExp(Map* map, HeapObject* object)); |
430 INLINE(static void VisitJSArrayBuffer(Map* map, HeapObject* object)); | 438 INLINE(static void VisitJSArrayBuffer(Map* map, HeapObject* object)); |
431 INLINE(static void VisitJSTypedArray(Map* map, HeapObject* object)); | 439 INLINE(static void VisitJSTypedArray(Map* map, HeapObject* object)); |
432 INLINE(static void VisitJSDataView(Map* map, HeapObject* object)); | 440 INLINE(static void VisitJSDataView(Map* map, HeapObject* object)); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 | 485 |
478 | 486 |
479 template<typename StaticVisitor> | 487 template<typename StaticVisitor> |
480 VisitorDispatchTable<typename StaticMarkingVisitor<StaticVisitor>::Callback> | 488 VisitorDispatchTable<typename StaticMarkingVisitor<StaticVisitor>::Callback> |
481 StaticMarkingVisitor<StaticVisitor>::table_; | 489 StaticMarkingVisitor<StaticVisitor>::table_; |
482 | 490 |
483 | 491 |
484 } } // namespace v8::internal | 492 } } // namespace v8::internal |
485 | 493 |
486 #endif // V8_OBJECTS_VISITING_H_ | 494 #endif // V8_OBJECTS_VISITING_H_ |
OLD | NEW |