Changeset 148989 in webkit for trunk/Source/JavaScriptCore/jit


Ignore:
Timestamp:
Apr 23, 2013, 1:54:34 PM (12 years ago)
Author:
[email protected]
Message:

Simplify the baseline JIT loop hint call site.
https://bugs.webkit.org/show_bug.cgi?id=115052.

Reviewed by Geoffrey Garen.

Moved the watchdog timer check after the JIT optimization check. This
ensures that the JIT opimization counter is incremented on every loop
hint even if the watchdog timer fires.

Removed the code that allows the JIT OSR to happen if the watchdog
timer fires but does not result in a termination. It is extremely rare
that the JIT optimization counter would trigger an OSR on the same pass
as when the watchdog timer fire. If it does happen, we'll simply hold
off on servicing the watchdog timer until the next pass (because it's
not time critical).

  • jit/JITOpcodes.cpp:

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

File:
1 edited

Legend:

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

    r148899 r148989  
    12801280void JIT::emit_op_loop_hint(Instruction*)
    12811281{
    1282     // Emit the watchdog timer check:
    1283     if (m_vm->watchdog.isEnabled())
    1284         addSlowCase(branchTest8(NonZero, AbsoluteAddress(m_vm->watchdog.timerDidFireAddress())));
    1285 
    12861282    // Emit the JIT optimization check:
    12871283    if (canBeOptimized())
    12881284        addSlowCase(branchAdd32(PositiveOrZero, TrustedImm32(Options::executionCounterIncrementForLoop()),
    12891285            AbsoluteAddress(m_codeBlock->addressOfJITExecuteCounter())));
     1286
     1287    // Emit the watchdog timer check:
     1288    if (m_vm->watchdog.isEnabled())
     1289        addSlowCase(branchTest8(NonZero, AbsoluteAddress(m_vm->watchdog.timerDidFireAddress())));
    12901290}
    12911291
    12921292void JIT::emitSlow_op_loop_hint(Instruction*, Vector<SlowCaseEntry>::iterator& iter)
    12931293{
    1294     // Emit the slow path of the watchdog timer check:
    1295     if (m_vm->watchdog.isEnabled()) {
    1296         linkSlowCase(iter);
    1297 
    1298         JITStubCall stubCall(this, cti_handle_watchdog_timer);
    1299         stubCall.call();
    1300 
    1301 #if ENABLE(DFG_JIT)
    1302         if (canBeOptimized()) {
    1303             Jump doOptimize = branchAdd32(PositiveOrZero, TrustedImm32(Options::executionCounterIncrementForLoop()),
    1304                 AbsoluteAddress(m_codeBlock->addressOfJITExecuteCounter()));
    1305             emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_loop_hint));
    1306             doOptimize.link(this);
    1307         } else
    1308 #endif
    1309             emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_loop_hint));
    1310     }
    1311 
    13121294#if ENABLE(DFG_JIT)
    13131295    // Emit the slow path for the JIT optimization check:
     
    13221304    }
    13231305#endif
     1306
     1307    // Emit the slow path of the watchdog timer check:
     1308    if (m_vm->watchdog.isEnabled()) {
     1309        linkSlowCase(iter);
     1310
     1311        JITStubCall stubCall(this, cti_handle_watchdog_timer);
     1312        stubCall.call();
     1313
     1314        emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_loop_hint));
     1315    }
     1316
    13241317}
    13251318
Note: See TracChangeset for help on using the changeset viewer.