Ignore:
Timestamp:
Jul 24, 2013, 9:04:18 PM (12 years ago)
Author:
[email protected]
Message:

fourthTier: add option to disable OSR entry in loops
https://bugs.webkit.org/show_bug.cgi?id=118329

Reviewed by Mark Hahnenberg.

This adds that option, and also makes the OSR exit reoptimization trigger rely less on
OSR entry failing. Now even if we never attempt OSR entry but our execution counter gets
high after a small number of OSR exits, we will recompile.

  • dfg/DFGOSRExitCompilerCommon.cpp:

(JSC::DFG::handleExitCounts):

  • dfg/DFGOperations.cpp:
  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_loop_hint):
(JSC::JIT::emitSlow_op_loop_hint):

  • runtime/Options.h:

(JSC):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp

    r153237 r153263  
    11501150{
    11511151    // Emit the JIT optimization check:
    1152     if (canBeOptimized())
    1153         addSlowCase(branchAdd32(PositiveOrZero, TrustedImm32(Options::executionCounterIncrementForLoop()),
    1154             AbsoluteAddress(m_codeBlock->addressOfJITExecuteCounter())));
     1152    if (canBeOptimized()) {
     1153        if (Options::enableOSREntryInLoops()) {
     1154            addSlowCase(branchAdd32(PositiveOrZero, TrustedImm32(Options::executionCounterIncrementForLoop()),
     1155                AbsoluteAddress(m_codeBlock->addressOfJITExecuteCounter())));
     1156        } else {
     1157            // Add with saturation.
     1158            move(TrustedImmPtr(m_codeBlock->addressOfJITExecuteCounter()), regT3);
     1159            load32(regT3, regT2);
     1160            Jump dontAdd = branch32(
     1161                GreaterThan, regT2,
     1162                TrustedImm32(std::numeric_limits<int32_t>::max() - Options::executionCounterIncrementForLoop()));
     1163            add32(TrustedImm32(Options::executionCounterIncrementForLoop()), regT2);
     1164            store32(regT2, regT3);
     1165            dontAdd.link(this);
     1166        }
     1167    }
    11551168
    11561169    // Emit the watchdog timer check:
     
    11631176#if ENABLE(DFG_JIT)
    11641177    // Emit the slow path for the JIT optimization check:
    1165     if (canBeOptimized()) {
     1178    if (canBeOptimized() && Options::enableOSREntryInLoops()) {
    11661179        linkSlowCase(iter);
    1167 
     1180       
    11681181        JITStubCall stubCall(this, cti_optimize);
    11691182        stubCall.addArgument(TrustedImm32(m_bytecodeOffset));
    11701183        stubCall.call();
    1171 
     1184       
    11721185        emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_loop_hint));
    11731186    }
Note: See TracChangeset for help on using the changeset viewer.