Skip to content

Commit e81e81f

Browse files
committed
auto merge of #8387 : brson/rust/nooldrt, r=brson
2 parents 6f6dce7 + b75915d commit e81e81f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+276
-6446
lines changed

mk/rt.mk

+1-10
Original file line numberDiff line numberDiff line change
@@ -66,30 +66,21 @@ RUNTIME_CXXS_$(1)_$(2) := \
6666
rt/sync/timer.cpp \
6767
rt/sync/lock_and_signal.cpp \
6868
rt/sync/rust_thread.cpp \
69-
rt/rust.cpp \
7069
rt/rust_builtin.cpp \
7170
rt/rust_run_program.cpp \
7271
rt/rust_env.cpp \
7372
rt/rust_rng.cpp \
74-
rt/rust_sched_loop.cpp \
75-
rt/rust_sched_launcher.cpp \
76-
rt/rust_sched_driver.cpp \
77-
rt/rust_scheduler.cpp \
78-
rt/rust_sched_reaper.cpp \
79-
rt/rust_task.cpp \
8073
rt/rust_stack.cpp \
8174
rt/rust_upcall.cpp \
8275
rt/rust_uv.cpp \
8376
rt/rust_crate_map.cpp \
84-
rt/rust_log.cpp \
8577
rt/rust_gc_metadata.cpp \
8678
rt/rust_util.cpp \
79+
rt/rust_log.cpp \
8780
rt/rust_exchange_alloc.cpp \
8881
rt/isaac/randport.cpp \
8982
rt/miniz.cpp \
90-
rt/rust_kernel.cpp \
9183
rt/rust_abi.cpp \
92-
rt/rust_debug.cpp \
9384
rt/memory_region.cpp \
9485
rt/boxed_region.cpp \
9586
rt/arch/$$(HOST_$(1))/context.cpp \

src/libextra/arc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -596,14 +596,14 @@ mod tests {
596596
let (c,p) = (Cell::new(c), Cell::new(p));
597597
do task::spawn || {
598598
// wait until parent gets in
599-
comm::recv_one(p.take());
599+
p.take().recv();
600600
do arc2.access_cond |state, cond| {
601601
*state = true;
602602
cond.signal();
603603
}
604604
}
605605
do arc.access_cond |state, cond| {
606-
comm::send_one(c.take(), ());
606+
c.take().send(());
607607
assert!(!*state);
608608
while !*state {
609609
cond.wait();

src/libextra/future.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
use std::cast;
3030
use std::cell::Cell;
31-
use std::comm::{PortOne, oneshot, send_one, recv_one};
31+
use std::comm::{PortOne, oneshot};
3232
use std::task;
3333
use std::util::replace;
3434

@@ -123,7 +123,7 @@ pub fn from_port<A:Send>(port: PortOne<A>) -> Future<A> {
123123

124124
let port = Cell::new(port);
125125
do from_fn {
126-
recv_one(port.take())
126+
port.take().recv()
127127
}
128128
}
129129

@@ -152,7 +152,7 @@ pub fn spawn<A:Send>(blk: ~fn() -> A) -> Future<A> {
152152
let chan = Cell::new(chan);
153153
do task::spawn {
154154
let chan = chan.take();
155-
send_one(chan, blk());
155+
chan.send(blk());
156156
}
157157

158158
return from_port(port);
@@ -163,7 +163,7 @@ mod test {
163163
use future::*;
164164

165165
use std::cell::Cell;
166-
use std::comm::{oneshot, send_one};
166+
use std::comm::oneshot;
167167
use std::task;
168168

169169
#[test]
@@ -175,7 +175,7 @@ mod test {
175175
#[test]
176176
fn test_from_port() {
177177
let (po, ch) = oneshot();
178-
send_one(ch, ~"whale");
178+
ch.send(~"whale");
179179
let mut f = from_port(po);
180180
assert_eq!(f.get(), ~"whale");
181181
}

src/libextra/sync.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use std::borrow;
2020
use std::comm;
2121
use std::comm::SendDeferred;
22+
use std::comm::{GenericPort, Peekable};
2223
use std::task;
2324
use std::unstable::sync::{Exclusive, UnsafeAtomicRcBox};
2425
use std::unstable::atomics;
@@ -111,7 +112,7 @@ impl<Q:Send> Sem<Q> {
111112
/* do 1000.times { task::yield(); } */
112113
// Need to wait outside the exclusive.
113114
if waiter_nobe.is_some() {
114-
let _ = comm::recv_one(waiter_nobe.unwrap());
115+
let _ = waiter_nobe.unwrap().recv();
115116
}
116117
}
117118
}
@@ -235,7 +236,7 @@ impl<'self> Condvar<'self> {
235236
do (|| {
236237
unsafe {
237238
do task::rekillable {
238-
let _ = comm::recv_one(WaitEnd.take_unwrap());
239+
let _ = WaitEnd.take_unwrap().recv();
239240
}
240241
}
241242
}).finally {

src/libextra/task_pool.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/// parallelism.
1515
1616

17-
use std::comm::Chan;
17+
use std::comm::{Chan, GenericChan, GenericPort};
1818
use std::comm;
1919
use std::task::SchedMode;
2020
use std::task;

src/libextra/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use time::precise_time_ns;
2929
use treemap::TreeMap;
3030

3131
use std::clone::Clone;
32-
use std::comm::{stream, SharedChan};
32+
use std::comm::{stream, SharedChan, GenericPort, GenericChan};
3333
use std::libc;
3434
use std::either;
3535
use std::io;

src/libextra/workcache.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use arc::{Arc,RWArc};
1818
use treemap::TreeMap;
1919

2020
use std::cell::Cell;
21-
use std::comm::{PortOne, oneshot, send_one, recv_one};
21+
use std::comm::{PortOne, oneshot};
2222
use std::either::{Either, Left, Right};
2323
use std::io;
2424
use std::run;
@@ -331,7 +331,7 @@ impl<'self> Prep<'self> {
331331
};
332332
let chan = chan.take();
333333
let v = blk(&exe);
334-
send_one(chan, (exe, v));
334+
chan.send((exe, v));
335335
}
336336
Right(port)
337337
}
@@ -355,7 +355,7 @@ impl<'self, T:Send +
355355
None => fail!(),
356356
Some(Left(v)) => v,
357357
Some(Right(port)) => {
358-
let (exe, v) = recv_one(port);
358+
let (exe, v) = port.recv();
359359
let s = json_encode(&v);
360360
do prep.ctxt.db.write |db| {
361361
db.cache(prep.fn_name,

src/libstd/at_vec.rs

+2-15
Original file line numberDiff line numberDiff line change
@@ -275,24 +275,11 @@ pub mod raw {
275275
}
276276

277277
fn local_realloc(ptr: *(), size: uint) -> *() {
278-
use rt;
279-
use rt::OldTaskContext;
280278
use rt::local::Local;
281279
use rt::task::Task;
282280

283-
if rt::context() == OldTaskContext {
284-
unsafe {
285-
return rust_local_realloc(ptr, size as libc::size_t);
286-
}
287-
288-
extern {
289-
#[fast_ffi]
290-
fn rust_local_realloc(ptr: *(), size: libc::size_t) -> *();
291-
}
292-
} else {
293-
do Local::borrow::<Task, *()> |task| {
294-
task.heap.realloc(ptr as *libc::c_void, size) as *()
295-
}
281+
do Local::borrow::<Task, *()> |task| {
282+
task.heap.realloc(ptr as *libc::c_void, size) as *()
296283
}
297284
}
298285
}

src/libstd/cleanup.rs

+1-18
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,8 @@ unsafe fn each_live_alloc(read_next_before: bool,
5656

5757
#[cfg(unix)]
5858
fn debug_mem() -> bool {
59-
use rt;
60-
use rt::OldTaskContext;
6159
// XXX: Need to port the environment struct to newsched
62-
match rt::context() {
63-
OldTaskContext => ::rt::env::get().debug_mem,
64-
_ => false
65-
}
60+
false
6661
}
6762

6863
#[cfg(windows)]
@@ -147,15 +142,3 @@ pub unsafe fn annihilate() {
147142
dbg.write_str("\n");
148143
}
149144
}
150-
151-
/// Bindings to the runtime
152-
pub mod rustrt {
153-
use libc::c_void;
154-
155-
#[link_name = "rustrt"]
156-
extern {
157-
#[rust_stack]
158-
// FIXME (#4386): Unable to make following method private.
159-
pub fn rust_get_task() -> *c_void;
160-
}
161-
}

0 commit comments

Comments
 (0)