Bug 1160311. JITs should be enabled by default. r=jorendorff
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 30 Apr 2015 17:36:50 -0400
changeset 273319 53fadc2749bba3c6676fb5e1e27e909ef00cc089
parent 273318 2a93c3537086cedc93d1af5f69255ba5e9513908
child 273320 83082fcebedc934a8e78a5fca6dc4e858194be84
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1160311
milestone40.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 1160311. JITs should be enabled by default. r=jorendorff
js/src/jsapi-tests/testChromeBuffer.cpp
js/src/jsapi.h
--- a/js/src/jsapi-tests/testChromeBuffer.cpp
+++ b/js/src/jsapi-tests/testChromeBuffer.cpp
@@ -58,16 +58,19 @@ BEGIN_TEST(testChromeBuffer)
     JS::RootedFunction fun(cx);
 
     /*
      * Check that, even after untrusted content has exhausted the stack, code
      * compiled with "trusted principals" can run using reserved trusted-only
      * buffer space.
      */
     {
+        JSRuntimeOptions oldOptions = JS::RuntimeOptionsRef(rt);
+        // Disable the JIT because if we don't this test fails.  See bug 1160414.
+        JS::RuntimeOptionsRef(rt).setIon(false).setBaseline(false);
         {
             JSAutoCompartment ac(cx, trusted_glob);
             const char* paramName = "x";
             const char* bytes = "return x ? 1 + trusted(x-1) : 0";
             JS::CompileOptions options(cx);
             options.setFileAndLine("", 0);
             JS::AutoObjectVector emptyScopeChain(cx);
             CHECK(JS::CompileFunction(cx, emptyScopeChain, options, "trusted",
@@ -94,16 +97,17 @@ BEGIN_TEST(testChromeBuffer)
         JS::AutoObjectVector emptyScopeChain(cx);
         CHECK(JS::CompileFunction(cx, emptyScopeChain, options, "untrusted", 1,
                                   &paramName, bytes, strlen(bytes), &fun));
         CHECK(JS_DefineProperty(cx, global, "untrusted", fun, JSPROP_ENUMERATE));
 
         JS::RootedValue rval(cx);
         CHECK(JS_CallFunction(cx, JS::NullPtr(), fun, JS::HandleValueArray(v), &rval));
         CHECK(rval.toInt32() == 100);
+        JS::RuntimeOptionsRef(rt) = oldOptions;
     }
 
     /*
      * Check that content called from chrome in the reserved-buffer space
      * immediately ooms.
      */
     {
         {
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -1173,21 +1173,21 @@ JS_VersionToString(JSVersion version);
 extern JS_PUBLIC_API(JSVersion)
 JS_StringToVersion(const char* string);
 
 namespace JS {
 
 class JS_PUBLIC_API(RuntimeOptions) {
   public:
     RuntimeOptions()
-      : baseline_(false),
-        ion_(false),
-        asmJS_(false),
-        nativeRegExp_(false),
-        unboxedObjects_(false),
+      : baseline_(true),
+        ion_(true),
+        asmJS_(true),
+        nativeRegExp_(true),
+        unboxedObjects_(false), // Not enabled by default yet
         werror_(false),
         strictMode_(false),
         extraWarnings_(false),
         varObjFix_(false)
     {
     }
 
     bool baseline() const { return baseline_; }