Changeset 188649 in webkit
- Timestamp:
- Aug 19, 2015, 2:18:15 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/Source/JavaScriptCore/ChangeLog ¶
r188648 r188649 1 2015-08-19 Mark Lam <mark.lam@apple.com> 2 3 Add support for CheckWatchdogTimer as slow path in DFG and FTL. 4 https://bugs.webkit.org/show_bug.cgi?id=147968 5 6 Reviewed by Michael Saboff. 7 8 Re-implement the DFG's CheckWatchdogTimer as a slow path instead of a speculation 9 check. Since the watchdog timer can fire spuriously, this allows the code to 10 stay optimized if all we have are spurious fires. 11 12 Implement the equivalent slow path for CheckWatchdogTimer in the FTL. 13 14 The watchdog tests in ExecutionTimeLimitTest.cpp has already been updated in 15 https://bugs.webkit.org/show_bug.cgi?id=148125 to test for the FTL's watchdog 16 implementation. 17 18 * dfg/DFGSpeculativeJIT32_64.cpp: 19 (JSC::DFG::SpeculativeJIT::compile): 20 * dfg/DFGSpeculativeJIT64.cpp: 21 (JSC::DFG::SpeculativeJIT::compile): 22 * ftl/FTLCapabilities.cpp: 23 (JSC::FTL::canCompile): 24 * ftl/FTLLowerDFGToLLVM.cpp: 25 (JSC::FTL::DFG::LowerDFGToLLVM::compileNode): 26 (JSC::FTL::DFG::LowerDFGToLLVM::compileMaterializeCreateActivation): 27 (JSC::FTL::DFG::LowerDFGToLLVM::compileCheckWatchdogTimer): 28 (JSC::FTL::DFG::LowerDFGToLLVM::isInlinableSize): 29 30 * jit/JIT.h: 31 * jit/JITInlines.h: 32 (JSC::JIT::callOperation): 33 * jit/JITOperations.cpp: 34 * jit/JITOperations.h: 35 - Changed operationHandleWatchdogTimer() to return an unused nullptr. This 36 allows me to reuse the existing DFG slow path generator mechanism. I didn't 37 think that operationHandleWatchdogTimer() was worth introducing a whole new set 38 of machinery just so we can have a slow path that returns void. 39 1 40 2015-08-19 Mark Lam <mark.lam@apple.com> 2 41 -
TabularUnified trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp ¶
r188624 r188649 4641 4641 break; 4642 4642 4643 case CheckWatchdogTimer: 4643 case CheckWatchdogTimer: { 4644 4644 ASSERT(m_jit.vm()->watchdog); 4645 speculationCheck( 4646 WatchdogTimerFired, JSValueRegs(), 0, 4647 m_jit.branchTest8( 4648 JITCompiler::NonZero, 4649 JITCompiler::AbsoluteAddress(m_jit.vm()->watchdog->timerDidFireAddress()))); 4650 break; 4645 GPRTemporary unused(this); 4646 GPRReg unusedGPR = unused.gpr(); 4647 4648 JITCompiler::Jump timerDidFire = m_jit.branchTest8(JITCompiler::NonZero, 4649 JITCompiler::AbsoluteAddress(m_jit.vm()->watchdog->timerDidFireAddress())); 4650 4651 addSlowPathGenerator(slowPathCall(timerDidFire, this, operationHandleWatchdogTimer, unusedGPR)); 4652 break; 4653 } 4651 4654 4652 4655 case CountExecution: -
TabularUnified trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp ¶
r188624 r188649 4330 4330 break; 4331 4331 4332 case CheckWatchdogTimer: 4332 case CheckWatchdogTimer: { 4333 4333 ASSERT(m_jit.vm()->watchdog); 4334 speculationCheck( 4335 WatchdogTimerFired, JSValueRegs(), 0, 4336 m_jit.branchTest8( 4337 JITCompiler::NonZero, 4338 JITCompiler::AbsoluteAddress(m_jit.vm()->watchdog->timerDidFireAddress()))); 4339 break; 4334 GPRTemporary unused(this); 4335 GPRReg unusedGPR = unused.gpr(); 4336 4337 JITCompiler::Jump timerDidFire = m_jit.branchTest8(JITCompiler::NonZero, 4338 JITCompiler::AbsoluteAddress(m_jit.vm()->watchdog->timerDidFireAddress())); 4339 4340 addSlowPathGenerator(slowPathCall(timerDidFire, this, operationHandleWatchdogTimer, unusedGPR)); 4341 break; 4342 } 4340 4343 4341 4344 case Phantom: -
TabularUnified trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp ¶
r188624 r188649 120 120 case CheckNotEmpty: 121 121 case CheckIdent: 122 case CheckWatchdogTimer: 122 123 case StringCharCodeAt: 123 124 case AllocatePropertyStorage: -
TabularUnified trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp ¶
r188624 r188649 52 52 #include "ScopedArgumentsTable.h" 53 53 #include "VirtualRegister.h" 54 #include "Watchdog.h" 54 55 #include <atomic> 55 56 #include <dlfcn.h> … … 829 830 case MaterializeCreateActivation: 830 831 compileMaterializeCreateActivation(); 832 break; 833 case CheckWatchdogTimer: 834 compileCheckWatchdogTimer(); 831 835 break; 832 836 … … 5429 5433 } 5430 5434 5435 void compileCheckWatchdogTimer() 5436 { 5437 LBasicBlock timerDidFire = FTL_NEW_BLOCK(m_out, ("CheckWatchdogTimer timer did fire")); 5438 LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CheckWatchdogTimer continuation")); 5439 5440 LValue state = m_out.load8(m_out.absolute(vm().watchdog->timerDidFireAddress())); 5441 m_out.branch(m_out.equal(state, m_out.constInt8(0)), 5442 usually(continuation), rarely(timerDidFire)); 5443 5444 LBasicBlock lastNext = m_out.appendTo(timerDidFire, continuation); 5445 5446 vmCall(m_out.operation(operationHandleWatchdogTimer), m_callFrame); 5447 m_out.jump(continuation); 5448 5449 m_out.appendTo(continuation, lastNext); 5450 } 5451 5431 5452 bool isInlinableSize(LValue function) 5432 5453 { -
TabularUnified trunk/Source/JavaScriptCore/jit/JIT.h ¶
r188545 r188649 740 740 MacroAssembler::Call callOperation(J_JITOperation_EZ, int, int32_t); 741 741 MacroAssembler::Call callOperation(J_JITOperation_EZZ, int, int32_t, int32_t); 742 MacroAssembler::Call callOperation(P_JITOperation_E); 742 743 MacroAssembler::Call callOperation(P_JITOperation_EJS, GPRReg, size_t); 743 744 MacroAssembler::Call callOperation(S_JITOperation_ECC, RegisterID, RegisterID); -
TabularUnified trunk/Source/JavaScriptCore/jit/JITInlines.h ¶
r188545 r188649 188 188 } 189 189 190 ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(P_JITOperation_E operation) 191 { 192 setupArgumentsExecState(); 193 return appendCallWithExceptionCheck(operation); 194 } 195 190 196 ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(C_JITOperation_E operation) 191 197 { -
TabularUnified trunk/Source/JavaScriptCore/jit/JITOperations.cpp ¶
r188545 r188649 989 989 } 990 990 991 void JIT_OPERATION operationHandleWatchdogTimer(ExecState* exec) 991 // The only reason for returning an UnusedPtr (instead of void) is so that we can reuse the 992 // existing DFG slow path generator machinery when creating the slow path for CheckWatchdogTimer 993 // in the DFG. If a DFG slow path generator that supports a void return type is added in the 994 // future, we can switch to using that then. 995 UnusedPtr JIT_OPERATION operationHandleWatchdogTimer(ExecState* exec) 992 996 { 993 997 VM& vm = exec->vm(); … … 996 1000 if (UNLIKELY(vm.watchdog && vm.watchdog->didFire(exec))) 997 1001 vm.throwException(exec, createTerminatedExecutionException(&vm)); 1002 1003 return nullptr; 998 1004 } 999 1005 -
TabularUnified trunk/Source/JavaScriptCore/jit/JITOperations.h ¶
r188545 r188649 51 51 52 52 extern "C" { 53 54 typedef char* UnusedPtr; 53 55 54 56 // These typedefs provide typechecking when generating calls out to helper routines; … … 294 296 JSCell* JIT_OPERATION operationNewObject(ExecState*, Structure*) WTF_INTERNAL; 295 297 EncodedJSValue JIT_OPERATION operationNewRegexp(ExecState*, void*) WTF_INTERNAL; 296 voidJIT_OPERATION operationHandleWatchdogTimer(ExecState*) WTF_INTERNAL;298 UnusedPtr JIT_OPERATION operationHandleWatchdogTimer(ExecState*) WTF_INTERNAL; 297 299 void JIT_OPERATION operationThrowStaticError(ExecState*, EncodedJSValue, int32_t) WTF_INTERNAL; 298 300 void JIT_OPERATION operationThrow(ExecState*, EncodedJSValue) WTF_INTERNAL;
Note:
See TracChangeset
for help on using the changeset viewer.