Bug 1530958 - Disable unboxed objects by default r=jandem a=abillings
authorMatthew Gaudet <mgaudet@mozilla.com>
Mon, 11 Feb 2019 11:55:20 +0000
changeset 516298 8d7186b2f9a6cc4ac5f13fb4c97106de0fdbead8
parent 516297 b72048157f1839b41ea407be0606a8f3cee83e47
child 516299 13bfcad39c39edcd4e3fc5b26fd62b25d338235f
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, abillings
bugs1530958, 1525579, 1526451
milestone66.0
Bug 1530958 - Disable unboxed objects by default r=jandem a=abillings (This patch is a rollup of the folloiwing two:) Bug 1525579 - Add pref for unboxed objects r=jandem Differential Revision: https://phabricator.services.mozilla.com/D18870 *** Bug 1526451 - Disable unboxed objects by default r=jandem,tcampbell Differential Revision: https://phabricator.services.mozilla.com/D19197
js/src/jsapi.cpp
js/src/jsapi.h
js/xpconnect/src/XPCJSContext.cpp
modules/libpref/init/all.js
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -5563,16 +5563,19 @@ JS_PUBLIC_API void JS_SetGlobalJitCompil
         jit::DefaultJitOptions defaultValues;
         value = defaultValues.jumpThreshold;
       }
       jit::JitOptions.jumpThreshold = value;
       break;
     case JSJITCOMPILER_TRACK_OPTIMIZATIONS:
       jit::JitOptions.disableOptimizationTracking = !value;
       break;
+    case JSJITCOMPILER_UNBOXED_OBJECTS:
+      jit::JitOptions.disableUnboxedObjects = !value;
+      break;
     case JSJITCOMPILER_SPECTRE_INDEX_MASKING:
       jit::JitOptions.spectreIndexMasking = !!value;
       break;
     case JSJITCOMPILER_SPECTRE_OBJECT_MITIGATIONS_BARRIERS:
       jit::JitOptions.spectreObjectMitigationsBarriers = !!value;
       break;
     case JSJITCOMPILER_SPECTRE_OBJECT_MITIGATIONS_MISC:
       jit::JitOptions.spectreObjectMitigationsMisc = !!value;
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -3379,16 +3379,17 @@ extern JS_PUBLIC_API void JS_SetOffthrea
   Register(ION_ENABLE, "ion.enable") \
   Register(ION_CHECK_RANGE_ANALYSIS, "ion.check-range-analysis") \
   Register(ION_FREQUENT_BAILOUT_THRESHOLD, "ion.frequent-bailout-threshold") \
   Register(BASELINE_ENABLE, "baseline.enable") \
   Register(OFFTHREAD_COMPILATION_ENABLE, "offthread-compilation.enable") \
   Register(FULL_DEBUG_CHECKS, "jit.full-debug-checks") \
   Register(JUMP_THRESHOLD, "jump-threshold") \
   Register(TRACK_OPTIMIZATIONS, "jit.track-optimizations")\
+  Register(UNBOXED_OBJECTS, "unboxed_objects") \
   Register(SIMULATOR_ALWAYS_INTERRUPT, "simulator.always-interrupt") \
   Register(SPECTRE_INDEX_MASKING, "spectre.index-masking") \
   Register(SPECTRE_OBJECT_MITIGATIONS_BARRIERS, "spectre.object-mitigations.barriers") \
   Register(SPECTRE_OBJECT_MITIGATIONS_MISC, "spectre.object-mitigations.misc") \
   Register(SPECTRE_STRING_MITIGATIONS, "spectre.string-mitigations") \
   Register(SPECTRE_VALUE_MASKING, "spectre.value-masking") \
   Register(SPECTRE_JIT_TO_CXX_CALLS, "spectre.jit-to-C++-calls") \
   Register(WASM_FOLD_OFFSETS, "wasm.fold-offsets") \
--- a/js/xpconnect/src/XPCJSContext.cpp
+++ b/js/xpconnect/src/XPCJSContext.cpp
@@ -831,16 +831,19 @@ static void ReloadPrefsCallback(const ch
       JS_OPTIONS_DOT_STR "spectre.object_mitigations.misc");
   bool spectreStringMitigations =
       Preferences::GetBool(JS_OPTIONS_DOT_STR "spectre.string_mitigations");
   bool spectreValueMasking =
       Preferences::GetBool(JS_OPTIONS_DOT_STR "spectre.value_masking");
   bool spectreJitToCxxCalls =
       Preferences::GetBool(JS_OPTIONS_DOT_STR "spectre.jit_to_C++_calls");
 
+  bool unboxedObjects =
+      Preferences::GetBool(JS_OPTIONS_DOT_STR "unboxed_objects");
+
   sSharedMemoryEnabled =
       Preferences::GetBool(JS_OPTIONS_DOT_STR "shared_memory");
   sStreamsEnabled = Preferences::GetBool(JS_OPTIONS_DOT_STR "streams");
 
 #ifdef DEBUG
   sExtraWarningsForSystemJS =
       Preferences::GetBool(JS_OPTIONS_DOT_STR "strict.debug");
 #endif
@@ -916,16 +919,19 @@ static void ReloadPrefsCallback(const ch
                                 JSJITCOMPILER_SPECTRE_OBJECT_MITIGATIONS_MISC,
                                 spectreObjectMitigationsMisc);
   JS_SetGlobalJitCompilerOption(cx, JSJITCOMPILER_SPECTRE_STRING_MITIGATIONS,
                                 spectreStringMitigations);
   JS_SetGlobalJitCompilerOption(cx, JSJITCOMPILER_SPECTRE_VALUE_MASKING,
                                 spectreValueMasking);
   JS_SetGlobalJitCompilerOption(cx, JSJITCOMPILER_SPECTRE_JIT_TO_CXX_CALLS,
                                 spectreJitToCxxCalls);
+
+  JS_SetGlobalJitCompilerOption(cx, JSJITCOMPILER_UNBOXED_OBJECTS,
+                                unboxedObjects);
 }
 
 XPCJSContext::~XPCJSContext() {
   MOZ_COUNT_DTOR_INHERITED(XPCJSContext, CycleCollectedJSContext);
   // Elsewhere we abort immediately if XPCJSContext initialization fails.
   // Therefore the context must be non-null.
   MOZ_ASSERT(MaybeContext());
 
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1457,16 +1457,17 @@ pref("dom.event.coalesce_mouse_move",   
 
 pref("dom.ua_widget.enabled", true);
 
 pref("javascript.enabled",                  true);
 pref("javascript.options.strict",           false);
 #ifdef DEBUG
 pref("javascript.options.strict.debug",     false);
 #endif
+pref("javascript.options.unboxed_objects",  false);
 pref("javascript.options.baselinejit",      true);
 //Duplicated in JitOptions - ensure both match.
 pref("javascript.options.baselinejit.threshold", 10);
 pref("javascript.options.ion",              true);
 //Duplicated in JitOptions - ensure both match.
 pref("javascript.options.ion.threshold",    1000);
 //Duplicated in JitOptions - ensure both match.
 pref("javascript.options.ion.frequent_bailout_threshold", 10);