Skip to content
This repository was archived by the owner on Nov 12, 2022. It is now read-only.

Commit 4627586

Browse files
committed
Remove unused CustomAutoRooter API.
1 parent 28f9fb0 commit 4627586

File tree

1 file changed

+1
-41
lines changed

1 file changed

+1
-41
lines changed

src/rust.rs

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
//! Rust wrappers around the raw JS apis
66
7-
use libc::{size_t, c_uint, c_char, ptrdiff_t};
7+
use libc::{size_t, c_uint, c_char};
88
use heapsize::HeapSizeOf;
99
use std::char;
1010
use std::ffi;
@@ -26,7 +26,6 @@ use jsapi::{JS_SetErrorReporter, Evaluate2, JSErrorReport};
2626
use jsapi::{JS_SetGCParameter, JSGCParamKey};
2727
use jsapi::{Heap, HeapObjectPostBarrier, HeapValuePostBarrier};
2828
use jsapi::{ContextFriendFields};
29-
use jsapi::{CustomAutoRooter, AutoGCRooter, _vftable_CustomAutoRooter, AutoGCRooter_jspubtd_h_unnamed_1};
3029
use jsapi::{Rooted, Handle, MutableHandle, MutableHandleBase, RootedBase};
3130
use jsapi::{MutableHandleValue, HandleValue, HandleObject, HandleBase};
3231
use jsapi::AutoObjectVector;
@@ -403,45 +402,6 @@ impl<T> Drop for Rooted<T> {
403402
}
404403
}
405404

406-
impl CustomAutoRooter {
407-
pub fn new(cx: *mut JSContext, vftable: &'static _vftable_CustomAutoRooter)
408-
-> CustomAutoRooter {
409-
CustomAutoRooter::new_with_addr(cx, vftable, unsafe { return_address() })
410-
}
411-
412-
pub fn new_with_addr(cx: *mut JSContext, vftable: &'static _vftable_CustomAutoRooter, addr: *const u8) -> CustomAutoRooter {
413-
let ctxfriend: &mut ContextFriendFields = unsafe {
414-
&mut *(cx as *mut ContextFriendFields)
415-
};
416-
417-
let rooter = CustomAutoRooter {
418-
_vftable: vftable as *const _,
419-
_base: AutoGCRooter {
420-
down: ctxfriend.roots.autoGCRooters_,
421-
tag_: AutoGCRooter_jspubtd_h_unnamed_1::CUSTOM as ptrdiff_t,
422-
stackTop: &mut ctxfriend.roots.autoGCRooters_ as *mut _,
423-
}
424-
};
425-
426-
ctxfriend.roots.autoGCRooters_ = unsafe {
427-
(addr as *const *const u8).offset(1) as *const AutoGCRooter as *mut _
428-
};
429-
rooter
430-
}
431-
}
432-
433-
impl Drop for CustomAutoRooter {
434-
fn drop(&mut self) {
435-
if self._base.stackTop as usize == mem::POST_DROP_USIZE {
436-
return;
437-
}
438-
unsafe {
439-
assert!(*self._base.stackTop == mem::transmute(&self._base));
440-
*self._base.stackTop = self._base.down;
441-
}
442-
}
443-
}
444-
445405
impl Default for jsid {
446406
fn default() -> jsid { JSID_VOID }
447407
}

0 commit comments

Comments
 (0)