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 2308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2319 double timeStamp = WTF::currentTimeMS(); | 2319 double timeStamp = WTF::currentTimeMS(); |
2320 #if ENABLE(GC_PROFILE_MARKING) | 2320 #if ENABLE(GC_PROFILE_MARKING) |
2321 static_cast<MarkingVisitor<GlobalMarking>*>(s_markingVisitor)->objectGraph()
.clear(); | 2321 static_cast<MarkingVisitor<GlobalMarking>*>(s_markingVisitor)->objectGraph()
.clear(); |
2322 #endif | 2322 #endif |
2323 | 2323 |
2324 // Disallow allocation during garbage collection (but not during the | 2324 // Disallow allocation during garbage collection (but not during the |
2325 // finalization that happens when the gcScope is torn down). | 2325 // finalization that happens when the gcScope is torn down). |
2326 ThreadState::NoAllocationScope noAllocationScope(state); | 2326 ThreadState::NoAllocationScope noAllocationScope(state); |
2327 | 2327 |
2328 preGC(); | 2328 preGC(); |
| 2329 s_markingVisitor->configureEagerTraceLimit(); |
| 2330 ASSERT(s_markingVisitor->canTraceEagerly()); |
2329 | 2331 |
2330 Heap::resetMarkedObjectSize(); | 2332 Heap::resetMarkedObjectSize(); |
2331 Heap::resetAllocatedObjectSize(); | 2333 Heap::resetAllocatedObjectSize(); |
2332 | 2334 |
2333 // 1. Trace persistent roots. | 2335 // 1. Trace persistent roots. |
2334 ThreadState::visitPersistentRoots(s_markingVisitor); | 2336 ThreadState::visitPersistentRoots(s_markingVisitor); |
2335 | 2337 |
2336 // 2. Trace objects reachable from the persistent roots including | 2338 // 2. Trace objects reachable from the persistent roots including |
2337 // ephemerons. | 2339 // ephemerons. |
2338 processMarkingStack(s_markingVisitor); | 2340 processMarkingStack(s_markingVisitor); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2374 void Heap::collectGarbageForTerminatingThread(ThreadState* state) | 2376 void Heap::collectGarbageForTerminatingThread(ThreadState* state) |
2375 { | 2377 { |
2376 // We explicitly do not enter a safepoint while doing thread specific | 2378 // We explicitly do not enter a safepoint while doing thread specific |
2377 // garbage collection since we don't want to allow a global GC at the | 2379 // garbage collection since we don't want to allow a global GC at the |
2378 // same time as a thread local GC. | 2380 // same time as a thread local GC. |
2379 { | 2381 { |
2380 MarkingVisitor<ThreadLocalMarking> markingVisitor; | 2382 MarkingVisitor<ThreadLocalMarking> markingVisitor; |
2381 ThreadState::NoAllocationScope noAllocationScope(state); | 2383 ThreadState::NoAllocationScope noAllocationScope(state); |
2382 | 2384 |
2383 state->preGC(); | 2385 state->preGC(); |
| 2386 s_markingVisitor->configureEagerTraceLimit(); |
| 2387 ASSERT(s_markingVisitor->canTraceEagerly()); |
2384 | 2388 |
2385 // 1. Trace the thread local persistent roots. For thread local GCs we | 2389 // 1. Trace the thread local persistent roots. For thread local GCs we |
2386 // don't trace the stack (ie. no conservative scanning) since this is | 2390 // don't trace the stack (ie. no conservative scanning) since this is |
2387 // only called during thread shutdown where there should be no objects | 2391 // only called during thread shutdown where there should be no objects |
2388 // on the stack. | 2392 // on the stack. |
2389 // We also assume that orphaned pages have no objects reachable from | 2393 // We also assume that orphaned pages have no objects reachable from |
2390 // persistent handles on other threads or CrossThreadPersistents. The | 2394 // persistent handles on other threads or CrossThreadPersistents. The |
2391 // only cases where this could happen is if a subsequent conservative | 2395 // only cases where this could happen is if a subsequent conservative |
2392 // global GC finds a "pointer" on the stack or due to a programming | 2396 // global GC finds a "pointer" on the stack or due to a programming |
2393 // error where an object has a dangling cross-thread pointer to an | 2397 // error where an object has a dangling cross-thread pointer to an |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2704 bool Heap::s_shutdownCalled = false; | 2708 bool Heap::s_shutdownCalled = false; |
2705 bool Heap::s_lastGCWasConservative = false; | 2709 bool Heap::s_lastGCWasConservative = false; |
2706 FreePagePool* Heap::s_freePagePool; | 2710 FreePagePool* Heap::s_freePagePool; |
2707 OrphanedPagePool* Heap::s_orphanedPagePool; | 2711 OrphanedPagePool* Heap::s_orphanedPagePool; |
2708 Heap::RegionTree* Heap::s_regionTree = nullptr; | 2712 Heap::RegionTree* Heap::s_regionTree = nullptr; |
2709 size_t Heap::s_allocatedObjectSize = 0; | 2713 size_t Heap::s_allocatedObjectSize = 0; |
2710 size_t Heap::s_allocatedSpace = 0; | 2714 size_t Heap::s_allocatedSpace = 0; |
2711 size_t Heap::s_markedObjectSize = 0; | 2715 size_t Heap::s_markedObjectSize = 0; |
2712 | 2716 |
2713 } // namespace blink | 2717 } // namespace blink |
OLD | NEW |