Skip to content

Commit 197fe67

Browse files
committed
register snapshots
1 parent 29070c3 commit 197fe67

File tree

7 files changed

+9
-246
lines changed

7 files changed

+9
-246
lines changed

src/libnative/lib.rs

-24
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,6 @@ static OS_DEFAULT_STACK_ESTIMATE: uint = 1 << 20;
3939
#[cfg(unix, not(android))]
4040
static OS_DEFAULT_STACK_ESTIMATE: uint = 2 * (1 << 20);
4141

42-
43-
// XXX: this should not exist here
44-
#[cfg(stage0, nativestart)]
45-
#[lang = "start"]
46-
pub fn lang_start(main: *u8, argc: int, argv: **u8) -> int {
47-
use std::cast;
48-
use std::task;
49-
50-
do start(argc, argv) {
51-
// Instead of invoking main directly on this thread, invoke it on
52-
// another spawned thread that we are guaranteed to know the size of the
53-
// stack of. Currently, we do not have a method of figuring out the size
54-
// of the main thread's stack, so for stack overflow detection to work
55-
// we must spawn the task in a subtask which we know the stack size of.
56-
let main: extern "Rust" fn() = unsafe { cast::transmute(main) };
57-
let mut task = task::task();
58-
task.name("<main>");
59-
match do task.try { main() } {
60-
Ok(()) => { os::set_exit_status(0); }
61-
Err(..) => { os::set_exit_status(rt::DEFAULT_ERROR_CODE); }
62-
}
63-
}
64-
}
65-
6642
/// Executes the given procedure after initializing the runtime with the given
6743
/// argc/argv.
6844
///

src/libstd/reflect.rs

-16
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,6 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
227227
true
228228
}
229229

230-
#[cfg(stage0)]
231-
fn visit_uniq_managed(&mut self, mtbl: uint, inner: *TyDesc) -> bool {
232-
self.align_to::<~u8>();
233-
if ! self.inner.visit_uniq_managed(mtbl, inner) { return false; }
234-
self.bump_past::<~u8>();
235-
true
236-
}
237-
238230
fn visit_ptr(&mut self, mtbl: uint, inner: *TyDesc) -> bool {
239231
self.align_to::<*u8>();
240232
if ! self.inner.visit_ptr(mtbl, inner) { return false; }
@@ -276,14 +268,6 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
276268
true
277269
}
278270

279-
#[cfg(stage0)]
280-
fn visit_evec_uniq_managed(&mut self, mtbl: uint, inner: *TyDesc) -> bool {
281-
self.align_to::<~[@u8]>();
282-
if ! self.inner.visit_evec_uniq_managed(mtbl, inner) { return false; }
283-
self.bump_past::<~[@u8]>();
284-
true
285-
}
286-
287271
fn visit_evec_slice(&mut self, mtbl: uint, inner: *TyDesc) -> bool {
288272
self.align_to::<&'static [u8]>();
289273
if ! self.inner.visit_evec_slice(mtbl, inner) { return false; }

src/libstd/repr.rs

-17
Original file line numberDiff line numberDiff line change
@@ -310,15 +310,6 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
310310
})
311311
}
312312

313-
#[cfg(stage0)]
314-
fn visit_uniq_managed(&mut self, _mtbl: uint, inner: *TyDesc) -> bool {
315-
self.writer.write(['~' as u8]);
316-
self.get::<&raw::Box<()>>(|this, b| {
317-
let p = ptr::to_unsafe_ptr(&b.data) as *c_void;
318-
this.visit_ptr_inner(p, inner);
319-
})
320-
}
321-
322313
fn visit_ptr(&mut self, mtbl: uint, _inner: *TyDesc) -> bool {
323314
self.get::<*c_void>(|this, p| {
324315
write!(this.writer, "({} as *", *p);
@@ -359,14 +350,6 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
359350
})
360351
}
361352

362-
#[cfg(stage0)]
363-
fn visit_evec_uniq_managed(&mut self, mtbl: uint, inner: *TyDesc) -> bool {
364-
self.get::<&raw::Box<raw::Vec<()>>>(|this, b| {
365-
this.writer.write(['~' as u8]);
366-
this.write_unboxed_vec_repr(mtbl, &b.data, inner);
367-
})
368-
}
369-
370353
fn visit_evec_slice(&mut self, mtbl: uint, inner: *TyDesc) -> bool {
371354
self.get::<raw::Slice<()>>(|this, s| {
372355
this.writer.write(['&' as u8]);

src/libstd/unstable/intrinsics.rs

+1-38
Original file line numberDiff line numberDiff line change
@@ -47,41 +47,8 @@ pub use realstd::unstable::intrinsics::{TyDesc, Opaque, TyVisitor, TypeId};
4747

4848
pub type GlueFn = extern "Rust" fn(*i8);
4949

50-
// NOTE remove after next snapshot
5150
#[lang="ty_desc"]
52-
#[cfg(not(test), stage0)]
53-
pub struct TyDesc {
54-
// sizeof(T)
55-
size: uint,
56-
57-
// alignof(T)
58-
align: uint,
59-
60-
// Called on a copy of a value of type `T` *after* memcpy
61-
take_glue: GlueFn,
62-
63-
// Called when a value of type `T` is no longer needed
64-
drop_glue: GlueFn,
65-
66-
// Called by drop glue when a value of type `T` can be freed
67-
free_glue: GlueFn,
68-
69-
// Called by reflection visitor to visit a value of type `T`
70-
visit_glue: GlueFn,
71-
72-
// If T represents a box pointer (`@U` or `~U`), then
73-
// `borrow_offset` is the amount that the pointer must be adjusted
74-
// to find the payload. This is always derivable from the type
75-
// `U`, but in the case of `@Trait` or `~Trait` objects, the type
76-
// `U` is unknown.
77-
borrow_offset: uint,
78-
79-
// Name corresponding to the type
80-
name: &'static str
81-
}
82-
83-
#[lang="ty_desc"]
84-
#[cfg(not(test), not(stage0))]
51+
#[cfg(not(test))]
8552
pub struct TyDesc {
8653
// sizeof(T)
8754
size: uint,
@@ -139,17 +106,13 @@ pub trait TyVisitor {
139106

140107
fn visit_box(&mut self, mtbl: uint, inner: *TyDesc) -> bool;
141108
fn visit_uniq(&mut self, mtbl: uint, inner: *TyDesc) -> bool;
142-
#[cfg(stage0)]
143-
fn visit_uniq_managed(&mut self, mtbl: uint, inner: *TyDesc) -> bool;
144109
fn visit_ptr(&mut self, mtbl: uint, inner: *TyDesc) -> bool;
145110
fn visit_rptr(&mut self, mtbl: uint, inner: *TyDesc) -> bool;
146111

147112
fn visit_vec(&mut self, mtbl: uint, inner: *TyDesc) -> bool;
148113
fn visit_unboxed_vec(&mut self, mtbl: uint, inner: *TyDesc) -> bool;
149114
fn visit_evec_box(&mut self, mtbl: uint, inner: *TyDesc) -> bool;
150115
fn visit_evec_uniq(&mut self, mtbl: uint, inner: *TyDesc) -> bool;
151-
#[cfg(stage0)]
152-
fn visit_evec_uniq_managed(&mut self, mtbl: uint, inner: *TyDesc) -> bool;
153116
fn visit_evec_slice(&mut self, mtbl: uint, inner: *TyDesc) -> bool;
154117
fn visit_evec_fixed(&mut self, n: uint, sz: uint, align: uint,
155118
mtbl: uint, inner: *TyDesc) -> bool;

src/libstd/vec.rs

-144
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,12 @@ use ptr::to_unsafe_ptr;
116116
use ptr;
117117
use ptr::RawPtr;
118118
use rt::global_heap::{malloc_raw, realloc_raw, exchange_free};
119-
#[cfg(stage0)]
120-
use rt::local_heap::local_free;
121119
use mem;
122120
use mem::size_of;
123121
use uint;
124122
use unstable::finally::Finally;
125123
use unstable::intrinsics;
126-
#[cfg(stage0)]
127-
use unstable::intrinsics::{get_tydesc, owns_managed};
128124
use unstable::raw::{Repr, Slice, Vec};
129-
#[cfg(stage0)]
130-
use unstable::raw::Box;
131125
use util;
132126

133127
/**
@@ -182,30 +176,6 @@ pub fn from_elem<T:Clone>(n_elts: uint, t: T) -> ~[T] {
182176

183177
/// Creates a new vector with a capacity of `capacity`
184178
#[inline]
185-
#[cfg(stage0)]
186-
pub fn with_capacity<T>(capacity: uint) -> ~[T] {
187-
unsafe {
188-
if owns_managed::<T>() {
189-
let mut vec = ~[];
190-
vec.reserve(capacity);
191-
vec
192-
} else {
193-
let alloc = capacity * mem::nonzero_size_of::<T>();
194-
let size = alloc + mem::size_of::<Vec<()>>();
195-
if alloc / mem::nonzero_size_of::<T>() != capacity || size < alloc {
196-
fail!("vector size is too large: {}", capacity);
197-
}
198-
let ptr = malloc_raw(size) as *mut Vec<()>;
199-
(*ptr).alloc = alloc;
200-
(*ptr).fill = 0;
201-
cast::transmute(ptr)
202-
}
203-
}
204-
}
205-
206-
/// Creates a new vector with a capacity of `capacity`
207-
#[inline]
208-
#[cfg(not(stage0))]
209179
pub fn with_capacity<T>(capacity: uint) -> ~[T] {
210180
unsafe {
211181
let alloc = capacity * mem::nonzero_size_of::<T>();
@@ -1503,31 +1473,6 @@ impl<T> OwnedVector<T> for ~[T] {
15031473
self.move_iter().invert()
15041474
}
15051475

1506-
#[cfg(stage0)]
1507-
fn reserve(&mut self, n: uint) {
1508-
// Only make the (slow) call into the runtime if we have to
1509-
if self.capacity() < n {
1510-
unsafe {
1511-
let td = get_tydesc::<T>();
1512-
if owns_managed::<T>() {
1513-
let ptr: *mut *mut Box<Vec<()>> = cast::transmute(self);
1514-
::at_vec::raw::reserve_raw(td, ptr, n);
1515-
} else {
1516-
let ptr: *mut *mut Vec<()> = cast::transmute(self);
1517-
let alloc = n * mem::nonzero_size_of::<T>();
1518-
let size = alloc + mem::size_of::<Vec<()>>();
1519-
if alloc / mem::nonzero_size_of::<T>() != n || size < alloc {
1520-
fail!("vector size is too large: {}", n);
1521-
}
1522-
*ptr = realloc_raw(*ptr as *mut c_void, size)
1523-
as *mut Vec<()>;
1524-
(**ptr).alloc = alloc;
1525-
}
1526-
}
1527-
}
1528-
}
1529-
1530-
#[cfg(not(stage0))]
15311476
fn reserve(&mut self, n: uint) {
15321477
// Only make the (slow) call into the runtime if we have to
15331478
if self.capacity() < n {
@@ -1561,21 +1506,6 @@ impl<T> OwnedVector<T> for ~[T] {
15611506
}
15621507

15631508
#[inline]
1564-
#[cfg(stage0)]
1565-
fn capacity(&self) -> uint {
1566-
unsafe {
1567-
if owns_managed::<T>() {
1568-
let repr: **Box<Vec<()>> = cast::transmute(self);
1569-
(**repr).data.alloc / mem::nonzero_size_of::<T>()
1570-
} else {
1571-
let repr: **Vec<()> = cast::transmute(self);
1572-
(**repr).alloc / mem::nonzero_size_of::<T>()
1573-
}
1574-
}
1575-
}
1576-
1577-
#[inline]
1578-
#[cfg(not(stage0))]
15791509
fn capacity(&self) -> uint {
15801510
unsafe {
15811511
let repr: **Vec<()> = cast::transmute(self);
@@ -1594,51 +1524,6 @@ impl<T> OwnedVector<T> for ~[T] {
15941524
}
15951525

15961526
#[inline]
1597-
#[cfg(stage0)]
1598-
fn push(&mut self, t: T) {
1599-
unsafe {
1600-
if owns_managed::<T>() {
1601-
let repr: **Box<Vec<()>> = cast::transmute(&mut *self);
1602-
let fill = (**repr).data.fill;
1603-
if (**repr).data.alloc <= fill {
1604-
self.reserve_additional(1);
1605-
}
1606-
1607-
push_fast(self, t);
1608-
} else {
1609-
let repr: **Vec<()> = cast::transmute(&mut *self);
1610-
let fill = (**repr).fill;
1611-
if (**repr).alloc <= fill {
1612-
self.reserve_additional(1);
1613-
}
1614-
1615-
push_fast(self, t);
1616-
}
1617-
}
1618-
1619-
// This doesn't bother to make sure we have space.
1620-
#[inline] // really pretty please
1621-
unsafe fn push_fast<T>(this: &mut ~[T], t: T) {
1622-
if owns_managed::<T>() {
1623-
let repr: **mut Box<Vec<u8>> = cast::transmute(this);
1624-
let fill = (**repr).data.fill;
1625-
(**repr).data.fill += mem::nonzero_size_of::<T>();
1626-
let p = to_unsafe_ptr(&((**repr).data.data));
1627-
let p = ptr::offset(p, fill as int) as *mut T;
1628-
intrinsics::move_val_init(&mut(*p), t);
1629-
} else {
1630-
let repr: **mut Vec<u8> = cast::transmute(this);
1631-
let fill = (**repr).fill;
1632-
(**repr).fill += mem::nonzero_size_of::<T>();
1633-
let p = to_unsafe_ptr(&((**repr).data));
1634-
let p = ptr::offset(p, fill as int) as *mut T;
1635-
intrinsics::move_val_init(&mut(*p), t);
1636-
}
1637-
}
1638-
}
1639-
1640-
#[inline]
1641-
#[cfg(not(stage0))]
16421527
fn push(&mut self, t: T) {
16431528
unsafe {
16441529
let repr: **Vec<()> = cast::transmute(&mut *self);
@@ -1821,20 +1706,8 @@ impl<T> OwnedVector<T> for ~[T] {
18211706
i += 1u;
18221707
}
18231708
}
1824-
#[inline]
1825-
#[cfg(stage0)]
1826-
unsafe fn set_len(&mut self, new_len: uint) {
1827-
if owns_managed::<T>() {
1828-
let repr: **mut Box<Vec<()>> = cast::transmute(self);
1829-
(**repr).data.fill = new_len * mem::nonzero_size_of::<T>();
1830-
} else {
1831-
let repr: **mut Vec<()> = cast::transmute(self);
1832-
(**repr).fill = new_len * mem::nonzero_size_of::<T>();
1833-
}
1834-
}
18351709

18361710
#[inline]
1837-
#[cfg(not(stage0))]
18381711
unsafe fn set_len(&mut self, new_len: uint) {
18391712
let repr: **mut Vec<()> = cast::transmute(self);
18401713
(**repr).fill = new_len * mem::nonzero_size_of::<T>();
@@ -3010,23 +2883,6 @@ impl<T> DoubleEndedIterator<T> for MoveIterator<T> {
30102883
}
30112884

30122885
#[unsafe_destructor]
3013-
#[cfg(stage0)]
3014-
impl<T> Drop for MoveIterator<T> {
3015-
fn drop(&mut self) {
3016-
// destroy the remaining elements
3017-
for _x in *self {}
3018-
unsafe {
3019-
if owns_managed::<T>() {
3020-
local_free(self.allocation as *u8 as *c_char)
3021-
} else {
3022-
exchange_free(self.allocation as *u8 as *c_char)
3023-
}
3024-
}
3025-
}
3026-
}
3027-
3028-
#[unsafe_destructor]
3029-
#[cfg(not(stage0))]
30302886
impl<T> Drop for MoveIterator<T> {
30312887
fn drop(&mut self) {
30322888
// destroy the remaining elements

src/libsyntax/ast.rs

-7
Original file line numberDiff line numberDiff line change
@@ -638,13 +638,6 @@ pub enum TokenTree {
638638
TTNonterminal(Span, Ident)
639639
}
640640

641-
// NOTE remove after next snapshot
642-
// Required for ext::quote macros.
643-
#[cfg(stage0)]
644-
pub fn tt_tok(span: Span, tok: ::parse::token::Token) -> TokenTree {
645-
TTTok(span, tok)
646-
}
647-
648641
//
649642
// Matchers are nodes defined-by and recognized-by the main rust parser and
650643
// language, but they're only ever found inside syntax-extension invocations;

src/snapshots.txt

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
S 2014-01-14 29070c3
2+
freebsd-x86_64 c2fb6e6313a9f1d41df810fcf1ae354858a8bf76
3+
linux-i386 6437656b81cf9f3d1377523c1e36d5cf06b2d645
4+
linux-x86_64 f3ca80c146f3a6495c19fc77dba13f9c0abece49
5+
macos-i386 3f1f9925fe1ddca94f2727194bd5763b0705016e
6+
macos-x86_64 0c10e160e3a754f2cdc89aea037c458fefe03d30
7+
winnt-i386 5cb277524157a8a883a8641b829f8aa6f53cdcf8
8+
19
S 2014-01-08 f3a8baa
210
freebsd-x86_64 9f2491ebe48ff77774c73c111acdd951973d7e47
311
linux-i386 e2ba50e6a7d0cf6a7d65393f0c6416a2af58f8d4

0 commit comments

Comments
 (0)