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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 } | 98 } |
99 return "<Unknown>"; | 99 return "<Unknown>"; |
100 } | 100 } |
101 | 101 |
102 ThreadState::ThreadState() | 102 ThreadState::ThreadState() |
103 : m_thread(currentThread()), | 103 : m_thread(currentThread()), |
104 m_persistentRegion(WTF::makeUnique<PersistentRegion>()), | 104 m_persistentRegion(WTF::makeUnique<PersistentRegion>()), |
105 m_startOfStack(reinterpret_cast<intptr_t*>(WTF::getStackStart())), | 105 m_startOfStack(reinterpret_cast<intptr_t*>(WTF::getStackStart())), |
106 m_endOfStack(reinterpret_cast<intptr_t*>(WTF::getStackStart())), | 106 m_endOfStack(reinterpret_cast<intptr_t*>(WTF::getStackStart())), |
107 m_safePointScopeMarker(nullptr), | 107 m_safePointScopeMarker(nullptr), |
108 m_interruptors(), | |
109 m_sweepForbidden(false), | 108 m_sweepForbidden(false), |
110 m_noAllocationCount(0), | 109 m_noAllocationCount(0), |
111 m_gcForbiddenCount(0), | 110 m_gcForbiddenCount(0), |
112 m_mixinsBeingConstructedCount(0), | 111 m_mixinsBeingConstructedCount(0), |
113 m_accumulatedSweepingTime(0), | 112 m_accumulatedSweepingTime(0), |
114 m_vectorBackingArenaIndex(BlinkGC::Vector1ArenaIndex), | 113 m_vectorBackingArenaIndex(BlinkGC::Vector1ArenaIndex), |
115 m_currentArenaAges(0), | 114 m_currentArenaAges(0), |
116 m_gcMixinMarker(nullptr), | 115 m_gcMixinMarker(nullptr), |
117 m_shouldFlushHeapDoesNotContainCache(false), | 116 m_shouldFlushHeapDoesNotContainCache(false), |
118 m_gcState(NoGCScheduled), | 117 m_gcState(NoGCScheduled), |
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1196 ASSERT(slotCount < 1024); | 1195 ASSERT(slotCount < 1024); |
1197 #endif | 1196 #endif |
1198 | 1197 |
1199 ASSERT(!m_safePointStackCopy.size()); | 1198 ASSERT(!m_safePointStackCopy.size()); |
1200 m_safePointStackCopy.resize(slotCount); | 1199 m_safePointStackCopy.resize(slotCount); |
1201 for (size_t i = 0; i < slotCount; ++i) { | 1200 for (size_t i = 0; i < slotCount; ++i) { |
1202 m_safePointStackCopy[i] = from[i]; | 1201 m_safePointStackCopy[i] = from[i]; |
1203 } | 1202 } |
1204 } | 1203 } |
1205 | 1204 |
1206 void ThreadState::addInterruptor( | |
1207 std::unique_ptr<BlinkGCInterruptor> interruptor) { | |
1208 ASSERT(checkThread()); | |
1209 SafePointScope scope(BlinkGC::HeapPointersOnStack); | |
1210 { | |
1211 MutexLocker locker(m_heap->threadAttachMutex()); | |
1212 m_interruptors.push_back(std::move(interruptor)); | |
1213 } | |
1214 } | |
1215 | |
1216 void ThreadState::registerStaticPersistentNode( | 1205 void ThreadState::registerStaticPersistentNode( |
1217 PersistentNode* node, | 1206 PersistentNode* node, |
1218 PersistentClearCallback callback) { | 1207 PersistentClearCallback callback) { |
1219 #if defined(LEAK_SANITIZER) | 1208 #if defined(LEAK_SANITIZER) |
1220 if (m_disabledStaticPersistentsRegistration) | 1209 if (m_disabledStaticPersistentsRegistration) |
1221 return; | 1210 return; |
1222 #endif | 1211 #endif |
1223 | 1212 |
1224 ASSERT(!m_staticPersistents.contains(node)); | 1213 ASSERT(!m_staticPersistents.contains(node)); |
1225 m_staticPersistents.insert(node, callback); | 1214 m_staticPersistents.insert(node, callback); |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1557 collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, | 1546 collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, |
1558 BlinkGC::ForcedGC); | 1547 BlinkGC::ForcedGC); |
1559 size_t liveObjects = heap().heapStats().markedObjectSize(); | 1548 size_t liveObjects = heap().heapStats().markedObjectSize(); |
1560 if (liveObjects == previousLiveObjects) | 1549 if (liveObjects == previousLiveObjects) |
1561 break; | 1550 break; |
1562 previousLiveObjects = liveObjects; | 1551 previousLiveObjects = liveObjects; |
1563 } | 1552 } |
1564 } | 1553 } |
1565 | 1554 |
1566 } // namespace blink | 1555 } // namespace blink |
OLD | NEW |