diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs
index b7d677a5878..bf99123f7ac 100644
--- a/components/script/dom/bindings/trace.rs
+++ b/components/script/dom/bindings/trace.rs
@@ -42,7 +42,7 @@ use hyper::header::Headers;
use hyper::method::Method;
use js::jsapi::{JSObject, JSTracer, JS_CallTracer, JSGCTraceKind};
use js::jsval::JSVal;
-use js::rust::Cx;
+use js::rust::{Cx, rt};
use layout_interface::{LayoutRPC, LayoutChan};
use libc;
use msg::constellation_msg::{PipelineId, SubpageId, WindowSizeData};
@@ -219,6 +219,7 @@ no_jsmanaged_fields!(PropertyDeclarationBlock);
no_jsmanaged_fields!(SubpageId, WindowSizeData, PipelineId);
no_jsmanaged_fields!(QuirksMode);
no_jsmanaged_fields!(Cx);
+no_jsmanaged_fields!(rt);
no_jsmanaged_fields!(Headers, Method);
no_jsmanaged_fields!(ConstellationChan);
no_jsmanaged_fields!(LayoutChan);
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index 673dc3510ef..31d6e0bf8ea 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -74,8 +74,8 @@ use util::task_state;
use geom::Rect;
use geom::point::Point2D;
use hyper::header::{LastModified, Headers};
-use js::jsapi::{JS_SetWrapObjectCallbacks, JS_SetGCZeal, JS_DEFAULT_ZEAL_FREQ};
-use js::jsapi::{JSContext, JSRuntime, JSObject};
+use js::jsapi::{JS_SetWrapObjectCallbacks, JS_SetGCZeal, JS_SetExtraGCRootsTracer, JS_DEFAULT_ZEAL_FREQ};
+use js::jsapi::{JSContext, JSRuntime, JSObject, JSTracer};
use js::jsapi::{JS_SetGCParameter, JSGC_MAX_BYTES};
use js::jsapi::{JS_SetGCCallback, JSGCStatus, JSGC_BEGIN, JSGC_END};
use js::rust::{Cx, RtUtils};
@@ -85,8 +85,10 @@ use url::Url;
use libc;
use std::any::Any;
use std::borrow::ToOwned;
-use std::cell::Cell;
+use std::cell::{Cell, RefCell};
use std::num::ToPrimitive;
+use std::option::Option;
+use std::ptr;
use std::rc::Rc;
use std::result::Result;
use std::sync::mpsc::{channel, Sender, Receiver, Select};
@@ -94,11 +96,21 @@ use std::u32;
use time::Tm;
thread_local!(pub static STACK_ROOTS: Cell