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 2417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2428 "forced", cause == ThreadState::ForcedGC); | 2428 "forced", cause == ThreadState::ForcedGC); |
2429 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink_gc", "BlinkGC"); | 2429 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink_gc", "BlinkGC"); |
2430 double timeStamp = WTF::currentTimeMS(); | 2430 double timeStamp = WTF::currentTimeMS(); |
2431 #if ENABLE(GC_PROFILE_MARKING) | 2431 #if ENABLE(GC_PROFILE_MARKING) |
2432 static_cast<MarkingVisitor*>(s_markingVisitor)->objectGraph().clear(); | 2432 static_cast<MarkingVisitor*>(s_markingVisitor)->objectGraph().clear(); |
2433 #endif | 2433 #endif |
2434 | 2434 |
2435 // Disallow allocation during garbage collection (but not | 2435 // Disallow allocation during garbage collection (but not |
2436 // during the finalization that happens when the gcScope is | 2436 // during the finalization that happens when the gcScope is |
2437 // torn down). | 2437 // torn down). |
2438 NoAllocationScope<AnyThread> noAllocationScope; | 2438 NoAllocationScope<AnyThreadAffinity> noAllocationScope; |
2439 | 2439 |
2440 prepareForGC(); | 2440 prepareForGC(); |
2441 | 2441 |
2442 // 1. trace persistent roots. | 2442 // 1. trace persistent roots. |
2443 ThreadState::visitPersistentRoots(s_markingVisitor); | 2443 ThreadState::visitPersistentRoots(s_markingVisitor); |
2444 | 2444 |
2445 // 2. trace objects reachable from the persistent roots including ephemerons
. | 2445 // 2. trace objects reachable from the persistent roots including ephemerons
. |
2446 processMarkingStackInParallel(); | 2446 processMarkingStackInParallel(); |
2447 | 2447 |
2448 // 3. trace objects reachable from the stack. We do this independent of the | 2448 // 3. trace objects reachable from the stack. We do this independent of the |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2484 ScriptForbiddenScope::exit(); | 2484 ScriptForbiddenScope::exit(); |
2485 } | 2485 } |
2486 | 2486 |
2487 void Heap::collectGarbageForTerminatingThread(ThreadState* state) | 2487 void Heap::collectGarbageForTerminatingThread(ThreadState* state) |
2488 { | 2488 { |
2489 // We explicitly do not enter a safepoint while doing thread specific | 2489 // We explicitly do not enter a safepoint while doing thread specific |
2490 // garbage collection since we don't want to allow a global GC at the | 2490 // garbage collection since we don't want to allow a global GC at the |
2491 // same time as a thread local GC. | 2491 // same time as a thread local GC. |
2492 | 2492 |
2493 { | 2493 { |
2494 NoAllocationScope<AnyThread> noAllocationScope; | 2494 NoAllocationScope<AnyThreadAffinity> noAllocationScope; |
2495 | 2495 |
2496 state->enterGC(); | 2496 state->enterGC(); |
2497 state->prepareForGC(); | 2497 state->prepareForGC(); |
2498 | 2498 |
2499 // 1. trace the thread local persistent roots. For thread local GCs we | 2499 // 1. trace the thread local persistent roots. For thread local GCs we |
2500 // don't trace the stack (ie. no conservative scanning) since this is | 2500 // don't trace the stack (ie. no conservative scanning) since this is |
2501 // only called during thread shutdown where there should be no objects | 2501 // only called during thread shutdown where there should be no objects |
2502 // on the stack. | 2502 // on the stack. |
2503 // We also assume that orphaned pages have no objects reachable from | 2503 // We also assume that orphaned pages have no objects reachable from |
2504 // persistent handles on other threads or CrossThreadPersistents. The | 2504 // persistent handles on other threads or CrossThreadPersistents. The |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2892 CallbackStack* Heap::s_weakCallbackStack; | 2892 CallbackStack* Heap::s_weakCallbackStack; |
2893 CallbackStack* Heap::s_ephemeronStack; | 2893 CallbackStack* Heap::s_ephemeronStack; |
2894 HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache; | 2894 HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache; |
2895 bool Heap::s_shutdownCalled = false; | 2895 bool Heap::s_shutdownCalled = false; |
2896 bool Heap::s_lastGCWasConservative = false; | 2896 bool Heap::s_lastGCWasConservative = false; |
2897 FreePagePool* Heap::s_freePagePool; | 2897 FreePagePool* Heap::s_freePagePool; |
2898 OrphanedPagePool* Heap::s_orphanedPagePool; | 2898 OrphanedPagePool* Heap::s_orphanedPagePool; |
2899 Heap::RegionTree* Heap::s_regionTree = 0; | 2899 Heap::RegionTree* Heap::s_regionTree = 0; |
2900 | 2900 |
2901 } | 2901 } |
OLD | NEW |