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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 SafePointAwareMutexLocker locker(m_threadAttachMutex, BlinkGC::NoHeapPoi
ntersOnStack); | 277 SafePointAwareMutexLocker locker(m_threadAttachMutex, BlinkGC::NoHeapPoi
ntersOnStack); |
278 thread->runTerminationGC(); | 278 thread->runTerminationGC(); |
279 ASSERT(m_threads.contains(thread)); | 279 ASSERT(m_threads.contains(thread)); |
280 m_threads.remove(thread); | 280 m_threads.remove(thread); |
281 isLastThread = m_threads.isEmpty(); | 281 isLastThread = m_threads.isEmpty(); |
282 } | 282 } |
283 // The last thread begin detached should be the owning thread, which would | 283 // The last thread begin detached should be the owning thread, which would |
284 // be the main thread for the mainThreadHeap and a per thread heap enabled | 284 // be the main thread for the mainThreadHeap and a per thread heap enabled |
285 // thread otherwise. | 285 // thread otherwise. |
286 if (isLastThread) | 286 if (isLastThread) |
287 DCHECK(thread->perThreadHeapEnabled() || thread->isMainThread()); | 287 DCHECK(thread->threadHeapMode() == BlinkGC::PerThreadHeapMode || thread-
>isMainThread()); |
288 if (thread->isMainThread()) | 288 if (thread->isMainThread()) |
289 DCHECK_EQ(heapStats().allocatedSpace(), 0u); | 289 DCHECK_EQ(heapStats().allocatedSpace(), 0u); |
290 if (isLastThread) | 290 if (isLastThread) |
291 delete this; | 291 delete this; |
292 } | 292 } |
293 | 293 |
294 bool ThreadHeap::park() | 294 bool ThreadHeap::park() |
295 { | 295 { |
296 return m_safePointBarrier->parkOthers(); | 296 return m_safePointBarrier->parkOthers(); |
297 } | 297 } |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize()); | 639 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize()); |
640 | 640 |
641 m_stats.reset(); | 641 m_stats.reset(); |
642 for (ThreadState* state : m_threads) | 642 for (ThreadState* state : m_threads) |
643 state->resetHeapCounters(); | 643 state->resetHeapCounters(); |
644 } | 644 } |
645 | 645 |
646 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr; | 646 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr; |
647 | 647 |
648 } // namespace blink | 648 } // namespace blink |
OLD | NEW |