| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 #endif | 131 #endif |
| 132 | 132 |
| 133 GCInfoTable::init(); | 133 GCInfoTable::init(); |
| 134 | 134 |
| 135 if (Platform::current() && Platform::current()->currentThread()) | 135 if (Platform::current() && Platform::current()->currentThread()) |
| 136 Platform::current()->registerMemoryDumpProvider(BlinkGCMemoryDumpProvide
r::instance(), "BlinkGC"); | 136 Platform::current()->registerMemoryDumpProvider(BlinkGCMemoryDumpProvide
r::instance(), "BlinkGC"); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void Heap::shutdown() | 139 void Heap::shutdown() |
| 140 { | 140 { |
| 141 ASSERT(s_markingStack); | |
| 142 | |
| 143 if (Platform::current() && Platform::current()->currentThread()) | 141 if (Platform::current() && Platform::current()->currentThread()) |
| 144 Platform::current()->unregisterMemoryDumpProvider(BlinkGCMemoryDumpProvi
der::instance()); | 142 Platform::current()->unregisterMemoryDumpProvider(BlinkGCMemoryDumpProvi
der::instance()); |
| 143 s_shutdownCalled = true; |
| 144 ThreadState::shutdownHeapIfNecessary(); |
| 145 } |
| 145 | 146 |
| 146 // The main thread must be the last thread that gets detached. | 147 void Heap::doShutdown() |
| 147 RELEASE_ASSERT(ThreadState::attachedThreads().size() == 0); | 148 { |
| 149 // We don't want to call doShutdown() twice. |
| 150 if (!s_markingStack) |
| 151 return; |
| 148 | 152 |
| 153 ASSERT(!ThreadState::attachedThreads().size()); |
| 149 delete s_heapDoesNotContainCache; | 154 delete s_heapDoesNotContainCache; |
| 150 s_heapDoesNotContainCache = nullptr; | 155 s_heapDoesNotContainCache = nullptr; |
| 151 delete s_freePagePool; | 156 delete s_freePagePool; |
| 152 s_freePagePool = nullptr; | 157 s_freePagePool = nullptr; |
| 153 delete s_orphanedPagePool; | 158 delete s_orphanedPagePool; |
| 154 s_orphanedPagePool = nullptr; | 159 s_orphanedPagePool = nullptr; |
| 155 delete s_globalWeakCallbackStack; | 160 delete s_globalWeakCallbackStack; |
| 156 s_globalWeakCallbackStack = nullptr; | 161 s_globalWeakCallbackStack = nullptr; |
| 157 delete s_postMarkingCallbackStack; | 162 delete s_postMarkingCallbackStack; |
| 158 s_postMarkingCallbackStack = nullptr; | 163 s_postMarkingCallbackStack = nullptr; |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 size_t Heap::s_wrapperCountAtLastGC = 0; | 688 size_t Heap::s_wrapperCountAtLastGC = 0; |
| 684 size_t Heap::s_collectedWrapperCount = 0; | 689 size_t Heap::s_collectedWrapperCount = 0; |
| 685 size_t Heap::s_partitionAllocSizeAtLastGC = 0; | 690 size_t Heap::s_partitionAllocSizeAtLastGC = 0; |
| 686 double Heap::s_estimatedMarkingTimePerByte = 0.0; | 691 double Heap::s_estimatedMarkingTimePerByte = 0.0; |
| 687 bool Heap::s_isLowEndDevice = false; | 692 bool Heap::s_isLowEndDevice = false; |
| 688 #if ENABLE(ASSERT) | 693 #if ENABLE(ASSERT) |
| 689 uint16_t Heap::s_gcGeneration = 0; | 694 uint16_t Heap::s_gcGeneration = 0; |
| 690 #endif | 695 #endif |
| 691 | 696 |
| 692 } // namespace blink | 697 } // namespace blink |
| OLD | NEW |