From 1ac9c65ed049120cb2f4685ca92f6a55687a82f9 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 22 Mar 2018 13:00:33 -0400 Subject: [PATCH] jsauthority: change how JIT is disabled JS_SetOptions seems to be replaced with JS::ContextOptionsRef now. Also, disabling the JIT seems to be three options now instead of just one. Signed-off-by: Ray Strode https://bugs.freedesktop.org/show_bug.cgi?id=105865 --- src/polkitbackend/polkitbackendjsauthority.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp index 9fe151b..394e743 100644 --- a/src/polkitbackend/polkitbackendjsauthority.cpp +++ b/src/polkitbackend/polkitbackendjsauthority.cpp @@ -437,63 +437,64 @@ setup_file_monitors (PolkitBackendJsAuthority *authority) } else { g_signal_connect (monitor, "changed", G_CALLBACK (on_dir_monitor_changed), authority); g_ptr_array_add (p, monitor); } } g_ptr_array_add (p, NULL); authority->priv->dir_monitors = (GFileMonitor**) g_ptr_array_free (p, FALSE); } static void polkit_backend_js_authority_constructed (GObject *object) { PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (object); gboolean entered_request = FALSE; authority->priv->cx = JS_NewContext (8L * 1024L * 1024L); if (authority->priv->cx == NULL) goto fail; if (!JS::InitSelfHostedCode (authority->priv->cx)) goto fail; /* TODO: JIT'ing doesn't work will with killing runaway scripts... I think * this is just a SpiderMonkey bug. So disable the JIT for now. */ - JS_SetOptions (authority->priv->cx, - JSOPTION_VAROBJFIX - /* | JSOPTION_JIT | JSOPTION_METHODJIT*/); + JS::ContextOptionsRef (authority->priv->cx) + .setIon (FALSE) + .setBaseline (FALSE) + .setAsmJS (FALSE); JS_SetErrorReporter(authority->priv->cx, report_error); JS_SetContextPrivate (authority->priv->cx, authority); JS_BeginRequest(authority->priv->cx); entered_request = TRUE; { JS::CompartmentOptions compart_opts; compart_opts.behaviors().setVersion(JSVERSION_LATEST); authority->priv->js_global = JS_NewGlobalObject (authority->priv->cx, &js_global_class, NULL, compart_opts); if (authority->priv->js_global == NULL) goto fail; authority->priv->ac = new JSAutoCompartment(authority->priv->cx, authority->priv->js_global); if (authority->priv->ac == NULL) goto fail; JS_AddObjectRoot (authority->priv->cx, &authority->priv->js_global); if (!JS_InitStandardClasses (authority->priv->cx, authority->priv->js_global)) goto fail; authority->priv->js_polkit = JS_DefineObject (authority->priv->cx, authority->priv->js_global, "polkit", &js_polkit_class, NULL, JSPROP_ENUMERATE); -- 2.16.2