Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Followups to the SpiderMonkey upgrade. #261

Merged
merged 2 commits into from Apr 27, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -21,15 +21,15 @@ static ERROR_FORMAT_STRING_STRING: [libc::c_char; 4] = [

/// Format string struct used to throw `TypeError`s.
static mut TYPE_ERROR_FORMAT_STRING: JSErrorFormatString = JSErrorFormatString {
name: b"TYPE_ERROR" as *const _ as *const libc::c_char,
name: b"RUSTMSG_TYPE_ERROR\0" as *const _ as *const libc::c_char,
format: &ERROR_FORMAT_STRING_STRING as *const libc::c_char,
argCount: 1,
exnType: JSExnType::JSEXN_TYPEERR as i16,
};

/// Format string struct used to throw `RangeError`s.
static mut RANGE_ERROR_FORMAT_STRING: JSErrorFormatString = JSErrorFormatString {
name: b"RANGE_ERROR" as *const _ as *const libc::c_char,
name: b"RUSTMSG_RANGE_ERROR\0" as *const _ as *const libc::c_char,
format: &ERROR_FORMAT_STRING_STRING as *const libc::c_char,
argCount: 1,
exnType: JSExnType::JSEXN_RANGEERR as i16,
@@ -511,9 +511,10 @@ impl GCMethods<Value> for Value {
impl<T: GCMethods<T> + Copy> Heap<T> {
pub fn set(&mut self, v: T) {
unsafe {
let prev = *self.ptr.get();
*self.ptr.get() = v;
T::post_barrier(self.ptr.get(), prev, v);
let ptr = self.ptr.get();
let prev = *ptr;
*ptr = v;
T::post_barrier(ptr, prev, v);
}
}

@@ -551,8 +552,9 @@ impl Default for Heap<Value> {
impl<T: GCMethods<T> + Copy> Drop for Heap<T> {
fn drop(&mut self) {
unsafe {
if !(*self.ptr.get()).is_dropped() {
T::post_barrier(self.ptr.get(), *self.ptr.get(), T::initial());
let ptr = self.ptr.get();
if !(*ptr).is_dropped() {
T::post_barrier(ptr, *ptr, T::initial());
}
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.