There have been reports of flaky failures on the scope.releaseAssertNoException() after the call to JSMap::create() in JSModuleLoader::finishCreation().
The scope.releaseAssertNoException() says that we don't expect the JSMap::create() to ever throw an exception. If the assertion is true, the only way that we can see an exception there is if we're throwing an asynchronous TerminationException. Since JSModuleLoader::finishCreation() does have any long running loops, we can just DeferTerminationForAWhile and let the next exception check site throw the asynchronous TerminationException. We don't want to just use DeferTermination because it will throw the TerminationException right at the end of JSModuleLoader::finishCreation(), and the caller of JSModuleLoader::finishCreation() may be similarly not expecting an exception to be thrown there.
Also apply the same treatment to AbstractModuleRecord::finishCreation(), and getBackingMap() in WebCore for the same reason. Other than those, other sites that call JSMap::create() already check for exceptions. So, those sites do not need to DeferTerminationForAWhile.
Created attachment 433520 [details]
Created attachment 433522 [details]
Comment on attachment 433522 [details]
Thanks for the review. I'm pretty sure the jsc test failures are due to Keith's patch, which he just landed a fix for. So, I'm going to land this one.
Landed in r279924: <http://trac.webkit.org/r279924>.