Changeset 95681 in webkit for trunk/Source/JavaScriptCore/jit/JITStubs.cpp
- Timestamp:
- Sep 21, 2011, 4:36:35 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/JITStubs.cpp
r95666 r95681 1915 1915 unsigned bytecodeIndex = stackFrame.args[0].int32(); 1916 1916 1917 if (!codeBlock->hasOptimizedReplacement()) { 1917 #if ENABLE(JIT_VERBOSE_OSR) 1918 printf("Entered optimize_from_loop with executeCounter = %d, reoptimizationRetryCounter = %u, optimizationDelayCounter = %u\n", codeBlock->executeCounter(), codeBlock->reoptimizationRetryCounter(), codeBlock->optimizationDelayCounter()); 1919 #endif 1920 1921 if (codeBlock->hasOptimizedReplacement()) { 1922 #if ENABLE(JIT_VERBOSE_OSR) 1923 printf("Considering loop OSR into %p(%p) with success/fail %u/%u.\n", codeBlock, codeBlock->replacement(), codeBlock->replacement()->speculativeSuccessCounter(), codeBlock->replacement()->speculativeFailCounter()); 1924 #endif 1925 if (codeBlock->replacement()->shouldReoptimizeFromLoopNow()) { 1926 #if ENABLE(JIT_VERBOSE_OSR) 1927 printf("Triggering reoptimization of %p(%p) (in loop).\n", codeBlock, codeBlock->replacement()); 1928 #endif 1929 codeBlock->reoptimize(callFrame->globalData()); 1930 return; 1931 } 1932 } else { 1918 1933 if (!codeBlock->shouldOptimizeNow()) { 1919 1934 #if ENABLE(JIT_VERBOSE_OSR) … … 1953 1968 1954 1969 codeBlock->optimizeSoon(); 1970 optimizedCodeBlock->countSpeculationSuccess(); 1955 1971 STUB_SET_RETURN_ADDRESS(address); 1956 1972 return; … … 1961 1977 #endif 1962 1978 1979 // Count the OSR failure as a speculation failure. If this happens a lot, then 1980 // reoptimize. 1981 optimizedCodeBlock->countSpeculationFailure(); 1982 1983 #if ENABLE(JIT_VERBOSE_OSR) 1984 printf("Encountered loop OSR failure into %p(%p) with success/fail %u/%u.\n", codeBlock, codeBlock->replacement(), codeBlock->replacement()->speculativeSuccessCounter(), codeBlock->replacement()->speculativeFailCounter()); 1985 #endif 1986 1987 // We are a lot more conservative about triggering reoptimization after OSR failure than 1988 // before it. If we enter the optimize_from_loop trigger with a bucket full of fail 1989 // already, then we really would like to reoptimize immediately. But this case covers 1990 // something else: there weren't many (or any) speculation failures before, but we just 1991 // failed to enter the speculative code because some variable had the wrong value or 1992 // because the OSR code decided for any spurious reason that it did not want to OSR 1993 // right now. So, we only trigger reoptimization only upon the more conservative (non-loop) 1994 // reoptimization trigger. 1995 if (optimizedCodeBlock->shouldReoptimizeNow()) { 1996 #if ENABLE(JIT_VERBOSE_OSR) 1997 printf("Triggering reoptimization of %p(%p) (in loop after OSR fail).\n", codeBlock, codeBlock->replacement()); 1998 #endif 1999 codeBlock->reoptimize(callFrame->globalData()); 2000 return; 2001 } 2002 1963 2003 // OSR failed this time, but it might succeed next time! Let the code run a bit 1964 2004 // longer and then try again. … … 1973 2013 CodeBlock* codeBlock = callFrame->codeBlock(); 1974 2014 1975 if (codeBlock->hasOptimizedReplacement()) 2015 #if ENABLE(JIT_VERBOSE_OSR) 2016 printf("Entered optimize_from_ret with executeCounter = %d, reoptimizationRetryCounter = %u, optimizationDelayCounter = %u\n", codeBlock->executeCounter(), codeBlock->reoptimizationRetryCounter(), codeBlock->optimizationDelayCounter()); 2017 #endif 2018 2019 if (codeBlock->hasOptimizedReplacement()) { 2020 #if ENABLE(JIT_VERBOSE_OSR) 2021 printf("Returning from old JIT call frame with optimized replacement %p(%p), with success/fail %u/%u.\n", codeBlock, codeBlock->replacement(), codeBlock->replacement()->speculativeSuccessCounter(), codeBlock->replacement()->speculativeFailCounter()); 2022 #endif 2023 if (codeBlock->replacement()->shouldReoptimizeNow()) { 2024 #if ENABLE(JIT_VERBOSE_OSR) 2025 printf("Triggering reoptimization of %p(%p) (in return).\n", codeBlock, codeBlock->replacement()); 2026 #endif 2027 codeBlock->reoptimize(callFrame->globalData()); 2028 } 2029 1976 2030 return; 2031 } 1977 2032 1978 2033 if (!codeBlock->shouldOptimizeNow()) {
Note:
See TracChangeset
for help on using the changeset viewer.