Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a

This commit is contained in:
Jack Moffitt 2014-11-05 12:33:11 -07:00 committed by Glenn Watson
parent 26045d7fcb
commit d1b433a3b3
160 changed files with 1427 additions and 1162 deletions

View file

@ -94,7 +94,7 @@ impl<T: Reflectable> Temporary<T> {
pub fn root<'a, 'b>(self) -> Root<'a, 'b, T> {
let collection = StackRoots.get().unwrap();
unsafe {
(**collection).new_root(&self.inner)
Root::new(&**collection, &self.inner)
}
}
@ -171,7 +171,7 @@ impl<T: Reflectable> JS<T> {
pub fn root<'a, 'b>(&self) -> Root<'a, 'b, T> {
let collection = StackRoots.get().unwrap();
unsafe {
(**collection).new_root(self)
Root::new(&**collection, self)
}
}
}
@ -431,18 +431,12 @@ impl RootCollection {
}
}
/// Create a new stack-bounded root that will not outlive this collection
#[allow(unrooted_must_root)]
fn new_root<'b, 'a: 'b, T: Reflectable>(&'a self, unrooted: &JS<T>) -> Root<'a, 'b, T> {
Root::new(self, unrooted)
}
/// Track a stack-based root to ensure LIFO root ordering
fn root<'a, 'b, T: Reflectable>(&self, untracked: &Root<'a, 'b, T>) {
unsafe {
let roots = self.roots.get();
(*roots).push(untracked.js_ptr);
debug!(" rooting {:?}", untracked.js_ptr);
debug!(" rooting {}", untracked.js_ptr);
}
}
@ -450,7 +444,7 @@ impl RootCollection {
fn unroot<'a, 'b, T: Reflectable>(&self, rooted: &Root<'a, 'b, T>) {
unsafe {
let roots = self.roots.get();
debug!("unrooting {:?} (expecting {:?}",
debug!("unrooting {} (expecting {}",
(*roots).as_slice().last().unwrap(),
rooted.js_ptr);
assert!(*(*roots).as_slice().last().unwrap() == rooted.js_ptr);