Changeset 167897 in webkit for trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
- Timestamp:
- Apr 28, 2014, 12:01:07 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r167325 r167897 1971 1971 RELEASE_ASSERT_NOT_REACHED(); 1972 1972 #endif // ENABLE(DFG_JIT) 1973 } 1974 1975 bool CodeBlock::shouldImmediatelyAssumeLivenessDuringScan() 1976 { 1977 #if ENABLE(DFG_JIT) 1978 // Interpreter and Baseline JIT CodeBlocks don't need to be jettisoned when 1979 // their weak references go stale. So if a basline JIT CodeBlock gets 1980 // scanned, we can assume that this means that it's live. 1981 if (!JITCode::isOptimizingJIT(jitType())) 1982 return true; 1983 1984 // For simplicity, we don't attempt to jettison code blocks during GC if 1985 // they are executing. Instead we strongly mark their weak references to 1986 // allow them to continue to execute soundly. 1987 if (m_mayBeExecuting) 1988 return true; 1989 1990 if (Options::forceDFGCodeBlockLiveness()) 1991 return true; 1992 1993 return false; 1994 #else 1995 return true; 1996 #endif 1997 } 1998 1999 bool CodeBlock::isKnownToBeLiveDuringGC() 2000 { 2001 #if ENABLE(DFG_JIT) 2002 // This should return true for: 2003 // - Code blocks that behave like normal objects - i.e. if they are referenced then they 2004 // are live. 2005 // - Code blocks that were running on the stack. 2006 // - Code blocks that survived the last GC if the current GC is an Eden GC. This is 2007 // because either livenessHasBeenProved would have survived as true or m_mayBeExecuting 2008 // would survive as true. 2009 // - Code blocks that don't have any dead weak references. 2010 2011 return shouldImmediatelyAssumeLivenessDuringScan() 2012 || m_jitCode->dfgCommon()->livenessHasBeenProved; 2013 #else 2014 return true; 2015 #endif 1973 2016 } 1974 2017 … … 2216 2259 #if ENABLE(DFG_JIT) 2217 2260 // Check if we're not live. If we are, then jettison. 2218 if (! (shouldImmediatelyAssumeLivenessDuringScan() || m_jitCode->dfgCommon()->livenessHasBeenProved)) {2261 if (!isKnownToBeLiveDuringGC()) { 2219 2262 if (Options::verboseOSR()) 2220 2263 dataLog(*this, " has dead weak references, jettisoning during GC.\n");
Note:
See TracChangeset
for help on using the changeset viewer.