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 2257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2268 double timeStamp = WTF::currentTimeMS(); | 2268 double timeStamp = WTF::currentTimeMS(); |
2269 #if ENABLE(GC_PROFILE_MARKING) | 2269 #if ENABLE(GC_PROFILE_MARKING) |
2270 static_cast<MarkingVisitor<GlobalMarking>*>(s_markingVisitor)->objectGraph()
.clear(); | 2270 static_cast<MarkingVisitor<GlobalMarking>*>(s_markingVisitor)->objectGraph()
.clear(); |
2271 #endif | 2271 #endif |
2272 | 2272 |
2273 // Disallow allocation during garbage collection (but not during the | 2273 // Disallow allocation during garbage collection (but not during the |
2274 // finalization that happens when the gcScope is torn down). | 2274 // finalization that happens when the gcScope is torn down). |
2275 ThreadState::NoAllocationScope noAllocationScope(state); | 2275 ThreadState::NoAllocationScope noAllocationScope(state); |
2276 | 2276 |
2277 preGC(); | 2277 preGC(); |
| 2278 s_markingVisitor->configureEagerTraceLimit(); |
2278 | 2279 |
2279 Heap::resetMarkedObjectSize(); | 2280 Heap::resetMarkedObjectSize(); |
2280 Heap::resetAllocatedObjectSize(); | 2281 Heap::resetAllocatedObjectSize(); |
2281 | 2282 |
2282 // 1. Trace persistent roots. | 2283 // 1. Trace persistent roots. |
2283 ThreadState::visitPersistentRoots(s_markingVisitor); | 2284 ThreadState::visitPersistentRoots(s_markingVisitor); |
2284 | 2285 |
2285 // 2. Trace objects reachable from the persistent roots including | 2286 // 2. Trace objects reachable from the persistent roots including |
2286 // ephemerons. | 2287 // ephemerons. |
2287 processMarkingStack(s_markingVisitor); | 2288 processMarkingStack(s_markingVisitor); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2324 { | 2325 { |
2325 // We explicitly do not enter a safepoint while doing thread specific | 2326 // We explicitly do not enter a safepoint while doing thread specific |
2326 // garbage collection since we don't want to allow a global GC at the | 2327 // garbage collection since we don't want to allow a global GC at the |
2327 // same time as a thread local GC. | 2328 // same time as a thread local GC. |
2328 | 2329 |
2329 { | 2330 { |
2330 MarkingVisitor<ThreadLocalMarking> markingVisitor; | 2331 MarkingVisitor<ThreadLocalMarking> markingVisitor; |
2331 ThreadState::NoAllocationScope noAllocationScope(state); | 2332 ThreadState::NoAllocationScope noAllocationScope(state); |
2332 | 2333 |
2333 state->preGC(); | 2334 state->preGC(); |
| 2335 s_markingVisitor->configureEagerTraceLimit(); |
2334 | 2336 |
2335 // 1. Trace the thread local persistent roots. For thread local GCs we | 2337 // 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 | 2338 // don't trace the stack (ie. no conservative scanning) since this is |
2337 // only called during thread shutdown where there should be no objects | 2339 // only called during thread shutdown where there should be no objects |
2338 // on the stack. | 2340 // on the stack. |
2339 // We also assume that orphaned pages have no objects reachable from | 2341 // We also assume that orphaned pages have no objects reachable from |
2340 // persistent handles on other threads or CrossThreadPersistents. The | 2342 // persistent handles on other threads or CrossThreadPersistents. The |
2341 // only cases where this could happen is if a subsequent conservative | 2343 // 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 | 2344 // 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 | 2345 // 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; | 2654 bool Heap::s_shutdownCalled = false; |
2653 bool Heap::s_lastGCWasConservative = false; | 2655 bool Heap::s_lastGCWasConservative = false; |
2654 FreePagePool* Heap::s_freePagePool; | 2656 FreePagePool* Heap::s_freePagePool; |
2655 OrphanedPagePool* Heap::s_orphanedPagePool; | 2657 OrphanedPagePool* Heap::s_orphanedPagePool; |
2656 Heap::RegionTree* Heap::s_regionTree = nullptr; | 2658 Heap::RegionTree* Heap::s_regionTree = nullptr; |
2657 size_t Heap::s_allocatedObjectSize = 0; | 2659 size_t Heap::s_allocatedObjectSize = 0; |
2658 size_t Heap::s_allocatedSpace = 0; | 2660 size_t Heap::s_allocatedSpace = 0; |
2659 size_t Heap::s_markedObjectSize = 0; | 2661 size_t Heap::s_markedObjectSize = 0; |
2660 | 2662 |
2661 } // namespace blink | 2663 } // namespace blink |
OLD | NEW |