Skip to content

Commit 93b2564

Browse files
committed
---
yaml --- r: 48794 b: refs/heads/snap-stage3 c: 7352d91 h: refs/heads/master v: v3
1 parent 04d31bf commit 93b2564

File tree

31 files changed

+1138
-1869
lines changed

31 files changed

+1138
-1869
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 3bbcac322669cff3abde5be937cc4ec3860f3985
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 5af5766512b0e90a3a076a09b35286aca332e48e
4+
refs/heads/snap-stage3: 7352d919f62350bd24aefe0f188203ebef833fd5
55
refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ $(foreach target,$(CFG_TARGET_TRIPLES),\
238238

239239
CORELIB_CRATE := $(S)src/libcore/core.rc
240240
CORELIB_INPUTS := $(wildcard $(addprefix $(S)src/libcore/, \
241-
core.rc *.rs */*.rs */*/*rs))
241+
core.rc *.rs */*.rs))
242242

243243
######################################################################
244244
# Standard library variables

branches/snap-stage3/mk/tests.mk

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -244,29 +244,21 @@ $(foreach host,$(CFG_HOST_TRIPLES), \
244244

245245
define TEST_RUNNER
246246

247-
# If NO_REBUILD is set then break the dependencies on std so we can
248-
# test crates without rebuilding core and std first
249-
ifeq ($(NO_REBUILD),)
250-
STDTESTDEP_$(1)_$(2)_$(3) = $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB_$(2))
251-
else
252-
STDTESTDEP_$(1)_$(2)_$(3) =
253-
endif
254-
255247
$(3)/test/coretest.stage$(1)-$(2)$$(X_$(2)): \
256248
$$(CORELIB_CRATE) $$(CORELIB_INPUTS) \
257-
$$(STDTESTDEP_$(1)_$(2)_$(3))
249+
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB_$(2))
258250
@$$(call E, compile_and_link: $$@)
259251
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
260252

261253
$(3)/test/stdtest.stage$(1)-$(2)$$(X_$(2)): \
262254
$$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
263-
$$(STDTESTDEP_$(1)_$(2)_$(3))
255+
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB_$(2))
264256
@$$(call E, compile_and_link: $$@)
265257
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
266258

267259
$(3)/test/syntaxtest.stage$(1)-$(2)$$(X_$(2)): \
268260
$$(LIBSYNTAX_CRATE) $$(LIBSYNTAX_INPUTS) \
269-
$$(STDTESTDEP_$(1)_$(2)_$(3))
261+
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB_$(2))
270262
@$$(call E, compile_and_link: $$@)
271263
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
272264

branches/snap-stage3/src/compiletest/common.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ pub struct config {
6363
// Run tests using the JIT
6464
jit: bool,
6565

66-
// Run tests using the new runtime
67-
newrt: bool,
68-
6966
// Explain what's going on
7067
verbose: bool
7168

branches/snap-stage3/src/compiletest/compiletest.rc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ pub fn parse_config(args: ~[~str]) -> config {
6161
getopts::optopt(~"runtool"), getopts::optopt(~"rustcflags"),
6262
getopts::optflag(~"verbose"),
6363
getopts::optopt(~"logfile"),
64-
getopts::optflag(~"jit"),
65-
getopts::optflag(~"newrt")];
64+
getopts::optflag(~"jit")];
6665

6766
fail_unless!(!args.is_empty());
6867
let args_ = vec::tail(args);
@@ -96,7 +95,6 @@ pub fn parse_config(args: ~[~str]) -> config {
9695
runtool: getopts::opt_maybe_str(matches, ~"runtool"),
9796
rustcflags: getopts::opt_maybe_str(matches, ~"rustcflags"),
9897
jit: getopts::opt_present(matches, ~"jit"),
99-
newrt: getopts::opt_present(matches, ~"newrt"),
10098
verbose: getopts::opt_present(matches, ~"verbose")
10199
}
102100
}
@@ -116,7 +114,6 @@ pub fn log_config(config: config) {
116114
logv(c, fmt!("runtool: %s", opt_str(config.runtool)));
117115
logv(c, fmt!("rustcflags: %s", opt_str(config.rustcflags)));
118116
logv(c, fmt!("jit: %b", config.jit));
119-
logv(c, fmt!("newrt: %b", config.newrt));
120117
logv(c, fmt!("verbose: %b", config.verbose));
121118
logv(c, fmt!("\n"));
122119
}

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -483,17 +483,9 @@ fn compile_test_(config: config, props: TestProps,
483483

484484
fn exec_compiled_test(config: config, props: TestProps,
485485
testfile: &Path) -> ProcRes {
486-
487-
// If testing the new runtime then set the RUST_NEWRT env var
488-
let env = if config.newrt {
489-
props.exec_env + ~[(~"RUST_NEWRT", ~"1")]
490-
} else {
491-
props.exec_env
492-
};
493-
494486
compose_and_run(config, testfile,
495487
make_run_args(config, props, testfile),
496-
env,
488+
props.exec_env,
497489
config.run_lib_path, None)
498490
}
499491

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
"Highlight the 78th text column
1+
"Highlight the 100th text column
22
"Feature became available in v7.3
33
if version >= 703
4-
set colorcolumn=78
4+
set colorcolumn=100
55
endif

branches/snap-stage3/src/libcore/rt/context.rs

Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use option::*;
1211
use super::stack::StackSegment;
1312
use libc::c_void;
1413
use cast::{transmute, transmute_mut_unsafe,
@@ -17,30 +16,17 @@ use cast::{transmute, transmute_mut_unsafe,
1716
// XXX: Registers is boxed so that it is 16-byte aligned, for storing
1817
// SSE regs. It would be marginally better not to do this. In C++ we
1918
// use an attribute on a struct.
20-
// XXX: It would be nice to define regs as `~Option<Registers>` since
21-
// the registers are sometimes empty, but the discriminant would
22-
// then misalign the regs again.
23-
pub struct Context {
24-
/// The context entry point, saved here for later destruction
25-
start: Option<~~fn()>,
26-
/// Hold the registers while the task or scheduler is suspended
27-
regs: ~Registers
28-
}
19+
pub struct Context(~Registers);
2920

3021
pub impl Context {
3122
static fn empty() -> Context {
32-
Context {
33-
start: None,
34-
regs: new_regs()
35-
}
23+
Context(new_regs())
3624
}
3725

3826
/// Create a new context that will resume execution by running ~fn()
39-
static fn new(start: ~fn(), stack: &mut StackSegment) -> Context {
40-
// XXX: Putting main into a ~ so it's a thin pointer and can
41-
// be passed to the spawn function. Another unfortunate
42-
// allocation
43-
let start = ~start;
27+
/// # Safety Note
28+
/// The `start` closure must remain valid for the life of the Task
29+
static fn new(start: &~fn(), stack: &mut StackSegment) -> Context {
4430

4531
// The C-ABI function that is the task entry point
4632
extern fn task_start_wrapper(f: &~fn()) { (*f)() }
@@ -54,29 +40,21 @@ pub impl Context {
5440
// which we will then modify to call the given function when restored
5541
let mut regs = new_regs();
5642
unsafe {
57-
swap_registers(transmute_mut_region(&mut *regs), transmute_region(&*regs))
43+
swap_registers(transmute_mut_region(&mut *regs),
44+
transmute_region(&*regs))
5845
};
5946

6047
initialize_call_frame(&mut *regs, fp, argp, sp);
6148

62-
return Context {
63-
start: Some(start),
64-
regs: regs
65-
}
49+
return Context(regs);
6650
}
6751

68-
/* Switch contexts
69-
70-
Suspend the current execution context and resume another by
71-
saving the registers values of the executing thread to a Context
72-
then loading the registers from a previously saved Context.
73-
*/
7452
static fn swap(out_context: &mut Context, in_context: &Context) {
7553
let out_regs: &mut Registers = match out_context {
76-
&Context { regs: ~ref mut r, _ } => r
54+
&Context(~ref mut r) => r
7755
};
7856
let in_regs: &Registers = match in_context {
79-
&Context { regs: ~ref r, _ } => r
57+
&Context(~ref r) => r
8058
};
8159

8260
unsafe { swap_registers(out_regs, in_regs) };
@@ -106,10 +84,11 @@ fn new_regs() -> ~Registers {
10684
}
10785

10886
#[cfg(target_arch = "x86")]
109-
fn initialize_call_frame(regs: &mut Registers, fptr: *c_void, arg: *c_void, sp: *mut uint) {
87+
fn initialize_call_frame(regs: &mut Registers,
88+
fptr: *c_void, arg: *c_void, sp: *mut uint) {
11089

11190
let sp = align_down(sp);
112-
let sp = mut_offset(sp, -4);
91+
let sp = mut_offset(sp, -4); // XXX: -4 words? Needs this be done at all?
11392

11493
unsafe { *sp = arg as uint; }
11594
let sp = mut_offset(sp, -1);
@@ -129,7 +108,8 @@ type Registers = [uint * 22];
129108
fn new_regs() -> ~Registers { ~[0, .. 22] }
130109

131110
#[cfg(target_arch = "x86_64")]
132-
fn initialize_call_frame(regs: &mut Registers, fptr: *c_void, arg: *c_void, sp: *mut uint) {
111+
fn initialize_call_frame(regs: &mut Registers,
112+
fptr: *c_void, arg: *c_void, sp: *mut uint) {
133113

134114
// Redefinitions from regs.h
135115
const RUSTRT_ARG0: uint = 3;
@@ -163,7 +143,8 @@ type Registers = [uint * 32];
163143
fn new_regs() -> ~Registers { ~[0, .. 32] }
164144

165145
#[cfg(target_arch = "arm")]
166-
fn initialize_call_frame(regs: &mut Registers, fptr: *c_void, arg: *c_void, sp: *mut uint) {
146+
fn initialize_call_frame(regs: &mut Registers,
147+
fptr: *c_void, arg: *c_void, sp: *mut uint) {
167148
let sp = mut_offset(sp, -1);
168149

169150
// The final return address. 0 indicates the bottom of the stack
@@ -181,7 +162,8 @@ type Registers = [uint * 32];
181162
fn new_regs() -> ~Registers { ~[0, .. 32] }
182163

183164
#[cfg(target_arch = "mips")]
184-
fn initialize_call_frame(regs: &mut Registers, fptr: *c_void, arg: *c_void, sp: *mut uint) {
165+
fn initialize_call_frame(regs: &mut Registers,
166+
fptr: *c_void, arg: *c_void, sp: *mut uint) {
185167
let sp = mut_offset(sp, -1);
186168

187169
// The final return address. 0 indicates the bottom of the stack

branches/snap-stage3/src/libcore/rt/io/file.rs

Lines changed: 0 additions & 45 deletions
This file was deleted.

branches/snap-stage3/src/libcore/rt/io/mod.rs

Lines changed: 0 additions & 45 deletions
This file was deleted.

branches/snap-stage3/src/libcore/rt/mod.rs

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,23 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use libc::c_char;
1211

1312
// Some basic logging
1413
macro_rules! rtdebug_ (
1514
($( $arg:expr),+) => ( {
1615
dumb_println(fmt!( $($arg),+ ));
1716

1817
fn dumb_println(s: &str) {
19-
use io::WriterUtil;
20-
let dbg = ::libc::STDERR_FILENO as ::io::fd_t;
21-
dbg.write_str(s);
22-
dbg.write_str("\n");
18+
use str::as_c_str;
19+
use libc::c_char;
20+
21+
extern {
22+
fn printf(s: *c_char);
23+
}
24+
25+
do as_c_str(s.to_str() + "\n") |s| {
26+
unsafe { printf(s); }
27+
}
2328
}
2429

2530
} )
@@ -31,37 +36,13 @@ macro_rules! rtdebug (
3136
)
3237

3338
mod sched;
34-
mod rtio;
35-
pub mod uvll;
39+
mod io;
3640
mod uvio;
37-
#[path = "uv/mod.rs"]
3841
mod uv;
39-
#[path = "io/mod.rs"]
40-
mod io;
4142
// FIXME #5248: The import in `sched` doesn't resolve unless this is pub!
4243
pub mod thread_local_storage;
4344
mod work_queue;
4445
mod stack;
4546
mod context;
4647
mod thread;
4748
pub mod env;
48-
49-
pub fn start(main: *u8, _argc: int, _argv: *c_char, _crate_map: *u8) -> int {
50-
use self::sched::{Scheduler, Task};
51-
use self::uvio::UvEventLoop;
52-
53-
let loop_ = ~UvEventLoop::new();
54-
let mut sched = ~Scheduler::new(loop_);
55-
let main_task = ~do Task::new(&mut sched.stack_pool) {
56-
// XXX: Can't call a C function pointer from Rust yet
57-
unsafe { rust_call_nullary_fn(main) };
58-
};
59-
sched.task_queue.push_back(main_task);
60-
sched.run();
61-
return 0;
62-
63-
extern {
64-
fn rust_call_nullary_fn(f: *u8);
65-
}
66-
}
67-

0 commit comments

Comments
 (0)