Commit Graph

6397 Commits

Author SHA1 Message Date
Brian Anderson
d1ef29ab37 rt: rust_task::conclude_failure doesn't need to call unblock 2011-11-18 13:23:27 -08:00
Brian Anderson
3a6320f71b intrinsics: Eliminate recv intrinsic
This intrinsic existed just to get ahold of the return pointer. I replaced it
with a call_with_retptr intrinsic that grabs the return pointer and passes it
to another Rust function, thereby eliminating the need to call C functions on
the Rust stack.
2011-11-18 12:48:54 -08:00
Brian Anderson
93931311ff rt: Add FIXMEs about races in rust_task 2011-11-18 10:32:27 -08:00
Brian Anderson
0dfa1410d3 rt: Remove task::on_wakeup. Unused 2011-11-18 10:32:27 -08:00
Brian Anderson
63d40b8ab6 rt: Remove some unnecessary setting of rust_task::killed
The value of this variable doesn't matter after the task fails.
2011-11-18 10:32:27 -08:00
Brian Anderson
d52888f0ba rt: Remove rust_task::yield. Unused 2011-11-18 10:32:27 -08:00
Brian Anderson
5e9f9e8c48 rt: Add some comments about methods that run on the Rust stack 2011-11-18 10:32:27 -08:00
Brian Anderson
21865ddce6 intrinsics: Remove the call to get_task from task_sleep 2011-11-18 10:32:27 -08:00
Brian Anderson
eecbc815ac intrinsics: Add some comments 2011-11-18 10:32:27 -08:00
Brian Anderson
3feaecd757 intrinsics: Move the call to upcall_fail out of rust_intrinsic_cast 2011-11-18 10:32:27 -08:00
Brian Anderson
44aebb978c Add tests for unsafe::reinterpret_cast 2011-11-18 10:32:27 -08:00
Brian Anderson
9ca2005959 rt: Remove size_of and align_of functions. Now written in Rust 2011-11-18 10:32:27 -08:00
Brian Anderson
a9f7cbe240 stdlib: Add tests for sys::size_of and sys::align_of 2011-11-18 10:32:27 -08:00
Brian Anderson
1f74af505f stdlib: Add some useful fields to the definition of type_desc 2011-11-18 10:32:27 -08:00
Marijn Haverbeke
0e21df4610 Add some comments to kind.rs and last_use.rs 2011-11-18 17:09:36 +01:00
Marijn Haverbeke
8cf3ca3b55 Make sure by-copy arguments take last-use into account 2011-11-18 16:43:30 +01:00
Marijn Haverbeke
1cccefd8bb Register snapshot, finishing kind system transition
Closes #1177
2011-11-18 16:17:37 +01:00
Marijn Haverbeke
a7573af59d Add some tests for new kind system
Issue #1177
2011-11-18 16:15:46 +01:00
Marijn Haverbeke
196b2b920f Make sure trans translates record fields in the order they appear in code
This prevents surprising side-effect orders, and makes them easier for
the other passes to deal with.
2011-11-18 15:59:47 +01:00
Marijn Haverbeke
68db68c4cc Make trans use last_use info to not actually generate copies
Issue #925
2011-11-18 15:56:53 +01:00
Marijn Haverbeke
f6491bb426 Update stdlib, compiler, and tests to new kind system
This involved adding 'copy' to more generics than I hoped, but an
experiment with making it implicit showed that that way lies madness --
unless enforced, you will not remember to mark functions that don't
copy as not requiring copyable kind.

Issue #1177
2011-11-18 12:49:01 +01:00
Marijn Haverbeke
8f8ebb550c Implement a last-use-of-local finding algorithm
Issue #925
2011-11-18 12:49:01 +01:00
Marijn Haverbeke
0c97fcbf66 Properly check kinds in instantiation of generics
Issue #1177
2011-11-18 12:49:01 +01:00
Marijn Haverbeke
7bef89f9b5 Prevent alias pass from inserting implicit copies for noncopyable types
Issue #1177
2011-11-18 12:49:01 +01:00
Marijn Haverbeke
17b78c4a7a Overhaul the kind-checking pass
Not really useful yet because missing last-use-of-local optimization.

Also: instantiation of type parameters needs to be checked.

Issue #1177
2011-11-18 12:49:01 +01:00
Marijn Haverbeke
cefff237bf Make tag, resource and object constructors take their arguments by copy
Doing something like some([1, 2, 3]) will now no longer create a temporary
copy of the vector. It will also be easier for the kind checker to see that
putting a resource into a data-structure constructor is safe.
2011-11-18 12:49:01 +01:00
Marijn Haverbeke
4e03112141 Add a pass-by-copy parameter passing convention
This is intended to solve the problem of how to pass arguments to
constructor functions -- you want to move in rvalues, but not have to
explicitly copy stuff that is not an rvalue. The by-copy passing
convention will ensure the callee gets its own copy of the value. For
rvalues, it'll just pass off the value. For lvalues, it'll make a
copy.

Issue #1177
2011-11-18 12:49:00 +01:00
Marijn Haverbeke
6297fc979e Register snapshot 2011-11-18 12:48:57 +01:00
Marijn Haverbeke
9cf48d3753 Preparation for kind system overhaul
This goes before a snapshot, so that subsequenct patches can make the
transition without breaking the build. Disables kind checking pass, makes
parser accept both new and old-style kind annotation.

Issue #1177
2011-11-18 10:52:28 +01:00
Niko Matsakis
eff7fae7b9 comparing/walking two pointers still aligns same as 1 ptr 2011-11-17 15:41:45 -08:00
Niko Matsakis
b30f7af98b remove blank line 2011-11-17 15:11:52 -08:00
Niko Matsakis
60e93cd1ec Re-enable cycle coll. on x86_64, seems to work better now. 2011-11-17 14:40:03 -08:00
Niko Matsakis
f597971441 make ref cnts a long not an int 2011-11-17 14:23:48 -08:00
Niko Matsakis
8925875ccb add FIXME for issue #1184 2011-11-17 13:44:13 -08:00
Niko Matsakis
0d874476cf fix resource-generic 2011-11-17 13:44:13 -08:00
Niko Matsakis
11187437c5 Merge branch 'master' of github.com:graydon/rust 2011-11-17 13:44:04 -08:00
Brian Anderson
6a0e85b81c Remove intrinsic_2 functions 2011-11-17 13:23:35 -08:00
Brian Anderson
5e7dff4db5 Register snapshots 2011-11-17 13:22:29 -08:00
Brian Anderson
3bffb8b5de build: Add various shorthand make check rules 2011-11-17 12:04:37 -08:00
Niko Matsakis
f9231e932c add an extra underscore 2011-11-17 12:02:15 -08:00
Brian Anderson
dd275cd749 Stop using temporary intrinsic_2 functions 2011-11-17 11:55:04 -08:00
Niko Matsakis
e7ad5978d9 Merge branch 'master' of github.com:graydon/rust 2011-11-17 11:52:56 -08:00
Brian Anderson
30871408a6 rt: Remove debug printf in rust_start 2011-11-17 11:48:10 -08:00
Niko Matsakis
adc79e2f44 remove compile-command from local variable blocks 2011-11-17 11:46:13 -08:00
Brian Anderson
c1cf7cb323 Register snapshots 2011-11-17 11:44:31 -08:00
Brian Anderson
a92699fe58 rt: Make morestack link on x86_64. Still utterly broken 2011-11-17 11:12:59 -08:00
Brian Anderson
d624e523c9 rt: Make stack growth code build on Linux 2011-11-17 10:53:06 -08:00
Patrick Walton
e6c3c4e48c rt: More work on morestack 2011-11-17 10:52:59 -08:00
Haitao Li
f4eb25e0d0 tutorial: Fix type mismatch in example FFI code
Compile error:
time.rs:13:23: 13:43 error: mismatched types: expected
*R[tv_sec=mMltv_usec=mMl] but found *R[tv_sec=Mltv_usec=Ml] (record
elements differ in mutability)
time.rs:13     libc::gettimeofday(std::ptr::addr_of(x),
std::ptr::null());
                                  ^~~~~~~~~~~~~~~~~~~~
error: aborting due to previous errors
rust: upcall fail 'explicit failure', ../src/comp/driver/session.rs:70
rust: domain main @0x9dfd178 root task failed
2011-11-17 22:50:08 +08:00
Haitao Li
388eed383f rustc: Add a flag '--warn-unused-imports'
Followup of issue #889
2011-11-17 09:28:30 +01:00