Commit Graph

1572 Commits

Author SHA1 Message Date
bors
88dd53a754 auto merge of #6081 : brson/rust/out-of-stack, r=thestinger
People hit the recursion depth limit too often, it's not possible
to unwind reliably from out-of-stack.

Issues #3555, #3695
2013-04-27 16:24:34 -07:00
Brian Anderson
149047e55d rt: Set the stack depth limit to 1GB. Abort on error.
People hit the recursion depth limit too often, it's not possible
to unwind reliably from out-of-stack.

Issues #3555, #3695
2013-04-26 15:39:54 -07:00
Huon Wilson
1fc8a2f2a4 rt: use the [u]int[nn]_t types in the RNG.
This means that `ub4`s are always 4 bytes, rather than being 8 bytes on
x64. (Suggested but not implemented by upstream: "Porting it to a 64-bit
machine [...] may just need an adjustment of the definition of ub4")
2013-04-26 22:13:24 +10:00
Huon Wilson
106fd12423 rt: pull upstream ISAAC code for consistency between 32/64 bit platforms
The "unsigned 4 byte" `ub4`s are actually 8 bytes on 64-bit platforms
which mean that some bits > 2**32 were retained in calculations, these
would then "reappear" after a shift and so the stream of random numbers
would differ on 32 bit vs 64 bit platforms.
2013-04-25 17:59:42 +10:00
gareth
91aeecf7e3 Fix issue #5976 - HANDLE leaks and undefined/bad behavour
on windows.
2013-04-23 21:23:15 +01:00
Alex Crichton
391de1c690 Remove a stray new operator in rust_task.h 2013-04-23 00:55:13 -04: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
bors
8b3c09a103 auto merge of #5962 : pcwalton/rust/shootout, r=pcwalton
r? @brson
2013-04-19 19:24:52 -07: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
Patrick Walton
9902e798d5 rt: Remove dump_stacks 2013-04-19 12:00:08 -07:00
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