| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 181 |
| 182 void ThreadHeapStats::decreaseAllocatedSpace(size_t delta) { | 182 void ThreadHeapStats::decreaseAllocatedSpace(size_t delta) { |
| 183 atomicSubtract(&m_allocatedSpace, static_cast<long>(delta)); | 183 atomicSubtract(&m_allocatedSpace, static_cast<long>(delta)); |
| 184 ProcessHeap::decreaseTotalAllocatedSpace(delta); | 184 ProcessHeap::decreaseTotalAllocatedSpace(delta); |
| 185 } | 185 } |
| 186 | 186 |
| 187 ThreadHeap::ThreadHeap() | 187 ThreadHeap::ThreadHeap() |
| 188 : m_regionTree(WTF::makeUnique<RegionTree>()), | 188 : m_regionTree(WTF::makeUnique<RegionTree>()), |
| 189 m_heapDoesNotContainCache(WTF::wrapUnique(new HeapDoesNotContainCache)), | 189 m_heapDoesNotContainCache(WTF::wrapUnique(new HeapDoesNotContainCache)), |
| 190 m_safePointBarrier(WTF::makeUnique<SafePointBarrier>()), | 190 m_safePointBarrier(WTF::makeUnique<SafePointBarrier>()), |
| 191 m_freePagePool(WTF::wrapUnique(new FreePagePool)), | 191 m_freePagePool(WTF::wrapUnique(new PagePool)), |
| 192 m_markingStack(CallbackStack::create()), | 192 m_markingStack(CallbackStack::create()), |
| 193 m_postMarkingCallbackStack(CallbackStack::create()), | 193 m_postMarkingCallbackStack(CallbackStack::create()), |
| 194 m_globalWeakCallbackStack(CallbackStack::create()), | 194 m_globalWeakCallbackStack(CallbackStack::create()), |
| 195 m_ephemeronStack(CallbackStack::create()) { | 195 m_ephemeronStack(CallbackStack::create()) { |
| 196 if (ThreadState::current()->isMainThread()) | 196 if (ThreadState::current()->isMainThread()) |
| 197 s_mainThreadHeap = this; | 197 s_mainThreadHeap = this; |
| 198 | 198 |
| 199 MutexLocker locker(ThreadHeap::allHeapsMutex()); | 199 MutexLocker locker(ThreadHeap::allHeapsMutex()); |
| 200 allHeaps().insert(this); | 200 allHeaps().insert(this); |
| 201 } | 201 } |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize()); | 646 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize()); |
| 647 | 647 |
| 648 m_stats.reset(); | 648 m_stats.reset(); |
| 649 for (ThreadState* state : m_threads) | 649 for (ThreadState* state : m_threads) |
| 650 state->resetHeapCounters(); | 650 state->resetHeapCounters(); |
| 651 } | 651 } |
| 652 | 652 |
| 653 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr; | 653 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr; |
| 654 | 654 |
| 655 } // namespace blink | 655 } // namespace blink |
| OLD | NEW |