diff options
author | Stjepan Glavina <stjepang@gmail.com> | 2016-04-07 22:49:13 +0200 |
---|---|---|
committer | Stjepan Glavina <stjepang@gmail.com> | 2016-04-07 22:49:13 +0200 |
commit | 4f344224744a1df3b2c6c4f5d396214347d44a1c (patch) | |
tree | 5738424de73fcf3fc5995d2ab8ef3745c2a31ad6 /components/script/script_runtime.rs | |
parent | 39ab006c8f71404d2fcd81f7715b7b9e47d5aead (diff) | |
download | servo-4f344224744a1df3b2c6c4f5d396214347d44a1c.tar.gz servo-4f344224744a1df3b2c6c4f5d396214347d44a1c.zip |
Fix rebasing error
This PR mistakenly removed JIT enabling/disabling by preference:
https://github.com/servo/servo/pull/10342/files
Look for `get_pref`.
I'm putting the missing piece of code into the appropriate place in
script_runtime.rs
Diffstat (limited to 'components/script/script_runtime.rs')
-rw-r--r-- | components/script/script_runtime.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs index 35c0bdd618f..509a7e93e71 100644 --- a/components/script/script_runtime.rs +++ b/components/script/script_runtime.rs @@ -13,7 +13,7 @@ use js::glue::CollectServoSizes; use js::jsapi::{DisableIncrementalGC, GCDescription, GCProgress}; use js::jsapi::{JSContext, JS_GetRuntime, JSRuntime, JSTracer, SetDOMCallbacks, SetGCSliceCallback}; use js::jsapi::{JSGCInvocationKind, JSGCStatus, JS_AddExtraGCRootsTracer, JS_SetGCCallback}; -use js::jsapi::{JSObject, SetPreserveWrapperCallback}; +use js::jsapi::{JSObject, RuntimeOptionsRef, SetPreserveWrapperCallback}; use js::rust::Runtime; use libc; use profile_traits::mem::{Report, ReportKind, ReportsChan}; @@ -24,6 +24,7 @@ use std::marker::PhantomData; use std::ptr; use time::{Tm, now}; use util::opts; +use util::prefs::get_pref; use util::thread_state; /// Common messages used to control the event loops in both the script and the worker @@ -121,6 +122,15 @@ pub fn new_rt_and_cx() -> Runtime { DisableIncrementalGC(runtime.rt()); } + // Enable or disable the JITs. + let rt_opts = unsafe { &mut *RuntimeOptionsRef(runtime.rt()) }; + if let Some(val) = get_pref("js.baseline.enabled").as_boolean() { + rt_opts.set_baseline_(val); + } + if let Some(val) = get_pref("js.ion.enabled").as_boolean() { + rt_opts.set_ion_(val); + } + runtime } |