void ThreadState::postGCProcessing() { checkThread(); if (gcState() != EagerSweepScheduled && gcState() != LazySweepScheduled) return; m_didV8GCAfterLastGC = false; if (isMainThread()) m_allocatedObjectSizeBeforeSweeping = Heap::allocatedObjectSize(); #if ENABLE(GC_PROFILE_HEAP) // We snapshot the heap prior to sweeping to get numbers for both resources // that have been allocated since the last GC and for resources that are // going to be freed. bool gcTracingEnabled; TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink_gc", &gcTracingEnabled); if (gcTracingEnabled) snapshot(); #endif { if (isMainThread()) ScriptForbiddenScope::enter(); SweepForbiddenScope forbiddenScope(this); { // Disallow allocation during weak processing. NoAllocationScope noAllocationScope(this); { TRACE_EVENT0("blink_gc", "ThreadState::threadLocalWeakProcessing"); // Perform thread-specific weak processing. while (popAndInvokeWeakPointerCallback(Heap::s_markingVisitor)) { } } { TRACE_EVENT0("blink_gc", "ThreadState::invokePreFinalizers"); invokePreFinalizers(*Heap::s_markingVisitor); } } if (isMainThread()) ScriptForbiddenScope::exit(); } #if ENABLE(OILPAN) if (gcState() == EagerSweepScheduled) { // Eager sweeping should happen only in testing. setGCState(Sweeping); completeSweep(); } else { // The default behavior is lazy sweeping. setGCState(Sweeping); } #else // FIXME: For now, we disable lazy sweeping in non-oilpan builds // to avoid unacceptable behavior regressions on trunk. setGCState(Sweeping); completeSweep(); #endif }
bool firstPaintInvalidationTrackingEnabled() { if (showPaintRectsEnabled) return true; bool isTracingEnabled; TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), &isTracingEnabled); return isTracingEnabled; }
bool StyleResolverStats::allCountersEnabled() const { bool allCountersEnabled; TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("blink.style"), &allCountersEnabled); return allCountersEnabled; }