| 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 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1975 s_postMarkingCallbackStack = new CallbackStack(); | 1975 s_postMarkingCallbackStack = new CallbackStack(); |
| 1976 s_weakCallbackStack = new CallbackStack(); | 1976 s_weakCallbackStack = new CallbackStack(); |
| 1977 s_ephemeronStack = new CallbackStack(); | 1977 s_ephemeronStack = new CallbackStack(); |
| 1978 s_heapDoesNotContainCache = new HeapDoesNotContainCache(); | 1978 s_heapDoesNotContainCache = new HeapDoesNotContainCache(); |
| 1979 s_markingVisitor = new MarkingVisitor<GlobalMarking>(); | 1979 s_markingVisitor = new MarkingVisitor<GlobalMarking>(); |
| 1980 s_freePagePool = new FreePagePool(); | 1980 s_freePagePool = new FreePagePool(); |
| 1981 s_orphanedPagePool = new OrphanedPagePool(); | 1981 s_orphanedPagePool = new OrphanedPagePool(); |
| 1982 s_allocatedObjectSize = 0; | 1982 s_allocatedObjectSize = 0; |
| 1983 s_allocatedSpace = 0; | 1983 s_allocatedSpace = 0; |
| 1984 s_markedObjectSize = 0; | 1984 s_markedObjectSize = 0; |
| 1985 |
| 1986 const size_t tableSize = gcInfoIndexMax * sizeof(GCInfo); |
| 1987 s_gcInfoTable = reinterpret_cast<GCInfo const**>(new uint8_t[tableSize]); |
| 1988 memset(s_gcInfoTable, 0, tableSize); |
| 1985 } | 1989 } |
| 1986 | 1990 |
| 1987 void Heap::shutdown() | 1991 void Heap::shutdown() |
| 1988 { | 1992 { |
| 1989 s_shutdownCalled = true; | 1993 s_shutdownCalled = true; |
| 1990 ThreadState::shutdownHeapIfNecessary(); | 1994 ThreadState::shutdownHeapIfNecessary(); |
| 1991 } | 1995 } |
| 1992 | 1996 |
| 1993 void Heap::doShutdown() | 1997 void Heap::doShutdown() |
| 1994 { | 1998 { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2008 delete s_weakCallbackStack; | 2012 delete s_weakCallbackStack; |
| 2009 s_weakCallbackStack = nullptr; | 2013 s_weakCallbackStack = nullptr; |
| 2010 delete s_postMarkingCallbackStack; | 2014 delete s_postMarkingCallbackStack; |
| 2011 s_postMarkingCallbackStack = nullptr; | 2015 s_postMarkingCallbackStack = nullptr; |
| 2012 delete s_markingStack; | 2016 delete s_markingStack; |
| 2013 s_markingStack = nullptr; | 2017 s_markingStack = nullptr; |
| 2014 delete s_ephemeronStack; | 2018 delete s_ephemeronStack; |
| 2015 s_ephemeronStack = nullptr; | 2019 s_ephemeronStack = nullptr; |
| 2016 delete s_regionTree; | 2020 delete s_regionTree; |
| 2017 s_regionTree = nullptr; | 2021 s_regionTree = nullptr; |
| 2022 delete[] s_gcInfoTable; |
| 2023 s_gcInfoTable = nullptr; |
| 2018 ThreadState::shutdown(); | 2024 ThreadState::shutdown(); |
| 2019 ASSERT(Heap::allocatedSpace() == 0); | 2025 ASSERT(Heap::allocatedSpace() == 0); |
| 2020 } | 2026 } |
| 2021 | 2027 |
| 2022 #if ENABLE(ASSERT) | 2028 #if ENABLE(ASSERT) |
| 2023 BaseHeapPage* Heap::findPageFromAddress(Address address) | 2029 BaseHeapPage* Heap::findPageFromAddress(Address address) |
| 2024 { | 2030 { |
| 2025 ASSERT(ThreadState::current()->isInGC()); | 2031 ASSERT(ThreadState::current()->isInGC()); |
| 2026 for (ThreadState* state : ThreadState::attachedThreads()) { | 2032 for (ThreadState* state : ThreadState::attachedThreads()) { |
| 2027 if (BaseHeapPage* page = state->findPageFromAddress(address)) | 2033 if (BaseHeapPage* page = state->findPageFromAddress(address)) |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2620 bool Heap::s_shutdownCalled = false; | 2626 bool Heap::s_shutdownCalled = false; |
| 2621 bool Heap::s_lastGCWasConservative = false; | 2627 bool Heap::s_lastGCWasConservative = false; |
| 2622 FreePagePool* Heap::s_freePagePool; | 2628 FreePagePool* Heap::s_freePagePool; |
| 2623 OrphanedPagePool* Heap::s_orphanedPagePool; | 2629 OrphanedPagePool* Heap::s_orphanedPagePool; |
| 2624 Heap::RegionTree* Heap::s_regionTree = nullptr; | 2630 Heap::RegionTree* Heap::s_regionTree = nullptr; |
| 2625 size_t Heap::s_allocatedObjectSize = 0; | 2631 size_t Heap::s_allocatedObjectSize = 0; |
| 2626 size_t Heap::s_allocatedSpace = 0; | 2632 size_t Heap::s_allocatedSpace = 0; |
| 2627 size_t Heap::s_markedObjectSize = 0; | 2633 size_t Heap::s_markedObjectSize = 0; |
| 2628 | 2634 |
| 2629 } // namespace blink | 2635 } // namespace blink |
| OLD | NEW |