Bug 1359653: Part 4 - Fallback to the default JS version when decoding regexps off-thread. r=shu
☠☠ backed out by acad0b815fbe ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Fri, 28 Apr 2017 11:55:52 -0700
changeset 407403 16259c1af36e138881d18a3f8b0a803f5d4fc3ec
parent 407402 b49bd726c8a6e955c672df17b2b9134ab3ad34d5
child 407404 1c7df945505930d2d86a076ee20807104324c8cc
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshu
bugs1359653
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1359653: Part 4 - Fallback to the default JS version when decoding regexps off-thread. r=shu When decoding off-thread, we can't safely access the JS runtime to get the current JS version, and doing so causes failed assertions. MozReview-Commit-ID: Lra437aa8SM
js/src/jscntxt.cpp
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -1444,16 +1444,19 @@ JSVersion
 JSContext::findVersion()
 {
     if (JSScript* script = currentScript(nullptr, ALLOW_CROSS_COMPARTMENT))
         return script->getVersion();
 
     if (compartment() && compartment()->behaviors().version() != JSVERSION_UNKNOWN)
         return compartment()->behaviors().version();
 
+    if (!CurrentThreadCanAccessRuntime(runtime()))
+        return JSVERSION_DEFAULT;
+
     return runtime()->defaultVersion();
 }
 
 #ifdef DEBUG
 
 JS::AutoCheckRequestDepth::AutoCheckRequestDepth(JSContext* cxArg)
   : cx(cxArg->helperThread() ? nullptr : cxArg)
 {