Bug 147968

Summary: Add support for CheckWatchdogTimer as slow path in DFG and FTL.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, fpizlo, ggaren, keith_miller, mmirman, msaboff, saam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 148125    
Bug Blocks: 131082    
Attachments:
Description Flags
the fix. msaboff: review+

Description Mark Lam 2015-08-12 22:19:08 PDT
Since we don't currently enable the JSC watchdog by default, Web Worker's terminate() function doesn't actually do anything.  We should fix this.
Comment 1 Mark Lam 2015-08-14 14:03:37 PDT
Per discussion with Geoff, we can fix this by always enabling the watchdog without a time limit for Web Workers.

But before we do that, we should teach the FTL to check the watchdog when present.  Since the FTL watchdog support is mostly motivated by the need in Web Workers, I'll tackle the FTL in this bug as well.
Comment 2 Mark Lam 2015-08-18 01:32:44 PDT
Will just implement the FTL support (and improve the DFG support) in this bug.  Will add the Worker threads watchdog in 131082 instead where we re-work how Watchdog's m_didFire works.
Comment 3 Mark Lam 2015-08-18 15:03:46 PDT
Created attachment 259302 [details]
the fix.
Comment 4 Michael Saboff 2015-08-19 14:03:55 PDT
Comment on attachment 259302 [details]
the fix.

View in context: https://bugs.webkit.org/attachment.cgi?id=259302&action=review

r=me

> Source/JavaScriptCore/jit/JITOperations.cpp:991
> -void JIT_OPERATION operationHandleWatchdogTimer(ExecState* exec)
> +UnusedPtr JIT_OPERATION operationHandleWatchdogTimer(ExecState* exec)

Why does this return UnusedPtr?
Comment 5 Michael Saboff 2015-08-19 14:04:14 PDT
Comment on attachment 259302 [details]
the fix.

r=me
Comment 6 Mark Lam 2015-08-19 14:09:44 PDT
Comment on attachment 259302 [details]
the fix.

View in context: https://bugs.webkit.org/attachment.cgi?id=259302&action=review

>> Source/JavaScriptCore/jit/JITOperations.cpp:991
>> +UnusedPtr JIT_OPERATION operationHandleWatchdogTimer(ExecState* exec)
> 
> Why does this return UnusedPtr?

As explained in the ChangeLog, "This allows me to reuse the existing DFG slow path generator mechanism.  I didn't think that operationHandleWatchdogTimer() was worth introducing a whole new set of machinery just so we can have a slow path that returns void."  I'll add a comment here as well to document this.
Comment 7 Mark Lam 2015-08-19 14:19:19 PDT
Thanks for the review.  Landed in r188649: <http://trac.webkit.org/r188649>.