WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 151972
147998
Implement JSC watchdog support for tail calls
https://bugs.webkit.org/show_bug.cgi?id=147998
Summary
Implement JSC watchdog support for tail calls
Mark Lam
Reported
2015-08-13 16:07:47 PDT
The existing JSC watchdog mechanism relies on the fact that no JS code can run for long before hitting a loop hint. The only exception to that would be infinitely recursing code, but that would hit a stack overflow eventually and terminate. With the support for tail calls added, we can now have a JS script hang by doing infinite recursion without every hitting a stack overflow. We should teach the watchdog to handle this as well. Fun!
Attachments
Add attachment
proposed patch, testcase, etc.
Mark Lam
Comment 1
2015-08-13 16:15:28 PDT
I plan to implement this by having the watchdog timer simulate a stack overflow, and teaching the existing stack check slow path code in function prologues to discern between a stack overflow and a watchdog timer check request. Unlike with stack overflows, the stack check slow path can return without throwing an exception. This is because the watchdog timer firing only means that we need to check the watchdog's deadlines. It doesn't necessarily mean that the watchdog fired. We will only throw the TerminatedExecutionException if the watchdog deadlines have been reached. Hence, I'll also have to teach the function prologues to not expect that the stack check slow path will throw unconditionally.
Mark Lam
Comment 2
2015-08-14 14:38:20 PDT
I spoke with Geoff offline. Per our discussion, we won't overload the stack check. Instead, will add a watchdog check to the tail call opcode. The DFG and FTL can optimize these away if appropriate.
Mark Lam
Comment 3
2015-12-08 12:37:55 PST
*** This bug has been marked as a duplicate of
bug 151972
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug