Commit Graph

263 Commits

Author SHA1 Message Date
Brian Anderson
0639b67290 rt: Use get_task_from_tcb during stack growth calls 2012-03-21 19:10:32 -07:00
Brian Anderson
1cb35c9b26 rt: Rename record_sp to record_sp_limit 2012-03-21 19:10:31 -07:00
Brian Anderson
6115b13dfc rt: Don't switch to the C stack on the upcall_new_stack fast path 2012-03-21 19:10:31 -07:00
Brian Anderson
8a145a601e rt: Don't swatch stacks during upcall_del_stack 2012-03-21 19:10:31 -07:00
Graydon Hoare
869b2d7064 Send string concatenation to specialized upcall, shave 17s off librustc compile time. 2012-03-19 14:29:39 -07:00
Marijn Haverbeke
22bef74b55 Remove shared tydescs
All tydescs are static now, there's no need to worry about
marshalling them between threads anymore.
2012-03-16 15:38:42 +01:00
Marijn Haverbeke
76d07f4056 Remove dynastack support from runtime
Issue #1982
2012-03-16 00:44:06 +01:00
Marijn Haverbeke
146b61189a Get rid of rust_crate_cache in the runtime
We are no longer generating dynamic tydescs or dicts.

Issue #1982
2012-03-16 00:44:06 +01:00
Brian Anderson
8d617e638e rt: Reset the stack boundary after returning from crust functions 2012-02-28 17:56:15 -08:00
Marijn Haverbeke
b1d7f252a9 Remove unused tydesc argument to upcall_shared_malloc 2012-02-21 17:08:14 +01:00
Brian Anderson
54d7bffbb8 rt: Make upcall_vec_push an intrinsic 2012-02-17 12:08:03 -08:00
Brian Anderson
d23cd8f52f rt: Don't hit TLS on upcall_vec_push unless necessary 2012-02-17 11:37:17 -08:00
Brian Anderson
a3fdd8c93f rt: Don't log on entry to upcall_vec_push. Also slow 2012-02-17 11:37:17 -08:00
Brian Anderson
fca8e9e621 rt: Don't do the stack canary check in upcall_vec_push. Too slow 2012-02-17 11:37:17 -08:00
Brian Anderson
e0b2fd8417 rt: Simplify upcall_vec_push 2012-02-17 11:37:17 -08:00
Brian Anderson
d90a9d3da0 rt: Inline everything on the C-stack-switching path 2012-02-09 22:15:15 -08:00
Brian Anderson
5d2442d89c rt: Add upcall_call_shim_on_rust_stack 2012-02-09 19:00:16 -08:00
Brian Anderson
ea76d3f454 rt: Add rust_task::call_on_c_stack 2012-02-09 19:00:16 -08:00
Brian Anderson
1e2fe4ab8f rt: Rename call_shim_on_c_stack to call_and_change_stacks 2012-02-09 19:00:15 -08:00
Brian Anderson
4bd8f8d936 rt: Rename new_stack to next_stack, del_stack to prev_stack 2012-02-09 19:00:15 -08:00
Brian Anderson
f94339cc1c rt: Rename rust_scheduler to rust_task_thread 2012-02-03 23:48:12 -08:00
Marijn Haverbeke
c1b075d042 Remove experimental GC code
It's been sitting unused long enough to have bitrotted completely.
2012-02-03 11:34:12 +01:00
Niko Matsakis
196d69beb2 make boxes self-describing (fixes #1493)" (take 2)
this will be used to generate a new snapshot.
2012-02-01 18:52:08 -08:00
Niko Matsakis
3116643806 Revert "make boxes self-describing (fixes #1493)" until a new
snapshot is prepared.
2012-02-01 18:50:19 -08:00
Niko Matsakis
c36207bfb8 make boxes self-describing (fixes #1493) 2012-02-01 18:18:07 -08:00
Niko Matsakis
7bc2930cfa roll back commit 1c7a62 2012-01-17 20:21:09 -08:00
Marijn Haverbeke
1c7a62c93b Use a memset upcall to zero things without static alignment
This fixes issues #843 and #1546. The cost of an upcall is
unfortunate, though. I assume there must be a way to simply manually
compute the pointer or size, using something akin to the formula in
`align_to` in `rust_util.h`. I could not get this to work,
unfortunately.
2012-01-17 14:04:55 +01:00
Niko Matsakis
263f4c58a0 add tydescs into shape, rewrite walk_fn_contents() 2012-01-12 13:47:38 -08:00
Niko Matsakis
e55aa6e5ef free uniq data we encounter on the sweep, walk thru them otherwise 2012-01-12 13:47:38 -08:00
Niko Matsakis
5bee80612b fix valgrind error: allocate enough space for all type descs 2012-01-07 08:03:34 -08:00
Niko Matsakis
6237368cc2 plug leak: free shared type descrs recursively, as we ought to 2012-01-06 22:40:32 -08:00
Niko Matsakis
8506241f3a fix how we walk functions to match new closure fmt 2012-01-06 22:40:31 -08:00
Marijn Haverbeke
822acdd170 Make binding of fns with bounded type parameters work
Interns non-static dicts to heap-allocated equivalents so that they no
longer have stack scope.

Closes #1436
2012-01-06 17:40:05 +01:00
User Jyyou
a59c4b1b47 freebsd support 2012-01-01 20:18:55 -08:00
Brian Anderson
cab4da70c8 rt: Don't check the stack canary on most upcalls 2011-12-20 16:50:54 -08:00
Brian Anderson
6443a7b513 rt: Do fewer stack canary checks 2011-12-20 13:54:47 -08:00
Brian Anderson
784713ec68 rt: Add a canary value to the end of every stack
Check it on upcall entry and exit, and on stack deletion
2011-12-20 11:48:47 -08:00
Brian Anderson
50dc80f617 rt: Give upcall_new_stack the same convention as other upcalls 2011-12-19 16:24:10 -08:00
Brian Anderson
bedcaad97e rt: Give upcall_del_stack the same convention as other upcalls 2011-12-19 16:24:10 -08:00
Brian Anderson
bd6b80c972 rt: Get rid of the rethrow in upcall_fail
Throwing in upcall_fail ends up running lots of code in the red zone. To avoid
it we have the personality function figure out which stack it's on and switch
as needed.
2011-12-18 17:17:31 -08:00
Brian Anderson
c73eb8ff51 rt: Create different stack-switching paths for upcalls and shims
Shims need to play with the stack limit, upcalls don't. Only one upcall,
upcall_fail is allowed to catch, and we need a find a way to get rid of that
catch as well because it results in _Unwind_Resume running off the end of the
Rust stack.
2011-12-18 16:17:55 -08:00
Brian Anderson
7da8ab8fab rt: Turn on stack alignment checks for mac 2011-12-17 14:10:40 -08:00
Brian Anderson
ab4f35c1f1 rt: Only call check_stack_alignment on linux 2011-12-16 18:18:43 -08:00
Brian Anderson
121c420184 rt: Insert stack alignment checks into upcalls 2011-12-16 18:18:43 -08:00
Niko Matsakis
88818334b7 update to not look at descs[], which is not necessarily valid
if the input is a statically allocated type_desc
2011-12-16 08:06:45 -08:00
Niko Matsakis
1e3259e119 massive refactor of how closures work 2011-12-15 13:44:06 -08:00
Niko Matsakis
35fe86dab7 export upcall_clone_type_desc 2011-12-14 14:32:25 -08:00
Niko Matsakis
f512e67fb9 clone type desc into exchange heap 2011-12-14 14:32:24 -08:00
Niko Matsakis
6a8cb704d9 get basic code generation working, clone type descs for lambda[send] 2011-12-14 14:32:20 -08:00
Brian Anderson
b73caec3ce rt: Call upcall_fail on the C stack 2011-12-11 14:35:18 -08:00
Brian Anderson
94b0fee6f1 rt: Reorganize and add documentation for rust_upcall.cpp 2011-12-07 18:50:23 -08:00
Brian Anderson
31fe5d0bd8 rt: Run most upcalls on the C stack 2011-12-07 18:50:23 -08:00
Brian Anderson
3d7b89bc4d rt: Reorganize rust_upcall.cpp a bit 2011-12-06 21:44:19 -08:00
Brian Anderson
00636e3155 rt: Convert log_type and cmp_type upcalls to shim form 2011-12-06 21:44:19 -08:00
Brian Anderson
c11d0b0aa0 rt: Move upcall_cmp_type/upcall_log_type to rust_upcall.cpp 2011-12-06 21:44:18 -08:00
Niko Matsakis
9b7347dd96 modify upcalls to take structs as args 2011-12-06 21:44:18 -08:00
Brian Anderson
9a738fd61d rt: Various tweaks to make __morestack unwinding work on linux
When unwinding through __morestack the stack limit in the TLS is invalidated
and must be reset. Instead of actually landing at __morestack we're
just going to make all our Rust landing pads call upcall_reset_stack_limit,
which will find the stack segment that corresponds to the current stack
pointer and put the limit in the TLS.

Also massively expand the stack segment red zone to make more room for the
dynamic linker. Will fix in the future.
2011-12-06 16:32:41 -08:00
Brian Anderson
58844aee42 rt: Make stack unwinding work more correctly with stack growth 2011-12-05 17:42:58 -08:00
Brian Anderson
a731f165df test: Test hitting the dynamic linker in the red zone 2011-12-05 17:20:59 -08:00
Brian Anderson
3b8bfaf534 rt: Use an out pointer for rust_new_stack
upcall_call_shim_on_c_stack does not handle return values
2011-12-05 17:11:35 -08:00
Brian Anderson
98cd96ce96 test: Add more tests for stack growth 2011-12-05 14:44:15 -08:00
Brian Anderson
f2de42c39a rt: Reorganize stack growth code 2011-11-30 20:31:33 -08:00
Brian Anderson
408d4ec0ef rt: Remove upcall_alloc_c_stack/call_c_stack, et. al.
We are using upcall_call_shim_on_c_stack now
2011-11-30 20:31:32 -08:00
Niko Matsakis
9fa44a41e6 get pure wrappers approach running 2011-11-18 16:32:19 -08:00
Niko Matsakis
8011e3fabb hack around on makefiles trying to get a 64 bit build
right now there are many temporary hacks, search for NDM to find them
2011-11-02 14:13:22 -07:00
Marijn Haverbeke
8124846b2c Get rid of taskpointer-passing throughout the compiler
Only intrinsics still take a dummy taskptr. We'll have to do some
makefile stunts to snapshot a version without taskptrs-in-intrinsics.

Issue #466
2011-10-20 14:22:17 +02:00
Marijn Haverbeke
457683c7fe Do not pass taskpointers to "rust" native functions
Issue #466
2011-10-20 14:22:17 +02:00
Marijn Haverbeke
6323a012bd Remove taskptr argument from upcalls
Issue #466
2011-10-20 13:15:21 +02:00
Patrick Walton
1eaaae860f rt: Add an upcall to allocate space on the C stack. This will be used for native calls on the C stack. 2011-09-28 11:31:44 -07:00
Patrick Walton
9ba86178ef rt: Store the task in TLS 2011-09-27 18:12:03 -07:00
Patrick Walton
81f1863de7 rt: Remove obsolete comment 2011-09-26 10:24:21 -07:00
Patrick Walton
61afef29a1 rt: Add a RUST_TRACK_ORIGINS debug flag to help track down memory corruption 2011-09-23 11:42:20 -07:00
Patrick Walton
eafb70072a rt: Zero out allocations so that the CC won't die if it happens to run while a box is being constructed.
This is kind of unfortunate.
2011-09-20 19:15:46 -07:00
Patrick Walton
e26b1883dd rt: Stub code for the cycle collector 2011-09-20 16:49:31 -07:00
Patrick Walton
77f0101edb rt: Add an on-the-side GC chain 2011-09-20 15:35:14 -07:00
Patrick Walton
307957710c rt: Remove the GC alloc chain 2011-09-20 14:20:16 -07:00
Patrick Walton
45086b7bfd rt: Remove #include "rust_box.h" 2011-09-20 14:07:10 -07:00
Patrick Walton
e981abdb01 rt: Remove upcall_malloc_box and upcall_free_box; I don't think they'll be necessary after all 2011-09-20 13:50:15 -07:00
Patrick Walton
3632629acc rt: Introduce a self-describing box representation and functions to create and free them 2011-09-19 11:40:41 -07:00
Patrick Walton
18cf4d904c rt: Add libunwind.h support on Mac OS X 2011-09-15 12:52:50 -07:00
Brian Anderson
9f4b4d89ce Add upcall_rust_personality
This just wraps __gxx_personality_v0 with our upcall naming convention

Issue #236
2011-09-11 17:31:38 -07:00
Marijn Haverbeke
139b1d1b31 Get rid of some unused upcalls
I guess these became obsolete when the communication stuff moved into
the stdlib.
2011-09-09 14:02:07 +02:00
Marijn Haverbeke
bd2ec03771 Remove unused logging upcalls from runtime 2011-09-09 13:55:43 +02:00
Brian Anderson
bb08ffbaf4 Refactor task failure a bit
Issue #236
2011-09-07 10:32:58 -07:00
Brian Anderson
23210a3293 Remove unused runtime functions. Issue #855 2011-09-03 00:50:57 -07:00
Brian Anderson
99ee0fca67 Remove estrs and evecs from runtime. Issue #855 2011-09-02 15:13:41 -07:00
Patrick Walton
614a930c51 rt: Make the dynamic stack self-describing 2011-08-31 19:19:05 -07:00
Marijn Haverbeke
b099b1e3f7 Make std::istr::push_byte efficient
It used to allocate two (!) heap values per pushed byte. It now goes through
a runtime function that simply grows the istr and writes the byte.
2011-08-29 22:46:49 +02:00
Marijn Haverbeke
14567c5eb0 Factor vector reserve code in runtime into its own function 2011-08-29 22:35:29 +02:00
Marijn Haverbeke
c9c5ee252a Implement non-internal ivecs
Vectors are now similar to our old, pre-internal vectors, except that
they are uniquely owned, not refcounted.

Their name should probably change too, then. I've renamed them to vec
in the runtime, will do so throughout the compiler later.
2011-08-29 09:07:53 +02:00
Patrick Walton
880fd788eb rustc: Add an extra flag to object tydescs so that shapes know how to find the captured subtydescs 2011-08-25 12:01:10 -07:00
Marijn Haverbeke
e58c48bdda Optimize += [x] into a simple push operation
This is a preparation for making vectors always-on-the-heap again,
which would cause way too much malloc traffic for this idiom. I will
add an efficient std::vec::push in the future, and migrate += [x] to
that instead.

Reduces compiler code size by 3%
2011-08-24 13:57:27 +02:00
Marijn Haverbeke
7588a89553 Rename copy_glue back to take_glue 2011-08-22 10:42:56 +02:00
Patrick Walton
d0171913aa rt: Remove rustboot's GC infrastructure 2011-08-19 19:17:05 -07:00
Patrick Walton
cede5e53b3 rt: Call maybe_gc on mallocs 2011-08-19 14:30:01 -07:00
Brian Anderson
0467fa6a00 Rename rust_vec to rust_evec 2011-08-18 14:43:17 -07:00
Brian Anderson
504ec8b00d Rename some vec upcalls and trans functions from vec* to evec* 2011-08-18 13:09:50 -07:00
Brian Anderson
7903daf86f Remove upcall_new_vec 2011-08-18 13:09:50 -07:00
Patrick Walton
f17edf9829 rustc: Use obstacks in lieu of dynamically-allocated frames only when the frame is actually dynamically-sized 2011-08-17 18:14:57 -07:00
Patrick Walton
df51fe36f1 Revert "rt: Use obstacks in lieu of dynamically-sized frames"
This reverts commit cc5fcfce89.
2011-08-17 17:27:31 -07:00