Ignore:
Timestamp:
Dec 7, 2015, 2:03:48 PM (10 years ago)
Author:
[email protected]
Message:

Add op_watchdog opcode that is generated when VM has a watchdog
https://bugs.webkit.org/show_bug.cgi?id=151954

Reviewed by Mark Lam.

Source/JavaScriptCore:

This patch also makes watchdog a private member
of VM and adds a getter function.

  • API/JSContextRef.cpp:

(JSContextGroupClearExecutionTimeLimit):

  • bytecode/BytecodeList.json:
  • bytecode/BytecodeUseDef.h:

(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::dumpBytecode):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitLoopHint):
(JSC::BytecodeGenerator::emitWatchdog):
(JSC::BytecodeGenerator::retrieveLastBinaryOp):

  • bytecompiler/BytecodeGenerator.h:
  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock):

  • dfg/DFGCapabilities.cpp:

(JSC::DFG::capabilityLevel):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • ftl/FTLLowerDFGToLLVM.cpp:

(JSC::FTL::DFG::LowerDFGToLLVM::compileCheckWatchdogTimer):

  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):

  • jit/JIT.h:
  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_loop_hint):
(JSC::JIT::emitSlow_op_loop_hint):
(JSC::JIT::emit_op_watchdog):
(JSC::JIT::emitSlow_op_watchdog):
(JSC::JIT::emit_op_new_regexp):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • llint/LowLevelInterpreter.asm:
  • runtime/VM.cpp:

(JSC::VM::ensureWatchdog):

  • runtime/VM.h:

(JSC::VM::watchdog):

  • runtime/VMEntryScope.cpp:

(JSC::VMEntryScope::VMEntryScope):
(JSC::VMEntryScope::~VMEntryScope):

  • runtime/VMInlines.h:

(JSC::VM::shouldTriggerTermination):

Source/WebCore:

No new tests because JSC already has tests for this.

  • bindings/js/WorkerScriptController.cpp:

(WebCore::WorkerScriptController::scheduleExecutionTermination):
(WebCore::WorkerScriptController::isTerminatingExecution):

File:
1 edited

Legend:

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

    r193606 r193649  
    893893            AbsoluteAddress(m_codeBlock->addressOfJITExecuteCounter())));
    894894    }
    895 
    896     // Emit the watchdog timer check:
    897     if (m_vm->watchdog)
    898         addSlowCase(branchTest8(NonZero, AbsoluteAddress(m_vm->watchdog->timerDidFireAddress())));
    899895}
    900896
     
    921917    }
    922918#endif
    923 
    924     // Emit the slow path of the watchdog timer check:
    925     if (m_vm->watchdog) {
    926         linkSlowCase(iter);
    927         callOperation(operationHandleWatchdogTimer);
    928 
    929         emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_loop_hint));
    930     }
    931 
     919}
     920
     921void JIT::emit_op_watchdog(Instruction*)
     922{
     923    ASSERT(m_vm->watchdog());
     924    addSlowCase(branchTest8(NonZero, AbsoluteAddress(m_vm->watchdog()->timerDidFireAddress())));
     925}
     926
     927void JIT::emitSlow_op_watchdog(Instruction*, Vector<SlowCaseEntry>::iterator& iter)
     928{
     929    ASSERT(m_vm->watchdog());
     930    linkSlowCase(iter);
     931    callOperation(operationHandleWatchdogTimer);
    932932}
    933933
Note: See TracChangeset for help on using the changeset viewer.