Commit Graph

1611 Commits

Author SHA1 Message Date
Patrick Walton
c995a62d44 librustc: WIP patch for using the return value. 2013-04-19 12:00:08 -07:00
Patrick Walton
ca8e99fd78 rt: Fix scalability problem with big stacks on 32 bit 2013-04-19 11:53:34 -07:00
Patrick Walton
f903ae9e72 librustc: Implement fast-ffi and use it in various places 2013-04-19 11:53:31 -07:00
bors
2a86485277 auto merge of #5418 : luqmana/rust/stack-float, r=brson
Like I commented in #2043, I can't reproduce the weirdness from #1388 on either mac or linux (x84_64) and pushing to try gives all green.

That's 128 less bytes to have to keep in the stack for every call to __morestack.
2013-04-18 13:45:55 -07:00
Marti Raudsepp
5dda8ab129 sketch: Make rust sketch barf output prettier 2013-04-18 12:46:01 +03:00
Brian Anderson
a5ddc00982 rustc: Use an out pointer to return structs in x86 C ABI. #5347
This Adds a bunch of tests for passing and returning structs
of various sizes to C. It fixes the struct return rules on unix,
and on windows for structs of size > 8 bytes. Struct passing
on unix for structs under a certain size appears to still be broken.
2013-04-17 15:49:19 -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
ILyoan
03116f251d add unwind information on morestack 2013-04-10 18:49:51 -07:00
ILyoan
3d0d144283 rust morestack assembly for arm
Conflicts:
	src/rt/arch/arm/morestack.S
2013-04-10 18:49:50 -07:00
Niko Matsakis
2a44a1bd97 Fix various warnings, NOTEs, etc 2013-04-05 05:36:03 -04:00
Jyun-Yan You
4f1d8cb6fc fix mac build and comment on stack size check 2013-04-04 18:53:58 +08:00
Jyun-Yan You
fdf48a7b52 rt: improve mips backend 2013-04-04 18:53:58 +08:00
Daniel Micay
26fc76acb6 rt/arch/arm: fix syntax used for noexec stack 2013-04-01 00:31:22 -04:00
Daniel Micay
c0be7df5de mark the assembly object stacks as non-executable
Closes #5643

This also removes the need to pass noexecstack to gcc, but that wasn't
actually working anymore.
2013-03-31 18:23:05 -04:00
bors
ef282dbe2a auto merge of #5409 : brson/rust/rt, r=brson
r?

There are a lot of commits here, but not all that much substance. Mostly just refactoring.

I started sketching out the beginnings of a very simple I/O API in `core::rt::io` that represents I/O streams as a single `Stream` trait instead of `Reader` / `Writer` pairs. This seems to be the more common pattern (at least this is how the .NET BCL does it) and it seems to me that separate readers and writers would make duplex streams very awkward. Regardless, I don't intend to go very far down the I/O API design road without some mailing list discussion.

I've also started on the uv bindings for file I/O but haven't gotten very far.

Also hooked up the new scheduler to `rust_start` and the compiletest driver. 70% of run-pass test cases already pass, but I wouldn't read too much into that.

I also split the direct, low-level uv bindings in two so that the scheduler can have its own set, leaving `std::net` on its own.
2013-03-25 13:01:11 -07:00
Brian Anderson
30d4124a37 Merge remote-tracking branch 'brson/rt'
Conflicts:
	src/libcore/rt/context.rs
	src/libcore/rt/sched.rs
	src/libcore/rt/thread.rs
	src/libcore/rt/uv.rs
2013-03-25 12:28:54 -07:00
bors
6d4499ce4d auto merge of #5424 : luqmana/rust/inline-rt, r=brson
As per #2521. Inlining seems to improve performance slightly:

                 Inlined          Not Inlined
    x86:         13.5482            14.4112
    x86_64:      17.4712            18.0696

(Average of 5 runs timed with `time`)

```Rust

fn foo() -> int {
    int::from_str(~"28098").unwrap()
}

fn main() {
    for 1000000.times {
        foo();
        foo();
        foo();
        foo();
        foo();
    }
}
```

All run on:

    Linux 3.2.0-0.bpo.4-amd64 #1 SMP Debian 3.2.35-2~bpo60+1 x86_64 GNU/Linux

The MIPS and ARM bits I didn't inline since I'm not as familiar with them and I also can't test them. All green on try.
2013-03-25 12:04:11 -07:00
Zack Corr
280b8a243e rt: Increase C_STACK_SIZE to 2MB to get JIT/rusti working again (dlopen segfaults) 2013-03-21 15:15:47 +10:00
ILyoan
c1cacc3667 Rewrite arm/ccall.s 2013-03-19 17:23:41 +09: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
54bb7226e1 core: Simplify uvll bindings and strip out currently-unused bits
No more mapping uv structs to Rust structs
2013-03-18 16:59:37 -07:00
Luqman Aden
a692777224 rt: Inline get_sp_limit/set_sp_limit/get_sp for x86. 2013-03-18 00:07:53 -07:00
Luqman Aden
d1778767cc rt: Inline get_sp_limit/set_sp_limit/get_sp for x86_64. 2013-03-17 21:40:59 -07:00
Luqman Aden
f7a14e0a5a rt: don't save and restore xmm/regs in __morestack. 2013-03-17 00:29:12 -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
81e370285f Merge remote-tracking branch 'brson/cross7'
Conflicts:
	configure
	mk/rt.mk
2013-03-06 23:54:35 -08:00
Young-il Choi
a35dc95969 mk: --android-cross-path to rustc 2013-03-05 13:12:23 +09:00
Jyun-Yan You
314605f948 rt: fix some bugs for MIPS target 2013-03-03 20:02:06 -08:00
Jyun-Yan You
0ecd9e03ff rt: MIPS32 support 2013-03-03 19:27:01 -08:00
Patrick Walton
ce3b17badd librustdoc: Remove fn@, fn~, and fn& from compiletest, fuzzer, rustdoc, and rt. rs=defun 2013-03-02 18:47:47 -08:00
bors
1d34a55d88 auto merge of #5162 : brson/rust/fixmes, r=brson 2013-03-01 01:54:38 -08:00
Brian Anderson
b01d2babaf rt: Comment out an assert in rust_kernel. #4711 2013-02-28 14:21:39 -08:00
Brian Anderson
4a04a188e3 Convert NOTEs to FIXMEs 2013-02-27 18:44:35 -08:00
Brian Anderson
1b1017087b rt: Make some runtime calls work outside of task context 2013-02-27 12:39:11 -08:00
Young-il Choi
26a5dc593c mk: rewrite make files 2013-02-27 14:53:35 +09:00
Graydon Hoare
0309af458c Put unique allocs in managed heap when they might contain managed boxes. 2013-02-21 23:01:17 -08:00
Graydon Hoare
8eaf08357c rt: remove export of symbol removed in last commit, r=burningtree 2013-02-19 07:18:46 -08:00
Graydon Hoare
968ab03026 rt: fix memory-unsafe random seed logic, r=valgrindclean 2013-02-19 07:06:36 -08:00
Daniel Micay
59bb9c2f1a rm unused reserve_vec from rt (done in libcore) 2013-02-16 02:56:00 -05:00
Daniel Micay
f34dd565d9 rm unused hash table from the runtime 2013-02-15 18:22:34 -05:00
Chris Peterson
9a76d718c7 don't deplete RNG entropy when there is only one runnable task 2013-02-14 22:35:40 -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
f4320b6195 move isaac RNG utility functions to new rust_rng.cpp file 2013-02-14 22:30:27 -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
bors
20fd0c53ed auto merge of #4938 : thestinger/rust/no_zero, r=brson
I removed the unused wrappers methods named `calloc` because they relied on the malloc wrapper having a `bool zero = true` default parameter (which resulted in some accidental zeroing). Perhaps wrapping the actual calloc function would be useful, but I don't know of an existing use case that could use it so I just removed these.

This gives an ~1% performance improvement for TreeMap, which does a lot of small allocations. Vectors use `realloc` which didn't zero before these changes so there's no measurable change in performance.
2013-02-14 18:27:54 -08:00
Daniel Micay
1a41b484bf rm the unused calloc wrapper from memory_region
it doesn't actually call calloc, so it's fairly pointless
2013-02-14 18:28:04 -05:00
Daniel Micay
2e0614750c get rid of unused exchange_alloc calloc method
this isn't actually calloc - it calls the malloc wrapper which no
longer zeroes
2013-02-14 18:24:52 -05:00
Daniel Micay
7103ca95ac rm unused zero param in C++ exchange allocator 2013-02-14 16:04:30 -05: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
2180fe2552 rt: remove last_os_error from rustrt.def.in 2013-02-12 00:22:58 -05:00
Luqman Aden
70185fdcc2 rt: remove last_os_error and adjust tests. 2013-02-11 23:49:49 -05:00
Jeff Olson
dfcdb6eb72 rt/std: update of libuv API glue for libuv submodule update 2013-02-10 11:51:05 -08: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
ILyoan
e7c6735e0d Fixed #1531 2013-02-08 14:11:00 +09:00
Brian Anderson
e43c5bdc6b Rewrite the exchange allocator to work without an active scheduler. #4457 2013-02-06 14:27:36 -08:00
Brian Anderson
e91040c704 Make foreign calls work outside of tasks. #4451 2013-02-06 14:27:34 -08:00
Brian Anderson
a8c8bfc7b5 rt: Add rust_try_get_current_task 2013-02-06 11:56:32 -08:00
Brian Anderson
8ebdb1a11b rt: Remove some unused upcalls 2013-02-01 21:58:33 -08:00
Brian Anderson
a50d1fdbda rt: Remove get_frame_glue_fns. Unused 2013-02-01 21:22:49 -08:00
Brian Anderson
02fbd5a164 rt: Remove circular_buffer 2013-02-01 21:22:49 -08:00
Brian Anderson
4f6516969e rt: Remove ports 2013-02-01 21:22:49 -08:00
ILyoan
8ec36d779b fix #2673: avoid visiting the same crate twice 2013-01-29 21:03:05 +09:00
Brian Anderson
1ef83945c1 Merge remote-tracking branch 'brson/nocommupstream'
Conflicts:
	src/libcore/private.rs
	src/libcore/task/mod.rs
	src/libcore/task/spawn.rs
	src/libstd/net_tcp.rs
	src/libstd/uv_global_loop.rs
	src/libstd/uv_iotask.rs
2013-01-25 18:06:30 -08:00
Brian Anderson
cc9ab2c033 Remove old comm-based weak task interface 2013-01-23 17:35:34 -08:00
Brian Anderson
b9608fe423 std: Convert uv_global_loop to use pipes 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
6b6acde972 Add a license check to tidy. #4018 2013-01-17 23:28:42 -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
Brian Anderson
3d54187890 Win32 build fix 2013-01-13 16:43:39 -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
Brian Anderson
6a2e495d67 rt: Remove unused command line parsing 2013-01-09 15:26:15 -08:00
Brian Anderson
b43e639bf6 Remove unused bigint from runtime 2013-01-08 13:53:45 -08:00
Patrick Walton
6c18c75f2d rt: Stop zeroing out all allocations. Unobservable perf win. Closes #2682. rs=negligible-perf-win 2013-01-05 18:04:29 -08:00
Chris Peterson
e08f304b81 rt: Remove dead code from schedule_task() 2012-12-30 23:12:24 -08:00
Brian Anderson
7f8e302a6a Whitespace 2012-12-15 23:03:45 -08:00
Brian Anderson
20ea37b336 rt: Do some casting to avoid warnings 2012-12-15 22:38:20 -08:00
Brian Anderson
91067e9df4 Long lines 2012-12-15 22:38:20 -08:00
Jesse Jones
81805e0568 Check for oom in a few more places 2012-12-15 22:38:20 -08:00
Jesse Jones
0402360abb Abort instead of throwing on oom 2012-12-15 22:38:20 -08:00