[gjs/wip/ptomato/mozjs31: 7/8] WIP - Remove deprecated JS_{Get, Set}Options



commit ebde9e294ddcc79cc278fca1701d5f491acf52e1
Author: Philip Chimento <philip endlessm com>
Date:   Tue Oct 25 15:22:03 2016 -0700

    WIP - Remove deprecated JS_{Get,Set}Options

 gjs/coverage.cpp   |    6 ++++--
 gjs/jsapi-util.cpp |    6 +++++-
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/gjs/coverage.cpp b/gjs/coverage.cpp
index 242491c..f53538a 100644
--- a/gjs/coverage.cpp
+++ b/gjs/coverage.cpp
@@ -1698,8 +1698,10 @@ gjs_coverage_constructed(GObject *object)
     JSContext *context = (JSContext *) gjs_context_get_native_context(priv->context);
 
     /* Before bootstrapping, turn off the JIT on the context */
-    guint32 options_flags = JS_GetOptions(context) & ~(JSOPTION_ION | JSOPTION_BASELINE | JSOPTION_ASMJS);
-    JS_SetOptions(context, options_flags);
+    JS::RuntimeOptions options(JS::RuntimeOptionsRef(context));
+    options.setIon(false)
+        .setBaseline(false)
+        .setAsmJS(false);
 
     if (!bootstrap_coverage(coverage)) {
         JSAutoCompartment compartment(context, gjs_get_import_global(context));
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index 5e29b31..eded79a 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -65,6 +65,7 @@ bool
 gjs_init_context_standard (JSContext              *context,
                            JS::MutableHandleObject global)
 {
+    JS::RuntimeOptions runtime_options(JS::RuntimeOptionsRef(context));
     JS::CompartmentOptions options;
     guint32 options_flags;
 
@@ -78,7 +79,10 @@ gjs_init_context_standard (JSContext              *context,
 
     if (!g_getenv("GJS_DISABLE_JIT")) {
         gjs_debug(GJS_DEBUG_CONTEXT, "Enabling JIT");
-        options_flags |= JSOPTION_TYPE_INFERENCE | JSOPTION_ION | JSOPTION_BASELINE | JSOPTION_ASMJS;
+        runtime_options.setIon(true)
+            .setBaseline(true)
+            .setAsmJS(true);
+        options_flags |= JSOPTION_TYPE_INFERENCE;
     }
 
     if (!g_getenv("GJS_DISABLE_EXTRA_WARNINGS")) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]