Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: Source/platform/heap/ThreadState.h

Issue 1166623002: Oilpan: Remove a visitor parameter from isHeapObjectAlive (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 // heap is expected to be empty (because it is going away). 650 // heap is expected to be empty (because it is going away).
651 // Perform registered cleanup tasks and garbage collection 651 // Perform registered cleanup tasks and garbage collection
652 // to sweep away any objects that are left on this heap. 652 // to sweep away any objects that are left on this heap.
653 // We assert that nothing must remain after this cleanup. 653 // We assert that nothing must remain after this cleanup.
654 // If assertion does not hold we crash as we are potentially 654 // If assertion does not hold we crash as we are potentially
655 // in the dangling pointer situation. 655 // in the dangling pointer situation.
656 void cleanup(); 656 void cleanup();
657 void cleanupPages(); 657 void cleanupPages();
658 658
659 void unregisterPreFinalizerInternal(void*); 659 void unregisterPreFinalizerInternal(void*);
660 void invokePreFinalizers(Visitor&); 660 void invokePreFinalizers();
661 661
662 #if ENABLE(GC_PROFILING) 662 #if ENABLE(GC_PROFILING)
663 void snapshotFreeList(); 663 void snapshotFreeList();
664 #endif 664 #endif
665 void clearHeapAges(); 665 void clearHeapAges();
666 int heapIndexOfVectorHeapLeastRecentlyExpanded(int beginHeapIndex, int endHe apIndex); 666 int heapIndexOfVectorHeapLeastRecentlyExpanded(int beginHeapIndex, int endHe apIndex);
667 667
668 friend class SafePointAwareMutexLocker; 668 friend class SafePointAwareMutexLocker;
669 friend class SafePointBarrier; 669 friend class SafePointBarrier;
670 friend class SafePointScope; 670 friend class SafePointScope;
(...skipping 30 matching lines...) Expand all
701 size_t m_heapAges[NumberOfHeaps]; 701 size_t m_heapAges[NumberOfHeaps];
702 size_t m_currentHeapAges; 702 size_t m_currentHeapAges;
703 703
704 bool m_isTerminating; 704 bool m_isTerminating;
705 GarbageCollectedMixinConstructorMarker* m_gcMixinMarker; 705 GarbageCollectedMixinConstructorMarker* m_gcMixinMarker;
706 706
707 bool m_shouldFlushHeapDoesNotContainCache; 707 bool m_shouldFlushHeapDoesNotContainCache;
708 GCState m_gcState; 708 GCState m_gcState;
709 709
710 CallbackStack* m_threadLocalWeakCallbackStack; 710 CallbackStack* m_threadLocalWeakCallbackStack;
711 HashMap<void*, bool (*)(void*, Visitor&)> m_preFinalizers; 711 HashMap<void*, bool (*)(void*)> m_preFinalizers;
712 712
713 v8::Isolate* m_isolate; 713 v8::Isolate* m_isolate;
714 void (*m_traceDOMWrappers)(v8::Isolate*, Visitor*); 714 void (*m_traceDOMWrappers)(v8::Isolate*, Visitor*);
715 715
716 #if defined(ADDRESS_SANITIZER) 716 #if defined(ADDRESS_SANITIZER)
717 void* m_asanFakeStack; 717 void* m_asanFakeStack;
718 #endif 718 #endif
719 719
720 Vector<PageMemoryRegion*> m_allocatedRegionsSinceLastGC; 720 Vector<PageMemoryRegion*> m_allocatedRegionsSinceLastGC;
721 721
(...skipping 22 matching lines...) Expand all
744 }; 744 };
745 745
746 template<> class ThreadStateFor<AnyThread> { 746 template<> class ThreadStateFor<AnyThread> {
747 public: 747 public:
748 static ThreadState* state() { return ThreadState::current(); } 748 static ThreadState* state() { return ThreadState::current(); }
749 }; 749 };
750 750
751 } // namespace blink 751 } // namespace blink
752 752
753 #endif // ThreadState_h 753 #endif // ThreadState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698