Commit Graph

380 Commits

Author SHA1 Message Date
Brian Anderson
abc49fdfae rt: abort doesn't take an argument 2013-04-25 15:10:19 -07:00
Brian Anderson
e944c7dade Merge remote-tracking branch 'brson/io'
This also reverts some changes to TLS that were leaking memory.

Conflicts:
	src/libcore/rt/uv/net.rs
	src/libcore/task/local_data_priv.rs
	src/libcore/unstable/lang.rs
2013-04-23 19:19:32 -07:00
Brian Anderson
42c0f88232 core::rt: Add unwinding to newsched tasks 2013-04-22 17:15:31 -07:00
Brian Anderson
d7f5e437a2 core::rt: Add the local heap to newsched tasks
Reusing the existing boxed_region implementation from the runtime
2013-04-21 19:03:54 -07:00
bors
3830040a89 auto merge of #5887 : jdm/rust/stackbounds, r=brson
This is needed to allow GC to work in SpiderMonkey.
2013-04-21 17:33:52 -07:00
Josh Matthews
5cc6a0bf32 rt: Make the C stack segment accessible to runtime users. 2013-04-21 22:41:43 +02:00
Brian Anderson
b96765179e core: Add rt::context for figuring out what runtime services are available
Conflicts:
	src/libcore/rt/sched/mod.rs
2013-04-19 12:05:18 -07:00
Brian Anderson
7cd681684f rt: Move test functions to rust_test_helpers.cpp 2013-04-15 13:39:15 -07:00
Jyun-Yan You
685c4d0b76 add rust_dbg_extern_identity_TwoDoubles to prevent check-fast failure 2013-04-14 13:15:46 +08:00
Brian Anderson
5af5766512 core: Initialize global state lazily in the Scheduler ctor
I don't want any global one-time initalization functions because
that will make embedding harder.
2013-03-18 17:00:35 -07:00
Brian Anderson
044703435b Add a way to run the test suite with the new scheduler
TESTARGS=--newrt make check-stage1-rpass

Conflicts:
	src/rt/rustrt.def.in
2013-03-18 17:00:35 -07:00
Brian Anderson
63d18658c1 rt: Add RUST_DEBUG_MEM to rust_env to avoid races 2013-03-16 14:25:44 -07:00
bors
2293b075b8 auto merge of #5364 : xenocons/rust/patch-1, r=z0w0 2013-03-14 14:07:01 -07:00
xenocons
d8094f8602 updated from L to ull for easier mingw32 builds. 2013-03-14 09:06:33 +11:00
Niko Matsakis
efc7f82bc4 Revamp foreign code not to consider the Rust modes. This requires
adjusting a few foreign functions that were declared with by-ref
mode.  This also allows us to remove by-val mode in the near future.

With copy mode, though, we have to be careful because Rust will implicitly pass
somethings by pointer but this may not be the C ABI rules.  For example, rust
will pass a struct Foo as a Foo*.  So I added some code into the adapters to
fix this (though the C ABI rules may put the pointer back, oh well).

This patch also includes a lint mode for the use of by-ref mode
in foreign functions as the semantics of this have changed.
2013-03-13 16:59:37 -04:00
Brian Anderson
0ad3a110be Work around linkage bug cross-compiling from x86_64-apple-darwin to i686-apple-darwin
The correct opendir/readdir to use appear to be the 64-bit versions called
opendir$INODE64, etc. but for some reason I can't get them to link properly
on i686. Putting them in librustrt and making gcc figure it out works.
This mystery will have to wait for another day.
2013-03-12 21:01:40 -07:00
Brian Anderson
676e0290ed core: Add rt mod and add the new scheduler code 2013-03-11 19:44:29 -07:00
Jeff Olson
a69a2acfba rt/core: port os::list_dir to rust ref #4812 2013-03-11 15:38:55 -07:00
Jeff Olson
53db6c7e2a core: rt/core: impl os::env() in rust ref #4812 2013-03-11 15:38:55 -07:00
Jeff Olson
4bc26ce575 rt/core: impl os::getcwd() in rust ref #4812 2013-03-11 15:38:55 -07:00
Brian Anderson
1b1017087b rt: Make some runtime calls work outside of task context 2013-02-27 12:39:11 -08:00
Graydon Hoare
968ab03026 rt: fix memory-unsafe random seed logic, r=valgrindclean 2013-02-19 07:06:36 -08:00
Chris Peterson
9a78dc93db reseed rust_rng after generating 32KB 2013-02-14 22:33:12 -08:00
Chris Peterson
665e900ede encapsulate isaac RNG in rust_rng struct 2013-02-14 22:31:08 -08:00
Chris Peterson
c531506385 rt: rand.rs expects rust_next() to return uint32_t, not size_t 2013-02-14 22:29:21 -08:00
Luqman Aden
2c198561dd rt: Fix alignment in debug_opaque 2013-02-13 15:41:38 -05:00
Luqman Aden
c22d0af14c rt: take into account alignment for debug_opaque. Closes #2667 2013-02-13 15:41:38 -05:00
Luqman Aden
d67e144f68 rt: get rid of rust_fn and replace with fn_env_pair plus a little cleanup. 2013-02-13 15:41:38 -05:00
bors
6016214101 auto merge of #4900 : luqmana/rust/core_os_errors, r=graydon
Rewrote the last pull request (#4859) to not require on llvm for core.

Also fixes #2269.
2013-02-12 21:27:22 -08:00
bors
bc2d147847 auto merge of #4858 : z0w0/rust/rm_weak_task_count, r=graydon 2013-02-12 14:36:33 -08:00
Luqman Aden
70185fdcc2 rt: remove last_os_error and adjust tests. 2013-02-11 23:49:49 -05:00
Zack Corr
ebd20b7944 Rename dec/inc_weak_task_count to inc/dec_live_count and remove register_task/unregister_task. Closes #4768 2013-02-09 19:19:31 +10:00
Mark Vian
e2e474767e rt: remove unused 'rust_compare_and_swap_ptr'. Closes #4836 2013-02-08 18:19:36 -06:00
Brian Anderson
4f6516969e rt: Remove ports 2013-02-01 21:22:49 -08:00
Brian Anderson
cc9ab2c033 Remove old comm-based weak task interface 2013-01-23 17:35:34 -08:00
Brian Anderson
fb9299346a core: Convert getenv/setenv to use a mutex
This much simpler implementation uses a global mutex
and eliminates the kernel environment channel.
2013-01-23 17:35:34 -08:00
Brian Anderson
8852279a9e core: Add new weak task API 2013-01-23 17:35:31 -08:00
Brian Anderson
db1abbec4c core: Add private global data interface. #3915 2013-01-17 19:24:50 -08:00
Brian Anderson
ac435af73a Add at_exit function #4450 2013-01-15 18:00:19 -08:00
Brian Anderson
090b247056 Spawn new tasks onto the primary scheduler by default. #3760 2013-01-15 18:00:19 -08:00
ILyoan
4fb4be8f17 More android support
Conflicts:
	Makefile.in
	cmakeFiles/rustllvm.cmake
2013-01-13 16:43:39 -08:00
kyeongwoon
987f824f23 Support ARM and Android
Conflicts:
	src/libcore/os.rs
	src/librustc/back/link.rs
	src/librustc/driver/driver.rs
	src/librustc/metadata/loader.rs
	src/librustc/middle/trans/base.rs
2013-01-13 16:43:39 -08:00
Brian Anderson
1b1700f44b Add core::private::run_in_bare_thread
This begins executing Rust code in a fresh context with no runtime environment
2013-01-11 14:53:28 -08:00
Graydon Hoare
12c32e944d Add license boilerplate to more files. 2012-12-10 17:32:58 -08:00
Brian Anderson
8d932160d9 rt: Remove box annihilator 2012-10-23 12:14:46 -07:00
Luqman Aden
48582b360c Replace rust_atomic_increment/decrement and rust_compare_and_swap_ptr with intrinsics. 2012-10-21 22:43:28 -04:00
Graydon Hoare
365f174838 Attempt to fix os::args errors on various platforms. 2012-10-03 15:02:22 -07:00
Patrick Walton
9284179311 libstd: Switch off legacy modes in both core and std. 2012-10-02 12:20:06 -07:00
Patrick Walton
f41c53667e rustc: Fix calls to the logging function when the must_cast flag is true; stop using shape code for logging 2012-09-25 14:56:17 -07:00
Patrick Walton
ee7fa194fa Revert "rustc: Stop using shape code for logging" due to ICEs
This reverts commit ac822a52be.
2012-09-25 12:17:05 -07:00
Patrick Walton
ac822a52be rustc: Stop using shape code for logging 2012-09-25 11:44:23 -07:00
Patrick Walton
dbc00ced3a rt: Add a logging function for strings (only).
This will be the shape-free replacement for upcall_log_type.
2012-09-24 20:26:06 -07:00
Philipp Brüschweiler
d3e0a06578 V2: now with more locks! 2012-09-19 14:01:53 -07:00
Philipp Brüschweiler
68e755b1c2 core: Allocate threads on demand, not on scheduler startup
API change: rust_kernel::create_scheduler() or
rust_scheduler::rust_scheduler() respecitevly now take ownership of the
launch factory argument, it is needed to create new threads on demand.

Also renames rustrt::sched_threads() to rustrt::rust_sched_threads() for
consistency. Added rustrt::rust_max_sched_threads() to return the
maximal number of scheduled threads of the current scheduler.

Fixes #3493.
2012-09-19 14:01:53 -07:00
Philipp Brüschweiler
62b51d9152 rt: Implement ThreadPerCore scheduling mode
Fixes #3465.
2012-09-13 20:48:33 +02:00
Elliott Slaughter
961bd48724 gc: Fix for GC missing stack frames across segment boundaries. 2012-09-07 09:21:22 -07:00
Brian Anderson
a0de6b6d5f Merge remote-tracking branch 'erickt/incoming' 2012-08-31 16:14:18 -07:00
Elliott Slaughter
f8323ac615 rt: Add interface to box annihilator. 2012-08-31 15:10:52 -07:00
Erick Tryzelaar
628b946186 libcore: rewrite str::reserve in pure rust. 2012-08-30 20:40:52 -07:00
Erick Tryzelaar
7bb65848a1 libcore: Rewrite str::unsafe::push_byte in pure rust. 2012-08-30 20:40:52 -07:00
Erick Tryzelaar
0e1a4a4da2 libcore: rewrite vec::unsafe::from_buf in pure rust 2012-08-30 20:40:52 -07:00
Michael Sullivan
5f32e18011 Make std::arena run destructors. Closes #2831. 2012-08-21 17:03:00 -07:00
Ben Blum
a076c287de Fix issue-506.rs by adding a void-returning stub in the runtime (close #2957) 2012-08-16 21:07:55 -04:00
Ben Blum
bdbad614ac Remove rust_cond_lock and sys::condition (rename to little_lock) 2012-08-07 18:18:48 -04:00
Ben Blum
4174de8bb9 rt: expose rust_task refcounts to rustland 2012-08-03 21:00:23 -04:00
Ben Blum
60d682b577 Fix asserts & short-read bug in isaac_seed (#2870) 2012-07-25 18:03:00 -04:00
Ben Blum
c68f2d9aab Remove notification channels in runtime (closes #1078) 2012-07-25 13:22:43 -04:00
Ben Blum
695ab09899 Change yield() and wait_event() to be MUST_CHECK and return the killed flag. (closes #2875) 2012-07-24 18:24:24 -04:00
Ben Blum
2040a5c632 tiny runtime cleanup 2012-07-24 17:35:08 -04:00
Ben Blum
f42a5a1acd Remove unsupervise 2012-07-24 17:31:43 -04:00
Ben Blum
ae094a7adc Add 'do atomically { .. }' for exclusives 2012-07-24 15:28:35 -04:00
Ben Blum
4cf6b4d3b4 Tasks should not hold a ref to their parent (Close #1789) 2012-07-17 20:45:07 -04:00
Michael Sullivan
aa5b5ab886 Create some infrastructure for building up @-vectors. Work on #2921. 2012-07-17 17:09:25 -07:00
Ben Blum
cd38377b1b Add asserts to check fail_sched_loop() only once 2012-07-13 20:13:53 -04:00
Ben Blum
d338879ba5 Reintroduce linked failure (killing runtime)
This reverts commit 5724c64549.
2012-07-13 20:13:53 -04:00
Tim Chevalier
81ecd272d3 Comments only: TODOs to FIXME in the runtime 2012-07-12 19:06:08 -07:00
Ben Blum
5724c64549 Revert linked failure (killing runtime)
This reverts commit 200a2ded32.
2012-07-12 19:49:49 -04:00
Ben Blum
200a2ded32 Fix linked failure with root taskgroup to kill the runtime too. 2012-07-12 18:08:36 -04:00
Ben Blum
9c0b469613 Add rust_task_kill_other 2012-07-11 12:07:06 -04:00
Eric Holk
26e6eb3d14 Handle failure conditions correctly in pipes. 2012-07-10 22:00:47 -07:00
Eric Holk
e5c9cb2b3d Pipes sleep and wake properly. 2012-07-06 10:42:39 -07:00
Ben Blum
6fc730baf6 Cleanup failure handling around rust_new_task_in_sched - closes #2668 2012-06-28 19:02:48 -04:00
Ben Blum
af2d01e36b Fix sys::refcount and remove dbg::refcount 2012-06-28 14:40:31 -04:00
Ben Blum
1ba3028d8b rt: Add task_local_data and related builtin calls (Closes #2680) 2012-06-28 00:10:03 -04:00
Graydon Hoare
d3c6119a7a More keyword paring and migration in runtime, docs, code modes. 2012-06-27 13:30:49 -07:00
Eric Holk
26c11f7b50 Use must_have_lock instead of private functions. (Issue #2700)
I hereby declare that messages sent from the same source arrive in order (Issue #2605)

Removing FIXME, owned is the correct type here. (Issue #2704)

Remove outdated FIXME (Issue #2703)

Updating test for spawning native functions (Issue #2602)

Removing bogus FIXME (Issue #2599)
2012-06-22 15:14:42 -07:00
Graydon Hoare
312faf31df Tag all remaining FIXMEs with bugs. Install rule in tidy script to enforce this. 2012-06-21 16:44:10 -07:00
Tim Chevalier
c814df0bd6 Comments only: annotate FIXMEs 2012-06-21 16:03:28 -07:00
Eric Holk
ec0fbf526e Fixed a compile error in runtime. 2012-06-19 12:26:58 -07:00
Eric Holk
dc718d97a6 Adding a lock/condition variable to libcore. 2012-06-19 10:31:12 -07:00
Michael Sullivan
b4484d51c1 Some cleanup in the runtime. 2012-06-18 15:54:37 -07:00
Tim Chevalier
3e2006a570 Revert "Adding a lock/condition variable to libcore."
This reverts commit e394ebda37.
2012-06-16 15:34:15 -07:00
Eric Holk
e394ebda37 Adding a lock/condition variable to libcore. 2012-06-15 22:00:24 -04:00
Brian Anderson
c816eea000 std: Add debug::breakpoint 2012-06-06 23:39:55 -07:00
Brian Anderson
78fe75a741 rt: Fix iaac_init using wrong type and not seeding correctly
This was a result of changing the vector representation to contain
a box header.
2012-06-05 00:21:19 -07:00
Brian Anderson
70ecfa686a rt: Fix build errors on win 2012-05-30 21:23:34 -07:00
Brian Anderson
3f8223ffc2 rt: Fix vec_from_buf_shared for new vecs 2012-05-30 21:23:34 -07:00
Brian Anderson
ecd4318094 rt: Fix rust_list_files for new vecs 2012-05-30 21:23:34 -07:00
Brian Anderson
09a1b94907 Various changes for self-describing vecs 2012-05-30 21:23:34 -07:00
Eric Holk
6fa1a084f7 A shareable atomically reference counted pointer wrapper.
Needs more tests to ensure safety, and probably some more work on usability too.
2012-05-23 14:58:16 -07:00