Skip to content

Commit

Permalink
Fix rebasing error
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Stjepan Glavina committed Apr 7, 2016
1 parent 39ab006 commit 4f34422
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 11 additions & 1 deletion components/script/script_runtime.rs
Expand Up @@ -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};
Expand All @@ -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
Expand Down Expand Up @@ -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
}

Expand Down
1 change: 0 additions & 1 deletion components/script/script_thread.rs
Expand Up @@ -101,7 +101,6 @@ use task_source::user_interaction::UserInteractionTaskSource;
use time::Tm;
use url::Url;
use util::opts;
use util::prefs::get_pref;
use util::str::DOMString;
use util::thread;
use util::thread_state;
Expand Down

0 comments on commit 4f34422

Please sign in to comment.