-
fpizlo@apple.com authored
https://bugs.webkit.org/show_bug.cgi?id=90146 Reviewed by Oliver Hunt. Rolling r121511 back in after fixing the DFG's interpretation of op_div profiling, with Gavin's rubber stamp. This removes a bunch of code that was previously trying to prevent spurious reoptimizations if a large enough majority of executions of a code block did not result in OSR exit. It turns out that this code was purely harmful. This patch removes all of that logic and replaces it with a dead-simple heuristic: if you exit more than N times (where N is an exponential function of the number of times the code block has already been recompiled) then we will recompile. This appears to be a broad ~1% win on many benchmarks large and small. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): * bytecode/CodeBlock.h: (JSC::CodeBlock::couldTakeSpecialFastCase): (CodeBlock): (JSC::CodeBlock::osrExitCounter): (JSC::CodeBlock::countOSRExit): (JSC::CodeBlock::addressOfOSRExitCounter): (JSC::CodeBlock::offsetOfOSRExitCounter): (JSC::CodeBlock::adjustedExitCountThreshold): (JSC::CodeBlock::exitCountThresholdForReoptimization): (JSC::CodeBlock::exitCountThresholdForReoptimizationFromLoop): (JSC::CodeBlock::shouldReoptimizeNow): (JSC::CodeBlock::shouldReoptimizeFromLoopNow): * bytecode/ExecutionCounter.cpp: (JSC::ExecutionCounter::setThreshold): * bytecode/ExecutionCounter.h: (ExecutionCounter): (JSC::ExecutionCounter::clippedThreshold): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::makeDivSafe): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compileBody): * dfg/DFGOSRExit.cpp: (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow): * dfg/DFGOSRExitCompiler.cpp: (JSC::DFG::OSRExitCompiler::handleExitCounts): * dfg/DFGOperations.cpp: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Options.h: (JSC): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122206 268f45cc-cd09-0410-ab3c-d52691b4dbfc
39c94a4c