| 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 2254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2265 double timeStamp = WTF::currentTimeMS(); | 2265 double timeStamp = WTF::currentTimeMS(); |
| 2266 #if ENABLE(GC_PROFILE_MARKING) | 2266 #if ENABLE(GC_PROFILE_MARKING) |
| 2267 static_cast<MarkingVisitor<GlobalMarking>*>(s_markingVisitor)->objectGraph()
.clear(); | 2267 static_cast<MarkingVisitor<GlobalMarking>*>(s_markingVisitor)->objectGraph()
.clear(); |
| 2268 #endif | 2268 #endif |
| 2269 | 2269 |
| 2270 // Disallow allocation during garbage collection (but not during the | 2270 // Disallow allocation during garbage collection (but not during the |
| 2271 // finalization that happens when the gcScope is torn down). | 2271 // finalization that happens when the gcScope is torn down). |
| 2272 ThreadState::NoAllocationScope noAllocationScope(state); | 2272 ThreadState::NoAllocationScope noAllocationScope(state); |
| 2273 | 2273 |
| 2274 preGC(); | 2274 preGC(); |
| 2275 s_markingVisitor->configureEagerTraceLimit(); | |
| 2276 ASSERT(s_markingVisitor->canTraceEagerly()); | |
| 2277 | 2275 |
| 2278 Heap::resetMarkedObjectSize(); | 2276 Heap::resetMarkedObjectSize(); |
| 2279 Heap::resetAllocatedObjectSize(); | 2277 Heap::resetAllocatedObjectSize(); |
| 2280 | 2278 |
| 2281 // 1. Trace persistent roots. | 2279 // 1. Trace persistent roots. |
| 2282 ThreadState::visitPersistentRoots(s_markingVisitor); | 2280 ThreadState::visitPersistentRoots(s_markingVisitor); |
| 2283 | 2281 |
| 2284 // 2. Trace objects reachable from the persistent roots including | 2282 // 2. Trace objects reachable from the persistent roots including |
| 2285 // ephemerons. | 2283 // ephemerons. |
| 2286 processMarkingStack(s_markingVisitor); | 2284 processMarkingStack(s_markingVisitor); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2323 { | 2321 { |
| 2324 // We explicitly do not enter a safepoint while doing thread specific | 2322 // We explicitly do not enter a safepoint while doing thread specific |
| 2325 // garbage collection since we don't want to allow a global GC at the | 2323 // garbage collection since we don't want to allow a global GC at the |
| 2326 // same time as a thread local GC. | 2324 // same time as a thread local GC. |
| 2327 | 2325 |
| 2328 { | 2326 { |
| 2329 MarkingVisitor<ThreadLocalMarking> markingVisitor; | 2327 MarkingVisitor<ThreadLocalMarking> markingVisitor; |
| 2330 ThreadState::NoAllocationScope noAllocationScope(state); | 2328 ThreadState::NoAllocationScope noAllocationScope(state); |
| 2331 | 2329 |
| 2332 state->preGC(); | 2330 state->preGC(); |
| 2333 s_markingVisitor->configureEagerTraceLimit(); | |
| 2334 | 2331 |
| 2335 // 1. Trace the thread local persistent roots. For thread local GCs we | 2332 // 1. Trace the thread local persistent roots. For thread local GCs we |
| 2336 // don't trace the stack (ie. no conservative scanning) since this is | 2333 // don't trace the stack (ie. no conservative scanning) since this is |
| 2337 // only called during thread shutdown where there should be no objects | 2334 // only called during thread shutdown where there should be no objects |
| 2338 // on the stack. | 2335 // on the stack. |
| 2339 // We also assume that orphaned pages have no objects reachable from | 2336 // We also assume that orphaned pages have no objects reachable from |
| 2340 // persistent handles on other threads or CrossThreadPersistents. The | 2337 // persistent handles on other threads or CrossThreadPersistents. The |
| 2341 // only cases where this could happen is if a subsequent conservative | 2338 // only cases where this could happen is if a subsequent conservative |
| 2342 // global GC finds a "pointer" on the stack or due to a programming | 2339 // global GC finds a "pointer" on the stack or due to a programming |
| 2343 // error where an object has a dangling cross-thread pointer to an | 2340 // error where an object has a dangling cross-thread pointer to an |
| (...skipping 308 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 |