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 1986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1997 s_weakCallbackStack = new CallbackStack(); | 1997 s_weakCallbackStack = new CallbackStack(); |
1998 s_ephemeronStack = new CallbackStack(); | 1998 s_ephemeronStack = new CallbackStack(); |
1999 s_heapDoesNotContainCache = new HeapDoesNotContainCache(); | 1999 s_heapDoesNotContainCache = new HeapDoesNotContainCache(); |
2000 s_markingVisitor = new MarkingVisitor<GlobalMarking>(); | 2000 s_markingVisitor = new MarkingVisitor<GlobalMarking>(); |
2001 s_freePagePool = new FreePagePool(); | 2001 s_freePagePool = new FreePagePool(); |
2002 s_orphanedPagePool = new OrphanedPagePool(); | 2002 s_orphanedPagePool = new OrphanedPagePool(); |
2003 s_allocatedObjectSize = 0; | 2003 s_allocatedObjectSize = 0; |
2004 s_allocatedSpace = 0; | 2004 s_allocatedSpace = 0; |
2005 s_markedObjectSize = 0; | 2005 s_markedObjectSize = 0; |
2006 | 2006 |
2007 const size_t tableSize = gcInfoIndexMax * sizeof(GCInfo); | 2007 GCInfoTable::init(); |
2008 s_gcInfoTable = reinterpret_cast<GCInfo const**>(new uint8_t[tableSize]); | |
2009 memset(s_gcInfoTable, 0, tableSize); | |
2010 } | 2008 } |
2011 | 2009 |
2012 void Heap::shutdown() | 2010 void Heap::shutdown() |
2013 { | 2011 { |
2014 s_shutdownCalled = true; | 2012 s_shutdownCalled = true; |
2015 ThreadState::shutdownHeapIfNecessary(); | 2013 ThreadState::shutdownHeapIfNecessary(); |
2016 } | 2014 } |
2017 | 2015 |
2018 void Heap::doShutdown() | 2016 void Heap::doShutdown() |
2019 { | 2017 { |
(...skipping 13 matching lines...) Expand all Loading... |
2033 delete s_weakCallbackStack; | 2031 delete s_weakCallbackStack; |
2034 s_weakCallbackStack = nullptr; | 2032 s_weakCallbackStack = nullptr; |
2035 delete s_postMarkingCallbackStack; | 2033 delete s_postMarkingCallbackStack; |
2036 s_postMarkingCallbackStack = nullptr; | 2034 s_postMarkingCallbackStack = nullptr; |
2037 delete s_markingStack; | 2035 delete s_markingStack; |
2038 s_markingStack = nullptr; | 2036 s_markingStack = nullptr; |
2039 delete s_ephemeronStack; | 2037 delete s_ephemeronStack; |
2040 s_ephemeronStack = nullptr; | 2038 s_ephemeronStack = nullptr; |
2041 delete s_regionTree; | 2039 delete s_regionTree; |
2042 s_regionTree = nullptr; | 2040 s_regionTree = nullptr; |
2043 delete[] s_gcInfoTable; | 2041 GCInfoTable::shutdown(); |
2044 s_gcInfoTable = nullptr; | |
2045 ThreadState::shutdown(); | 2042 ThreadState::shutdown(); |
2046 ASSERT(Heap::allocatedSpace() == 0); | 2043 ASSERT(Heap::allocatedSpace() == 0); |
2047 } | 2044 } |
2048 | 2045 |
2049 #if ENABLE(ASSERT) | 2046 #if ENABLE(ASSERT) |
2050 BaseHeapPage* Heap::findPageFromAddress(Address address) | 2047 BaseHeapPage* Heap::findPageFromAddress(Address address) |
2051 { | 2048 { |
2052 ASSERT(ThreadState::current()->isInGC()); | 2049 ASSERT(ThreadState::current()->isInGC()); |
2053 for (ThreadState* state : ThreadState::attachedThreads()) { | 2050 for (ThreadState* state : ThreadState::attachedThreads()) { |
2054 if (BaseHeapPage* page = state->findPageFromAddress(address)) | 2051 if (BaseHeapPage* page = state->findPageFromAddress(address)) |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2652 bool Heap::s_shutdownCalled = false; | 2649 bool Heap::s_shutdownCalled = false; |
2653 bool Heap::s_lastGCWasConservative = false; | 2650 bool Heap::s_lastGCWasConservative = false; |
2654 FreePagePool* Heap::s_freePagePool; | 2651 FreePagePool* Heap::s_freePagePool; |
2655 OrphanedPagePool* Heap::s_orphanedPagePool; | 2652 OrphanedPagePool* Heap::s_orphanedPagePool; |
2656 Heap::RegionTree* Heap::s_regionTree = nullptr; | 2653 Heap::RegionTree* Heap::s_regionTree = nullptr; |
2657 size_t Heap::s_allocatedObjectSize = 0; | 2654 size_t Heap::s_allocatedObjectSize = 0; |
2658 size_t Heap::s_allocatedSpace = 0; | 2655 size_t Heap::s_allocatedSpace = 0; |
2659 size_t Heap::s_markedObjectSize = 0; | 2656 size_t Heap::s_markedObjectSize = 0; |
2660 | 2657 |
2661 } // namespace blink | 2658 } // namespace blink |
OLD | NEW |