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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 m_state->heap().resume(); | 138 m_state->heap().resume(); |
139 } | 139 } |
140 | 140 |
141 private: | 141 private: |
142 ThreadState* m_state; | 142 ThreadState* m_state; |
143 bool m_shouldResumeThreads; | 143 bool m_shouldResumeThreads; |
144 }; | 144 }; |
145 | 145 |
146 ThreadState::ThreadState(BlinkGC::ThreadHeapMode threadHeapMode) | 146 ThreadState::ThreadState(BlinkGC::ThreadHeapMode threadHeapMode) |
147 : m_thread(currentThread()), | 147 : m_thread(currentThread()), |
148 m_persistentRegion(wrapUnique(new PersistentRegion())) | 148 m_persistentRegion(wrapUnique(new PersistentRegion())), |
149 #if OS(WIN) && COMPILER(MSVC) | 149 #if OS(WIN) && COMPILER(MSVC) |
150 , | 150 m_threadStackSize(0), |
151 m_threadStackSize(0) | |
152 #endif | 151 #endif |
153 , | |
154 m_startOfStack( | 152 m_startOfStack( |
155 reinterpret_cast<intptr_t*>(StackFrameDepth::getStackStart())), | 153 reinterpret_cast<intptr_t*>(StackFrameDepth::getStackStart())), |
156 m_endOfStack( | 154 m_endOfStack( |
157 reinterpret_cast<intptr_t*>(StackFrameDepth::getStackStart())), | 155 reinterpret_cast<intptr_t*>(StackFrameDepth::getStackStart())), |
158 m_safePointScopeMarker(nullptr), | 156 m_safePointScopeMarker(nullptr), |
159 m_atSafePoint(false), | 157 m_atSafePoint(false), |
160 m_interruptors(), | 158 m_interruptors(), |
161 m_sweepForbidden(false), | 159 m_sweepForbidden(false), |
162 m_noAllocationCount(0), | 160 m_noAllocationCount(0), |
163 m_gcForbiddenCount(0), | 161 m_gcForbiddenCount(0), |
164 m_accumulatedSweepingTime(0), | 162 m_accumulatedSweepingTime(0), |
165 m_vectorBackingArenaIndex(BlinkGC::Vector1ArenaIndex), | 163 m_vectorBackingArenaIndex(BlinkGC::Vector1ArenaIndex), |
166 m_currentArenaAges(0), | 164 m_currentArenaAges(0), |
167 m_threadHeapMode(threadHeapMode), | 165 m_threadHeapMode(threadHeapMode), |
168 m_isTerminating(false), | 166 m_isTerminating(false), |
169 m_gcMixinMarker(nullptr), | 167 m_gcMixinMarker(nullptr), |
170 m_shouldFlushHeapDoesNotContainCache(false), | 168 m_shouldFlushHeapDoesNotContainCache(false), |
171 m_gcState(NoGCScheduled), | 169 m_gcState(NoGCScheduled), |
172 m_threadLocalWeakCallbackStack(CallbackStack::create()), | 170 m_threadLocalWeakCallbackStack(CallbackStack::create()), |
173 m_isolate(nullptr), | 171 m_isolate(nullptr), |
174 m_traceDOMWrappers(nullptr), | 172 m_traceDOMWrappers(nullptr), |
175 m_invalidateDeadObjectsInWrappersMarkingDeque(nullptr) | 173 m_invalidateDeadObjectsInWrappersMarkingDeque(nullptr), |
176 #if defined(ADDRESS_SANITIZER) | 174 #if defined(ADDRESS_SANITIZER) |
177 , | 175 m_asanFakeStack(__asan_get_current_fake_stack()), |
178 m_asanFakeStack(__asan_get_current_fake_stack()) | |
179 #endif | 176 #endif |
180 #if defined(LEAK_SANITIZER) | 177 #if defined(LEAK_SANITIZER) |
181 , | 178 m_disabledStaticPersistentsRegistration(0), |
182 m_disabledStaticPersistentsRegistration(0) | |
183 #endif | 179 #endif |
184 , | |
185 m_allocatedObjectSize(0), | 180 m_allocatedObjectSize(0), |
186 m_markedObjectSize(0), | 181 m_markedObjectSize(0), |
187 m_reportedMemoryToV8(0) { | 182 m_reportedMemoryToV8(0) { |
188 ASSERT(checkThread()); | 183 ASSERT(checkThread()); |
189 ASSERT(!**s_threadSpecific); | 184 ASSERT(!**s_threadSpecific); |
190 **s_threadSpecific = this; | 185 **s_threadSpecific = this; |
191 | 186 |
192 switch (m_threadHeapMode) { | 187 switch (m_threadHeapMode) { |
193 case BlinkGC::MainThreadHeapMode: | 188 case BlinkGC::MainThreadHeapMode: |
194 if (isMainThread()) { | 189 if (isMainThread()) { |
(...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1823 collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, | 1818 collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, |
1824 BlinkGC::ForcedGC); | 1819 BlinkGC::ForcedGC); |
1825 size_t liveObjects = heap().heapStats().markedObjectSize(); | 1820 size_t liveObjects = heap().heapStats().markedObjectSize(); |
1826 if (liveObjects == previousLiveObjects) | 1821 if (liveObjects == previousLiveObjects) |
1827 break; | 1822 break; |
1828 previousLiveObjects = liveObjects; | 1823 previousLiveObjects = liveObjects; |
1829 } | 1824 } |
1830 } | 1825 } |
1831 | 1826 |
1832 } // namespace blink | 1827 } // namespace blink |
OLD | NEW |