diff --git a/Makefile.in b/Makefile.in index 1130ab53d5d..ef1701a61e8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -125,10 +125,7 @@ ifdef TRACE CFG_RUSTC_FLAGS += -Z trace endif ifdef CFG_DISABLE_RPATH -# NOTE: make this CFG_RUSTC_FLAGS after stage0 snapshot -RUSTFLAGS_STAGE1 += -C no-rpath -RUSTFLAGS_STAGE2 += -C no-rpath -RUSTFLAGS_STAGE3 += -C no-rpath +CFG_RUSTC_FLAGS += -C no-rpath endif # The executables crated during this compilation process have no need to include @@ -140,8 +137,7 @@ endif # snapshot will be generated with a statically linked rustc so we only have to # worry about the distribution of one file (with its native dynamic # dependencies) -# -# NOTE: after a snapshot (stage0), put this on stage0 as well +RUSTFLAGS_STAGE0 += -C prefer-dynamic RUSTFLAGS_STAGE1 += -C prefer-dynamic # platform-specific auto-configuration diff --git a/src/libextra/lib.rs b/src/libextra/lib.rs index e0200f48cfe..c630ac096f6 100644 --- a/src/libextra/lib.rs +++ b/src/libextra/lib.rs @@ -35,20 +35,10 @@ Rust extras are part of the standard Rust distribution. #[deny(missing_doc)]; extern mod sync; -#[cfg(not(stage0))] extern mod serialize; extern mod collections; -#[cfg(stage0)] -pub mod serialize { - #[allow(missing_doc)]; - // Temp re-export until after a snapshot - extern mod serialize = "serialize"; - pub use self::serialize::{Encoder, Decoder, Encodable, Decodable, - EncoderHelpers, DecoderHelpers}; -} - // Utility modules pub mod c_vec; diff --git a/src/libstd/cleanup.rs b/src/libstd/cleanup.rs index a43dca94970..dd43d8e2971 100644 --- a/src/libstd/cleanup.rs +++ b/src/libstd/cleanup.rs @@ -57,53 +57,6 @@ fn debug_mem() -> bool { } /// Destroys all managed memory (i.e. @ boxes) held by the current task. -#[cfg(stage0)] -pub unsafe fn annihilate() { - use rt::local_heap::local_free; - - let mut n_total_boxes = 0u; - - // Pass 1: Make all boxes immortal. - // - // In this pass, nothing gets freed, so it does not matter whether - // we read the next field before or after the callback. - each_live_alloc(true, |alloc| { - n_total_boxes += 1; - (*alloc).ref_count = RC_IMMORTAL; - true - }); - - // Pass 2: Drop all boxes. - // - // In this pass, unique-managed boxes may get freed, but not - // managed boxes, so we must read the `next` field *after* the - // callback, as the original value may have been freed. - each_live_alloc(false, |alloc| { - let tydesc = (*alloc).type_desc; - let data = &(*alloc).data as *(); - ((*tydesc).drop_glue)(data as *i8); - true - }); - - // Pass 3: Free all boxes. - // - // In this pass, managed boxes may get freed (but not - // unique-managed boxes, though I think that none of those are - // left), so we must read the `next` field before, since it will - // not be valid after. - each_live_alloc(true, |alloc| { - local_free(alloc as *u8); - true - }); - - if debug_mem() { - // We do logging here w/o allocation. - debug!("total boxes annihilated: {}", n_total_boxes); - } -} - -/// Destroys all managed memory (i.e. @ boxes) held by the current task. -#[cfg(not(stage0))] pub unsafe fn annihilate() { use rt::local_heap::local_free; diff --git a/src/libstd/reflect.rs b/src/libstd/reflect.rs index 1c22408592a..f88da60ae9b 100644 --- a/src/libstd/reflect.rs +++ b/src/libstd/reflect.rs @@ -441,11 +441,4 @@ impl TyVisitor for MovePtrAdaptor { self.align_to::<&'static u8>(); true } - - // NOTE Remove after next snapshot. - #[cfg(stage0)] - fn visit_type(&mut self) -> bool { - if ! self.inner.visit_type() { return false; } - true - } } diff --git a/src/libstd/repr.rs b/src/libstd/repr.rs index 4ced74a92b7..dc745ff548f 100644 --- a/src/libstd/repr.rs +++ b/src/libstd/repr.rs @@ -601,10 +601,6 @@ impl<'a> TyVisitor for ReprVisitor<'a> { fn visit_param(&mut self, _i: uint) -> bool { true } fn visit_self(&mut self) -> bool { true } - - // NOTE Remove after next snapshot. - #[cfg(stage0)] - fn visit_type(&mut self) -> bool { true } } pub fn write_repr(writer: &mut io::Writer, object: &T) -> io::IoResult<()> { diff --git a/src/libstd/rt/global_heap.rs b/src/libstd/rt/global_heap.rs index 2f553585f38..4bce16706ee 100644 --- a/src/libstd/rt/global_heap.rs +++ b/src/libstd/rt/global_heap.rs @@ -10,8 +10,6 @@ use libc::{c_void, size_t, free, malloc, realloc}; use ptr::{RawPtr, mut_null}; -#[cfg(stage0)] -use unstable::intrinsics::TyDesc; use unstable::intrinsics::abort; use unstable::raw; use mem::size_of; @@ -75,15 +73,7 @@ pub unsafe fn exchange_malloc(size: uint) -> *u8 { } // FIXME: #7496 -#[cfg(not(test), stage0)] -#[lang="closure_exchange_malloc"] -#[inline] -pub unsafe fn closure_exchange_malloc_(td: *u8, size: uint) -> *u8 { - closure_exchange_malloc(td, size) -} - -// FIXME: #7496 -#[cfg(not(test), not(stage0))] +#[cfg(not(test))] #[lang="closure_exchange_malloc"] #[inline] pub unsafe fn closure_exchange_malloc_(drop_glue: fn(*mut u8), size: uint, align: uint) -> *u8 { @@ -91,24 +81,6 @@ pub unsafe fn closure_exchange_malloc_(drop_glue: fn(*mut u8), size: uint, align } #[inline] -#[cfg(stage0)] -pub unsafe fn closure_exchange_malloc(td: *u8, size: uint) -> *u8 { - let td = td as *TyDesc; - let size = size; - - assert!(td.is_not_null()); - - let total_size = get_box_size(size, (*td).align); - let p = malloc_raw(total_size); - - let alloc = p as *mut raw::Box<()>; - (*alloc).type_desc = td; - - alloc as *u8 -} - -#[inline] -#[cfg(not(stage0))] pub unsafe fn closure_exchange_malloc(drop_glue: fn(*mut u8), size: uint, align: uint) -> *u8 { let total_size = get_box_size(size, align); let p = malloc_raw(total_size); diff --git a/src/libstd/rt/local_heap.rs b/src/libstd/rt/local_heap.rs index 3bee9e48b60..023f712d3a0 100644 --- a/src/libstd/rt/local_heap.rs +++ b/src/libstd/rt/local_heap.rs @@ -21,8 +21,6 @@ use rt::env; use rt::global_heap; use rt::local::Local; use rt::task::Task; -#[cfg(stage0)] -use unstable::intrinsics::TyDesc; use unstable::raw; use vec::ImmutableVector; @@ -61,29 +59,6 @@ impl LocalHeap { } #[inline] - #[cfg(stage0)] - pub fn alloc(&mut self, td: *TyDesc, size: uint) -> *mut Box { - let total_size = global_heap::get_box_size(size, unsafe { (*td).align }); - let alloc = self.memory_region.malloc(total_size); - { - // Make sure that we can't use `mybox` outside of this scope - let mybox: &mut Box = unsafe { cast::transmute(alloc) }; - // Clear out this box, and move it to the front of the live - // allocations list - mybox.type_desc = td; - mybox.ref_count = 1; - mybox.prev = ptr::mut_null(); - mybox.next = self.live_allocs; - if !self.live_allocs.is_null() { - unsafe { (*self.live_allocs).prev = alloc; } - } - self.live_allocs = alloc; - } - return alloc; - } - - #[inline] - #[cfg(not(stage0))] pub fn alloc(&mut self, drop_glue: fn(*mut u8), size: uint, align: uint) -> *mut Box { let total_size = global_heap::get_box_size(size, align); let alloc = self.memory_region.malloc(total_size); @@ -126,41 +101,6 @@ impl LocalHeap { } #[inline] - #[cfg(stage0)] - pub fn free(&mut self, alloc: *mut Box) { - { - // Make sure that we can't use `mybox` outside of this scope - let mybox: &mut Box = unsafe { cast::transmute(alloc) }; - assert!(!mybox.type_desc.is_null()); - - // Unlink it from the linked list - if !mybox.prev.is_null() { - unsafe { (*mybox.prev).next = mybox.next; } - } - if !mybox.next.is_null() { - unsafe { (*mybox.next).prev = mybox.prev; } - } - if self.live_allocs == alloc { - self.live_allocs = mybox.next; - } - - // Destroy the box memory-wise - if self.poison_on_free { - unsafe { - let ptr: *mut u8 = cast::transmute(&mybox.data); - ptr::set_memory(ptr, 0xab, (*mybox.type_desc).size); - } - } - mybox.prev = ptr::mut_null(); - mybox.next = ptr::mut_null(); - mybox.type_desc = ptr::null(); - } - - self.memory_region.free(alloc); - } - - #[inline] - #[cfg(not(stage0))] pub fn free(&mut self, alloc: *mut Box) { { // Make sure that we can't use `mybox` outside of this scope @@ -339,20 +279,6 @@ impl Drop for MemoryRegion { } #[inline] -#[cfg(stage0)] -pub unsafe fn local_malloc(td: *u8, size: uint) -> *u8 { - // FIXME: Unsafe borrow for speed. Lame. - let task: Option<*mut Task> = Local::try_unsafe_borrow(); - match task { - Some(task) => { - (*task).heap.alloc(td as *TyDesc, size) as *u8 - } - None => rtabort!("local malloc outside of task") - } -} - -#[inline] -#[cfg(not(stage0))] pub unsafe fn local_malloc(drop_glue: fn(*mut u8), size: uint, align: uint) -> *u8 { // FIXME: Unsafe borrow for speed. Lame. let task: Option<*mut Task> = Local::try_unsafe_borrow(); diff --git a/src/libstd/unstable/intrinsics.rs b/src/libstd/unstable/intrinsics.rs index b9e9c9d5a43..c983d82563c 100644 --- a/src/libstd/unstable/intrinsics.rs +++ b/src/libstd/unstable/intrinsics.rs @@ -160,10 +160,6 @@ pub trait TyVisitor { fn visit_trait(&mut self, name: &str) -> bool; fn visit_param(&mut self, i: uint) -> bool; fn visit_self(&mut self) -> bool; - - // NOTE Remove after next snapshot. - #[cfg(stage0)] - fn visit_type(&mut self) -> bool; } extern "rust-intrinsic" { diff --git a/src/libstd/unstable/lang.rs b/src/libstd/unstable/lang.rs index a85f26720bf..4648f149a9f 100644 --- a/src/libstd/unstable/lang.rs +++ b/src/libstd/unstable/lang.rs @@ -27,14 +27,6 @@ pub fn fail_bounds_check(file: *u8, line: uint, index: uint, len: uint) -> ! { } #[lang="malloc"] -#[cfg(stage0)] -#[inline] -pub unsafe fn local_malloc(td: *u8, size: uint) -> *u8 { - ::rt::local_heap::local_malloc(td, size) -} - -#[lang="malloc"] -#[cfg(not(stage0))] #[inline] pub unsafe fn local_malloc(drop_glue: fn(*mut u8), size: uint, align: uint) -> *u8 { ::rt::local_heap::local_malloc(drop_glue, size, align) diff --git a/src/libstd/unstable/raw.rs b/src/libstd/unstable/raw.rs index 98dde95d3b7..87547997798 100644 --- a/src/libstd/unstable/raw.rs +++ b/src/libstd/unstable/raw.rs @@ -9,21 +9,8 @@ // except according to those terms. use cast; -#[cfg(stage0)] -use unstable::intrinsics::TyDesc; /// The representation of a Rust managed box -#[cfg(stage0)] -pub struct Box { - ref_count: uint, - type_desc: *TyDesc, - prev: *mut Box, - next: *mut Box, - data: T -} - -/// The representation of a Rust managed box -#[cfg(not(stage0))] pub struct Box { ref_count: uint, drop_glue: fn(ptr: *mut u8), diff --git a/src/snapshots.txt b/src/snapshots.txt index 8cf463dd88a..2db884fdb64 100644 --- a/src/snapshots.txt +++ b/src/snapshots.txt @@ -1,3 +1,11 @@ +S 2014-02-12 c62f6ce + freebsd-x86_64 737a423c5f803119ff5a692eac432fa9d0c595a8 + linux-i386 a7e90e27e8b6a3fa79ddc15f0ed217ccbade875d + linux-x86_64 8f5fdf9f07b2afbc55d8d8c06c60aeb532b5ea83 + macos-i386 57bb225f45bc57fef4c34552a2d5814ab4913087 + macos-x86_64 d37b62478aa1c1dd1babb19d1df494d2aaf59c4c + winnt-i386 2c5c5f7228140cd79f120201805504a9e07ad245 + S 2014-02-03 346d378 freebsd-x86_64 d369c1a83a2be6eb42bd0e550a1adc38ffed0804 linux-i386 a6d4ab441f5b285d7aecbb940fa733526b413f34