diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index 832024a1c03..c8aea249a95 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -78,6 +78,7 @@ use string_cache::Atom;
use util::str::DOMString;
use util::task::spawn_named_with_send_on_failure;
use util::task_state;
+use util::opts;
use euclid::Rect;
use euclid::point::Point2D;
@@ -89,6 +90,7 @@ use js::jsapi::{JS_SetWrapObjectCallbacks, JS_AddExtraGCRootsTracer, DisableIncr
use js::jsapi::{JSContext, JSRuntime, JSTracer};
use js::jsapi::{JS_GetRuntime, JS_SetGCCallback, JSGCStatus, JSAutoRequest, SetDOMCallbacks};
use js::jsapi::{SetDOMProxyInformation, DOMProxyShadowsResult, HandleObject, HandleId, RootedValue};
+use js::jsapi::{JSGCInvocationKind, GCDescription, SetGCSliceCallback, GCProgress};
use js::jsval::UndefinedValue;
use js::rust::Runtime;
use url::{Url, UrlParser};
@@ -98,6 +100,7 @@ use std::any::Any;
use std::borrow::ToOwned;
use std::cell::{Cell, RefCell};
use std::collections::HashSet;
+use std::io::{stdout, Write};
use std::mem as std_mem;
use std::option::Option;
use std::ptr;
@@ -105,7 +108,7 @@ use std::rc::Rc;
use std::result::Result;
use std::sync::{Arc, Mutex};
use std::sync::mpsc::{channel, Sender, Receiver, Select};
-use time::Tm;
+use time::{self, Tm};
use hyper::header::{ContentType, HttpDate};
use hyper::mime::{Mime, TopLevel, SubLevel};
@@ -462,6 +465,49 @@ impl ScriptTaskFactory for ScriptTask {
}
}
+thread_local!(static GC_CYCLE_START: Cell