[gjs/wip/ptomato/mozjs31: 10/11] WIP - Remove deprecated JS_{Get, Set}Options
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/ptomato/mozjs31: 10/11] WIP - Remove deprecated JS_{Get, Set}Options
- Date: Tue, 25 Oct 2016 23:42:47 +0000 (UTC)
commit 4f4b9709710b19083863d8cd6c3e25b4fecde2c4
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 b4d3955..fe9dfa4 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_global_object(context));
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index aac6e96..1369d40 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]