| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // void dispose(); | 109 // void dispose(); |
| 110 // Member<Bar> m_bar; | 110 // Member<Bar> m_bar; |
| 111 // }; | 111 // }; |
| 112 // | 112 // |
| 113 // void Foo::dispose() | 113 // void Foo::dispose() |
| 114 // { | 114 // { |
| 115 // m_bar->... | 115 // m_bar->... |
| 116 // } | 116 // } |
| 117 #define USING_PRE_FINALIZER(Class, method) \ | 117 #define USING_PRE_FINALIZER(Class, method) \ |
| 118 public: \ | 118 public: \ |
| 119 static bool invokePreFinalizer(void* object, Visitor& visitor) \ | 119 static bool invokePreFinalizer(void* object) \ |
| 120 { \ | 120 { \ |
| 121 Class* self = reinterpret_cast<Class*>(object); \ | 121 Class* self = reinterpret_cast<Class*>(object); \ |
| 122 if (visitor.isHeapObjectAlive(self)) \ | 122 if (Heap::isHeapObjectAlive(self)) \ |
| 123 return false; \ | 123 return false; \ |
| 124 self->method(); \ | 124 self->method(); \ |
| 125 return true; \ | 125 return true; \ |
| 126 } \ | 126 } \ |
| 127 using UsingPreFinazlizerMacroNeedsTrailingSemiColon = char | 127 using UsingPreFinazlizerMacroNeedsTrailingSemiColon = char |
| 128 | 128 |
| 129 #if ENABLE(OILPAN) | 129 #if ENABLE(OILPAN) |
| 130 #define WILL_BE_USING_PRE_FINALIZER(Class, method) USING_PRE_FINALIZER(Class, me
thod) | 130 #define WILL_BE_USING_PRE_FINALIZER(Class, method) USING_PRE_FINALIZER(Class, me
thod) |
| 131 #else | 131 #else |
| 132 #define WILL_BE_USING_PRE_FINALIZER(Class, method) | 132 #define WILL_BE_USING_PRE_FINALIZER(Class, method) |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 // heap is expected to be empty (because it is going away). | 669 // heap is expected to be empty (because it is going away). |
| 670 // Perform registered cleanup tasks and garbage collection | 670 // Perform registered cleanup tasks and garbage collection |
| 671 // to sweep away any objects that are left on this heap. | 671 // to sweep away any objects that are left on this heap. |
| 672 // We assert that nothing must remain after this cleanup. | 672 // We assert that nothing must remain after this cleanup. |
| 673 // If assertion does not hold we crash as we are potentially | 673 // If assertion does not hold we crash as we are potentially |
| 674 // in the dangling pointer situation. | 674 // in the dangling pointer situation. |
| 675 void cleanup(); | 675 void cleanup(); |
| 676 void cleanupPages(); | 676 void cleanupPages(); |
| 677 | 677 |
| 678 void unregisterPreFinalizerInternal(void*); | 678 void unregisterPreFinalizerInternal(void*); |
| 679 void invokePreFinalizers(Visitor&); | 679 void invokePreFinalizers(); |
| 680 | 680 |
| 681 #if ENABLE(GC_PROFILING) | 681 #if ENABLE(GC_PROFILING) |
| 682 void snapshotFreeList(); | 682 void snapshotFreeList(); |
| 683 #endif | 683 #endif |
| 684 void clearHeapAges(); | 684 void clearHeapAges(); |
| 685 int heapIndexOfVectorHeapLeastRecentlyExpanded(int beginHeapIndex, int endHe
apIndex); | 685 int heapIndexOfVectorHeapLeastRecentlyExpanded(int beginHeapIndex, int endHe
apIndex); |
| 686 | 686 |
| 687 friend class SafePointAwareMutexLocker; | 687 friend class SafePointAwareMutexLocker; |
| 688 friend class SafePointBarrier; | 688 friend class SafePointBarrier; |
| 689 friend class SafePointScope; | 689 friend class SafePointScope; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 720 size_t m_heapAges[NumberOfHeaps]; | 720 size_t m_heapAges[NumberOfHeaps]; |
| 721 size_t m_currentHeapAges; | 721 size_t m_currentHeapAges; |
| 722 | 722 |
| 723 bool m_isTerminating; | 723 bool m_isTerminating; |
| 724 GarbageCollectedMixinConstructorMarker* m_gcMixinMarker; | 724 GarbageCollectedMixinConstructorMarker* m_gcMixinMarker; |
| 725 | 725 |
| 726 bool m_shouldFlushHeapDoesNotContainCache; | 726 bool m_shouldFlushHeapDoesNotContainCache; |
| 727 GCState m_gcState; | 727 GCState m_gcState; |
| 728 | 728 |
| 729 CallbackStack* m_threadLocalWeakCallbackStack; | 729 CallbackStack* m_threadLocalWeakCallbackStack; |
| 730 HashMap<void*, bool (*)(void*, Visitor&)> m_preFinalizers; | 730 HashMap<void*, bool (*)(void*)> m_preFinalizers; |
| 731 | 731 |
| 732 v8::Isolate* m_isolate; | 732 v8::Isolate* m_isolate; |
| 733 void (*m_traceDOMWrappers)(v8::Isolate*, Visitor*); | 733 void (*m_traceDOMWrappers)(v8::Isolate*, Visitor*); |
| 734 | 734 |
| 735 #if defined(ADDRESS_SANITIZER) | 735 #if defined(ADDRESS_SANITIZER) |
| 736 void* m_asanFakeStack; | 736 void* m_asanFakeStack; |
| 737 #endif | 737 #endif |
| 738 | 738 |
| 739 Vector<PageMemoryRegion*> m_allocatedRegionsSinceLastGC; | 739 Vector<PageMemoryRegion*> m_allocatedRegionsSinceLastGC; |
| 740 | 740 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 763 }; | 763 }; |
| 764 | 764 |
| 765 template<> class ThreadStateFor<AnyThread> { | 765 template<> class ThreadStateFor<AnyThread> { |
| 766 public: | 766 public: |
| 767 static ThreadState* state() { return ThreadState::current(); } | 767 static ThreadState* state() { return ThreadState::current(); } |
| 768 }; | 768 }; |
| 769 | 769 |
| 770 } // namespace blink | 770 } // namespace blink |
| 771 | 771 |
| 772 #endif // ThreadState_h | 772 #endif // ThreadState_h |
| OLD | NEW |