Changeset 99375 in webkit
- Timestamp:
- Nov 6, 2011, 3:54:59 AM (15 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 7 edited
-
ChangeLog (modified) (1 diff)
-
bytecode/CodeBlock.cpp (modified) (1 diff)
-
bytecode/ValueProfile.h (modified) (1 diff)
-
jit/JITInlineMethods.h (modified) (3 diffs)
-
jit/JITStubs.cpp (modified) (3 diffs)
-
runtime/Heuristics.cpp (modified) (2 diffs)
-
runtime/Heuristics.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r99374 r99375 1 2011-11-05 Filip Pizlo <fpizlo@apple.com> 2 3 Value profiling should just use two buckets 4 https://bugs.webkit.org/show_bug.cgi?id=71619 5 6 Reviewed by Gavin Barraclough. 7 8 Added one more configuration options (like Heuristics::minimumOptimizationDelay), 9 improved debugging in JIT optimization support, changed the number of buckets 10 in the value profile from 9 to 2, and wrote a more optimal value profiling path 11 in the old JIT to take advantage of this. It's still possible to play around with 12 larger numbers of buckets, and we should probably keep this for a little while 13 until we convince ourselves that using just two buckets is the right call. 14 15 * bytecode/CodeBlock.cpp: 16 (JSC::CodeBlock::shouldOptimizeNow): 17 * bytecode/ValueProfile.h: 18 * jit/JITInlineMethods.h: 19 (JSC::JIT::emitValueProfilingSite): 20 * jit/JITStubs.cpp: 21 (JSC::DEFINE_STUB_FUNCTION): 22 * runtime/Heuristics.cpp: 23 (JSC::Heuristics::initializeHeuristics): 24 * runtime/Heuristics.h: 25 1 26 2011-11-03 Filip Pizlo <fpizlo@apple.com> 2 27 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r98831 r99375 1957 1957 1958 1958 if ((!numberOfNonArgumentValueProfiles || (double)numberOfLiveNonArgumentValueProfiles / numberOfNonArgumentValueProfiles >= Heuristics::desiredProfileLivenessRate) 1959 && (!numberOfValueProfiles() || (double)numberOfSamplesInProfiles / ValueProfile::numberOfBuckets / numberOfValueProfiles() >= Heuristics::desiredProfileFullnessRate)) 1959 && (!numberOfValueProfiles() || (double)numberOfSamplesInProfiles / ValueProfile::numberOfBuckets / numberOfValueProfiles() >= Heuristics::desiredProfileFullnessRate) 1960 && static_cast<unsigned>(m_optimizationDelayCounter) + 1 >= Heuristics::minimumOptimizationDelay) 1960 1961 return true; 1961 1962 1963 ASSERT(m_optimizationDelayCounter < std::numeric_limits<uint8_t>::max()); 1962 1964 m_optimizationDelayCounter++; 1963 1965 optimizeAfterWarmUp(); -
trunk/Source/JavaScriptCore/bytecode/ValueProfile.h
r98912 r99375 39 39 #if ENABLE(VALUE_PROFILER) 40 40 struct ValueProfile { 41 static const unsigned logNumberOfBuckets = 3; // 8 buckets41 static const unsigned logNumberOfBuckets = 0; // 1 bucket 42 42 static const unsigned numberOfBuckets = 1 << logNumberOfBuckets; 43 43 static const unsigned numberOfSpecFailBuckets = 1; -
trunk/Source/JavaScriptCore/jit/JITInlineMethods.h
r98674 r99375 463 463 464 464 const RegisterID value = regT0; 465 #if USE(JSVALUE32_64) 466 const RegisterID valueTag = regT1; 467 #endif 465 468 const RegisterID scratch = regT3; 466 469 … … 475 478 ASSERT(valueProfile); 476 479 480 if (ValueProfile::numberOfBuckets == 1) { 481 // We're in a simple configuration: only one bucket, so we can just do a direct 482 // store. 483 #if USE(JSVALUE64) 484 storePtr(value, valueProfile->m_buckets); 485 #else 486 EncodedValueDescriptor* descriptor = bitwise_cast<EncodedValueDescriptor*>(valueProfile->m_buckets); 487 store32(value, &descriptor->asBits.payload); 488 store32(valueTag, &descriptor->asBits.tag); 489 #endif 490 return; 491 } 492 477 493 if (m_randomGenerator.getUint32() & 1) 478 494 add32(Imm32(1), bucketCounterRegister); … … 484 500 storePtr(value, BaseIndex(scratch, bucketCounterRegister, TimesEight)); 485 501 #elif USE(JSVALUE32_64) 486 const RegisterID valueTag = regT1;487 502 store32(value, BaseIndex(scratch, bucketCounterRegister, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload))); 488 503 store32(valueTag, BaseIndex(scratch, bucketCounterRegister, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag))); -
trunk/Source/JavaScriptCore/jit/JITStubs.cpp
r99312 r99375 1959 1959 if (void* address = DFG::prepareOSREntry(callFrame, optimizedCodeBlock, bytecodeIndex)) { 1960 1960 #if ENABLE(JIT_VERBOSE_OSR) 1961 printf("Optimizing %p from loop succeeded, performing OSR .\n", codeBlock);1961 printf("Optimizing %p from loop succeeded, performing OSR after a delay of %u.\n", codeBlock, codeBlock->optimizationDelayCounter()); 1962 1962 #endif 1963 1963 … … 1969 1969 1970 1970 #if ENABLE(JIT_VERBOSE_OSR) 1971 printf("Optimizing %p from loop succeeded, OSR failed .\n", codeBlock);1971 printf("Optimizing %p from loop succeeded, OSR failed, after a delay of %u.\n", codeBlock, codeBlock->optimizationDelayCounter()); 1972 1972 #endif 1973 1973 … … 2059 2059 2060 2060 #if ENABLE(JIT_VERBOSE_OSR) 2061 printf("Optimizing %p from return succeeded .\n", codeBlock);2061 printf("Optimizing %p from return succeeded after a delay of %u.\n", codeBlock, codeBlock->optimizationDelayCounter()); 2062 2062 #endif 2063 2063 -
trunk/Source/JavaScriptCore/runtime/Heuristics.cpp
r98937 r99375 75 75 unsigned reoptimizationRetryCounterStep; 76 76 77 unsigned minimumOptimizationDelay; 77 78 unsigned maximumOptimizationDelay; 78 79 double desiredProfileLivenessRate; … … 158 159 SET(reoptimizationRetryCounterStep, 1); 159 160 161 SET(minimumOptimizationDelay, 1); 160 162 SET(maximumOptimizationDelay, 5); 161 163 SET(desiredProfileLivenessRate, 0.75); -
trunk/Source/JavaScriptCore/runtime/Heuristics.h
r98937 r99375 61 61 extern unsigned reoptimizationRetryCounterStep; 62 62 63 extern unsigned minimumOptimizationDelay; 63 64 extern unsigned maximumOptimizationDelay; 64 65 extern double desiredProfileLivenessRate;
Note:
See TracChangeset
for help on using the changeset viewer.