Bug 714050 - Make JS source compression thread optional (r=luke)
authorBill McCloskey <wmccloskey@mozilla.com>
Tue, 16 Oct 2012 11:57:11 -0700
changeset 110732 35b7bc10cc4289773f3add34907863861c9ef9b5
parent 110731 15791e9e6e5de027033d41af4013493adb9a8660
child 110733 cced04530e2f56dff6b4955756090340c9d5c335
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersluke
bugs714050
milestone19.0a1
Bug 714050 - Make JS source compression thread optional (r=luke)
js/src/jsscript.cpp
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -1147,17 +1147,17 @@ ScriptSource::setSourceCopy(JSContext *c
     const size_t nbytes = length * sizeof(jschar);
     data.compressed = static_cast<unsigned char *>(cx->malloc_(nbytes));
     if (!data.compressed)
         return false;
     length_ = length;
     argumentsNotIncluded_ = argumentsNotIncluded;
 
 #ifdef JS_THREADSAFE
-    if (tok) {
+    if (tok && cx->runtime->useHelperThreads()) {
 #ifdef DEBUG
         ready_ = false;
 #endif
         tok->ss = this;
         tok->chars = src.get();
         cx->runtime->sourceCompressorThread.compress(tok);
     } else
 #endif