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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 \ | 110 \ |
111 private: \ | 111 private: \ |
112 ThreadState::PrefinalizerRegistration<Class> m_prefinalizerDummy = this; \ | 112 ThreadState::PrefinalizerRegistration<Class> m_prefinalizerDummy = this; \ |
113 using UsingPreFinalizerMacroNeedsTrailingSemiColon = char | 113 using UsingPreFinalizerMacroNeedsTrailingSemiColon = char |
114 | 114 |
115 class PLATFORM_EXPORT ThreadState { | 115 class PLATFORM_EXPORT ThreadState { |
116 USING_FAST_MALLOC(ThreadState); | 116 USING_FAST_MALLOC(ThreadState); |
117 WTF_MAKE_NONCOPYABLE(ThreadState); | 117 WTF_MAKE_NONCOPYABLE(ThreadState); |
118 | 118 |
119 public: | 119 public: |
120 typedef std::pair<void*, PreFinalizerCallback> PreFinalizer; | |
121 | |
122 // See setGCState() for possible state transitions. | 120 // See setGCState() for possible state transitions. |
123 enum GCState { | 121 enum GCState { |
124 NoGCScheduled, | 122 NoGCScheduled, |
125 IdleGCScheduled, | 123 IdleGCScheduled, |
126 PreciseGCScheduled, | 124 PreciseGCScheduled, |
127 FullGCScheduled, | 125 FullGCScheduled, |
128 PageNavigationGCScheduled, | 126 PageNavigationGCScheduled, |
129 GCRunning, | 127 GCRunning, |
130 EagerSweepScheduled, | 128 EagerSweepScheduled, |
131 LazySweepScheduled, | 129 LazySweepScheduled, |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 | 696 |
699 const BlinkGC::ThreadHeapMode m_threadHeapMode; | 697 const BlinkGC::ThreadHeapMode m_threadHeapMode; |
700 bool m_isTerminating; | 698 bool m_isTerminating; |
701 GarbageCollectedMixinConstructorMarker* m_gcMixinMarker; | 699 GarbageCollectedMixinConstructorMarker* m_gcMixinMarker; |
702 | 700 |
703 bool m_shouldFlushHeapDoesNotContainCache; | 701 bool m_shouldFlushHeapDoesNotContainCache; |
704 GCState m_gcState; | 702 GCState m_gcState; |
705 | 703 |
706 std::unique_ptr<CallbackStack> m_threadLocalWeakCallbackStack; | 704 std::unique_ptr<CallbackStack> m_threadLocalWeakCallbackStack; |
707 | 705 |
| 706 using PreFinalizerCallback = bool (*)(void*); |
| 707 using PreFinalizer = std::pair<void*, PreFinalizerCallback>; |
| 708 |
708 // Pre-finalizers are called in the reverse order in which they are | 709 // Pre-finalizers are called in the reverse order in which they are |
709 // registered by the constructors (including constructors of Mixin objects) | 710 // registered by the constructors (including constructors of Mixin objects) |
710 // for an object, by processing the m_orderedPreFinalizers back-to-front. | 711 // for an object, by processing the m_orderedPreFinalizers back-to-front. |
711 ListHashSet<PreFinalizer> m_orderedPreFinalizers; | 712 ListHashSet<PreFinalizer> m_orderedPreFinalizers; |
712 | 713 |
713 v8::Isolate* m_isolate; | 714 v8::Isolate* m_isolate; |
714 void (*m_traceDOMWrappers)(v8::Isolate*, Visitor*); | 715 void (*m_traceDOMWrappers)(v8::Isolate*, Visitor*); |
715 void (*m_invalidateDeadObjectsInWrappersMarkingDeque)(v8::Isolate*); | 716 void (*m_invalidateDeadObjectsInWrappersMarkingDeque)(v8::Isolate*); |
716 void (*m_performCleanup)(v8::Isolate*); | 717 void (*m_performCleanup)(v8::Isolate*); |
717 | 718 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 class ThreadStateFor<AnyThread> { | 765 class ThreadStateFor<AnyThread> { |
765 STATIC_ONLY(ThreadStateFor); | 766 STATIC_ONLY(ThreadStateFor); |
766 | 767 |
767 public: | 768 public: |
768 static ThreadState* state() { return ThreadState::current(); } | 769 static ThreadState* state() { return ThreadState::current(); } |
769 }; | 770 }; |
770 | 771 |
771 } // namespace blink | 772 } // namespace blink |
772 | 773 |
773 #endif // ThreadState_h | 774 #endif // ThreadState_h |
OLD | NEW |