At current, infinite javascript loops are really infinite, we need a way to detect and stop them. This currently occurs in: - bug 3552 - bug 6693 - bug 6958 This bug is here to track the development of a way to get out of this loop. All three bugs above have testcases, which could be used to test this behavior until their underlying bugs are fixed. All three of them have a root cause getting them into this infinite loop, so if these root causes are fixed they won't be useful for testing anymore.
In Radar as <rdar://problem/3895579>
*** Bug 6089 has been marked as a duplicate of this bug. ***
*** Bug 8949 has been marked as a duplicate of this bug. ***
Created attachment 8863 [details] Hang detection This implements the JSC part of a hang-detection implementation that works pretty much like the one in Mozilla. Unfortunately, when turned on this causes a performance regression in ibench. The other approach I tried (using UNIX signals) proved to be complicated and error-prone and it too gave a performance regression (albeit a smaller one)
Off. It's going to be tricky to come up with a way to do this without slowing things down!
Comment on attachment 8863 [details] Hang detection Clearing the review bit, since this was a perf. regression.
Created attachment 8872 [details] Much better patch Here's a new patch that doesn't cause any measurable slowdown at all (Less than 0.2% on ibench)
Comment on attachment 8872 [details] Much better patch r=me ggaren likes it too
Committed as r14893.
Created attachment 8886 [details] Add WebKit delegate
Comment on attachment 8886 [details] Add WebKit delegate SCRIPT_TIMEOUT_TIME_MS should be a C++ const, not a macro. The shouldInterruptScript functions could be const. The WebDefaultUIDelegate is a pretty heavyweight way to make shouldInterruptJavaScript default to no. WebFrameBridge should just say return NO -- I don't think we need this method int the WebDefaultUIDelegate.
Created attachment 8902 [details] Address comments
Created attachment 8903 [details] Address Geoff's comments I talked to Geoff on IRC and he had a couple of comments which this patch addresses.
Comment on attachment 8903 [details] Address Geoff's comments r=me and the crowd goes wild