Commit Graph

4948 Commits

Author SHA1 Message Date
Jesse Ruderman
ce432d4cf9 Fuzzer: remove exclusions for some issues that have been fixed 2011-09-09 17:31:08 -07:00
Marijn Haverbeke
db15591d89 Revert "Make for loops alias the vec elements, rather than copy them"
This reverts commit 985ef59efd.
2011-09-09 16:53:45 +02:00
Marijn Haverbeke
3ac59b0ee0 Get rid of vp2i in object field access
Closes #557
2011-09-09 15:53:10 +02:00
Marijn Haverbeke
985ef59efd Make for loops alias the vec elements, rather than copy them
The alias analysis was already assuming that it worked like this.
2011-09-09 15:34:13 +02:00
Marijn Haverbeke
0eb56e60d2 Get rid of trans::iter_sequence, use tvec::iter_vec instead 2011-09-09 15:06:06 +02:00
Marijn Haverbeke
9fb3ec95e0 Use a Phi node in trans_vec::iter_vec_raw
Rather than incrementing a spilled pointer
2011-09-09 14:20:15 +02: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
Marijn Haverbeke
e57435f68b Don't put 0-length array in the lltype of an arg-less variant
This seems to confuse LLVM in some very specific situations.

Closes #883
2011-09-09 13:51:15 +02:00
Marijn Haverbeke
b6e6f8b810 Fix scope issue in resolution of alt-arm patterns
Closes #885
2011-09-09 12:13:18 +02:00
Patrick Walton
87c6416d0c rt: Don't double-print commas when logging e.g. a vec of boxes 2011-09-08 13:24:21 -07:00
Patrick Walton
fb9ab95a15 rustc: When revoking a cleanup of a unique pointer, zero it out so that the GC won't try to visit it 2011-09-08 10:24:25 +02:00
Patrick Walton
7a0c9759fe rustc: Make unique pointers no longer immediates. 2011-09-08 10:24:14 +02:00
Brian Anderson
9946e467ff Export tag discriminants even for single-variant tags
I don't know exactly what's going on but this optimization is giving
me problems with the check-fast runner. I also don't see how it is
correct for external tags.
2011-09-07 10:32:58 -07:00
Brian Anderson
c047cfb710 Unwind the stack on task failure
When a task fails, we will throw an exception, then catch it at the bottom of
the stack.

On Windows we don't do this yet because the exception doesn't propagate
correctly.

No cleanups yet.

Issue #236
2011-09-07 10:32:58 -07:00
Brian Anderson
c337fd5467 Child tasks take a ref to their parents
This is so that when a child dies after the parent, it still holds a valid
pointer and can call supervisor->kill() safely.
2011-09-07 10:32:58 -07:00
Brian Anderson
25ae3d655c Rewrite spawn yet again
The motivation here is that the bottom of each stack needs to contain a C++
try/catch block so that we can unwind. This is already the case for main, but
not spawned tasks.

Issue #236
2011-09-07 10:32:58 -07:00
Brian Anderson
bb08ffbaf4 Refactor task failure a bit
Issue #236
2011-09-07 10:32:58 -07:00
Marijn Haverbeke
1339d05434 Work around destructuring bug 2011-09-07 17:01:46 +02:00
Marijn Haverbeke
f3edf8dd5e Make it possible to take the value of (and bind) native fns
Closes #820
2011-09-07 12:12:20 +02:00
Tim Chevalier
8ab02f7b21 Forbid blocks from deinitializing upvars
Move expressions where the RHS is an upvar are now forbidden within
block expressions.
2011-09-06 15:27:48 -07:00
Patrick Walton
d3e8887d3c rt: Implement poison-on-free, for debugging memory issues 2011-09-06 14:15:01 -07:00
Brian Anderson
23210a3293 Remove unused runtime functions. Issue #855 2011-09-03 00:50:57 -07:00
Brian Anderson
470eb3a58b Register new snapshots 2011-09-03 00:47:11 -07:00
Brian Anderson
1b67d211b4 Add a rust_str typedef to the runtime. Issue #855 2011-09-02 22:11:46 -07:00
Brian Anderson
01b254b411 Rename istr-stuff to str in the runtime. Issue #855 2011-09-02 22:11:46 -07:00
Brian Anderson
a1d71995ec Rename istr-stuff to str in rustc. Issue #855 2011-09-02 22:11:46 -07:00
Brian Anderson
f1555e2ca8 Rename ty_istr to ty_str. Issue #855 2011-09-02 22:11:46 -07:00
Brian Anderson
6217ce958e Print the type of istrs as 'str' in error messages. Issue #855 2011-09-02 22:11:46 -07:00
Brian Anderson
b16457627c Stop parsing transitional istr forms. Issue #855 2011-09-02 22:11:46 -07:00
Brian Anderson
c8fba11bd3 Remove transitional code from combine-tests.py. Issue #855 2011-09-02 22:11:46 -07:00
Brian Anderson
5c49e4f4e9 Reformat. Issue #855 2011-09-02 22:11:42 -07:00
Tim Chevalier
b5f9053423 Add a constraint to trans::type_of
trans::type_of now has a constraint saying that its type argument
is statically sized. This eliminates the "impossible happened" case
in type_of. Yay!

I note that this change decreased translation time for stage2/rustc
from 16.1 s to 14.0 s. I also think many of the remaining checks
could be eliminated with some mildly clever use of constrained types
and further preconditions. Future work!
2011-09-02 19:35:17 -07:00
Tim Chevalier
bdd0417cec Handle if-check with no else correctly in typestate
Propagate the if-check constraint into the consequent even when
there's no else branch. (Oops!)
2011-09-02 19:05:27 -07:00
Patrick Walton
b329324f71 rustc: Zero out unique pointers after we drop them 2011-09-02 17:51:28 -07:00
Brian Anderson
477c1bf6e1 Remove rustc::syntax::untyped_ast. Dead code 2011-09-02 16:40:59 -07:00
Brian Anderson
1e8200dadd Rename std::vec::unsafe::ivec_repr to vec_repr. Issue #855 2011-09-02 15:13:41 -07:00
Brian Anderson
72c14d5a41 Eliminate const_refcount. Issue #855 2011-09-02 15:13:41 -07:00
Brian Anderson
99ee0fca67 Remove estrs and evecs from runtime. Issue #855 2011-09-02 15:13:41 -07:00
Patrick Walton
e68f687179 rustc: Root values spilled via do_spill() 2011-09-02 15:12:27 -07:00
Patrick Walton
00470fef12 rt: Remove evecs from the shape code 2011-09-02 10:49:03 -07:00
Patrick Walton
10ea787772 test: Add a test case for linearize_ty_params() and shapes 2011-09-02 10:39:05 -07:00
Patrick Walton
670b60f027 rustc: Make the shape-emitting code aware of linearized type parameters 2011-09-02 10:27:08 -07:00
Marijn Haverbeke
785c26f7f4 Rename ivecs to vecs in the compiler 2011-09-02 16:09:41 +02:00
Marijn Haverbeke
a0e2809f54 Remove remaining evec support from trans 2011-09-02 15:56:59 +02:00
Brian Anderson
9c173f17c0 Remove lots of estr code from rustc. Issue #855 2011-09-01 23:25:33 -07:00
Brian Anderson
1d3eb4911a Remove #ifmt. Issue #855 2011-09-01 18:54:06 -07:00
Brian Anderson
418d09e547 Convert all uses of #ifmt to #fmt. Issue #855 2011-09-01 18:54:03 -07:00
Brian Anderson
b4b81117ce Register new snapshots 2011-09-01 18:42:46 -07:00
Brian Anderson
6972f07510 Make #fmt and #ifmt synonymous. Issue #855 2011-09-01 17:56:25 -07:00
Brian Anderson
fc45eb785a Use #env to get the rustc version again. Issue #855 2011-09-01 17:49:39 -07:00
Tim Chevalier
786963d33d Add a constraint in trans
Experimenting with adding typestate constraints in the compiler.
Added a constraint to GEP_tag that says the variant index is in
bounds. Added necessary checks.
2011-09-01 17:41:10 -07:00
Brian Anderson
60d0a9227b Do less work in run-pass/task-comm.rs
This test is not important enough to be taking so long
2011-09-01 17:33:39 -07:00
Brian Anderson
ab6bb035e5 Rename std::istr to std::str. Issue #855 2011-09-01 17:27:58 -07:00
Brian Anderson
913667ba25 Fix the error-patterns in 2 cfail tests. Issue #855 2011-09-01 17:19:36 -07:00
Brian Anderson
e35c021aa4 Parse "",str as istrs. Pretty print istrs as "",str. Issue #855 2011-09-01 16:53:53 -07:00
Brian Anderson
d8a833dccd Convert some comm tests to istrs. Issue #855
These spawn thunks need to take move-mode strings to be correct
2011-09-01 16:53:53 -07:00
Tim Chevalier
e412652f00 Make GEP_tag take a uint instead of an int
Seems to make more sense and avoids the need for some casts.
2011-09-01 16:32:05 -07:00
Tim Chevalier
1f4f8d317c Declare a bunch of int functions as pure 2011-09-01 16:32:05 -07:00
Tim Chevalier
ec763bba9c Add a test that lambdas can't deinitialize upvars 2011-09-01 16:32:05 -07:00
Brian Anderson
e824775d53 Remove std::str. Issue #855 2011-09-01 16:09:15 -07:00
Brian Anderson
1b15c9e155 Remove estr conversion functions. Issue #855 2011-09-01 15:55:39 -07:00
Brian Anderson
f07a328c16 Convert rust_list_files to istrs. Issue #855 2011-09-01 15:51:47 -07:00
Brian Anderson
82634cd530 Convert rust_getcwd to istrs. Issue #855 2011-09-01 15:51:47 -07:00
Brian Anderson
372aa4d210 Factor out make_istr utility function in runtime. Issue #855 2011-09-01 15:51:47 -07:00
Tim Chevalier
3690f38d79 No, not all fn constraints have the same args as the fn does, in the same order...
derp!

Closes #862
2011-09-01 15:41:09 -07:00
Brian Anderson
1262df652f Reduce the amount of locking in the kernel's memory region
The only thing here that really needs locking on malloc and free is
access to the allocation list, which is only used for TRACK_ALLOCATIONS.

Improves bench/task-perf-vector-party by 70%.
2011-09-01 14:20:43 -07:00
Brian Anderson
dabf1be226 Add a benchmark for cross-task kernel memory region synchronization
Vectors are allocated from the kernel's memory region, which has some heinous
synchronization. This is a stress test of vector allocation in many tasks.
2011-09-01 14:20:02 -07:00
Marijn Haverbeke
30447e1091 Remove misleading outdated comment in alias.rs 2011-09-01 22:37:52 +02:00
Marijn Haverbeke
458ac89894 Back out copy-glue
This wasn't a good idea after all.
2011-09-01 22:37:23 +02:00
Brian Anderson
ad3dcc0689 Remove the last use of istr::to_estr from rustc. Issue #855 2011-09-01 13:21:29 -07:00
Brian Anderson
8f531e769a Convert rust_file_is_dir from estrs to cstrs. Issue #855 2011-09-01 13:16:44 -07:00
Brian Anderson
baa1e8790d Check error code in rust_file_is_dir. Prevent comparison of uninitialized mem 2011-09-01 13:16:44 -07:00
Tim Chevalier
4951bb8bfc Test for #876
This is the test case for #876. Xfailed for now.
2011-09-01 13:12:59 -07:00
Brian Anderson
387903e702 Register new snapshots 2011-09-01 13:01:40 -07:00
Brian Anderson
91ea2577cd Remove a few more istr conversions. Issue #855 2011-09-01 12:14:36 -07:00
Brian Anderson
7924368268 Allow istrs as patterns. Issue #855 2011-09-01 12:14:36 -07:00
Brian Anderson
4c25d81041 Remove some uses of str_buf builtin. Issue #855 2011-09-01 12:14:35 -07:00
Brian Anderson
bb56a75343 Convert main functions to istrs. Issue #855 2011-09-01 12:14:35 -07:00
Brian Anderson
3fe743bc9c Remove various istr conversions. Issue #855 2011-09-01 12:14:34 -07:00
Brian Anderson
5ebe61cdda Consolidate std::str tests into stdtest::str 2011-09-01 12:14:34 -07:00
Brian Anderson
d0c509ad1b Remove a bunch of string builtins. Issue #855 2011-09-01 12:14:33 -07:00
Brian Anderson
a7bc386c53 Delete parts of std::str that are no longer exported. Issue #855 2011-09-01 12:14:33 -07:00
Brian Anderson
34d197de97 Remove last users of str::sbuf. Issue #855 2011-09-01 12:14:32 -07:00
Brian Anderson
b714150487 Remove more functions from std::str. Issue #855 2011-09-01 12:14:32 -07:00
Brian Anderson
6b22640a1f Convert std::test to istrs. Issue #855 2011-09-01 12:14:31 -07:00
Brian Anderson
775b64c955 Remove the estr #fmt. Issue #855 2011-09-01 12:14:31 -07:00
Brian Anderson
a45068cf27 Convert fs::path_is_absolute internals to istrs. Issue #855 2011-09-01 12:14:30 -07:00
Patrick Walton
cc08fd1ef9 rt: Allow iteration over the dynastack 2011-09-01 11:47:59 -07:00
Patrick Walton
9d00ef9a46 rt: Make logging more resilient to null vector pointers (useful when debugging GC) 2011-09-01 11:47:58 -07:00
Patrick Walton
bbac2dd768 rt: Make debug string in rust_obstack slightly prettier 2011-09-01 11:47:58 -07:00
Patrick Walton
83ac32e8aa rt: Zero out dynamic allocas for now 2011-09-01 11:47:58 -07:00
Patrick Walton
a6c14964c8 rt: Include rust_shape.h in rust_obstack.cpp and remove the duplicate DPRINT() macro 2011-09-01 11:47:58 -07:00
Patrick Walton
156bc7f012 rt: Add a missing FIXME to rust_obstack.cpp for segmented stacks 2011-09-01 11:47:58 -07:00
Patrick Walton
876142f051 rt: Remove duplicate DPRINT() macro from rust_gc.cpp 2011-09-01 11:47:58 -07:00
Patrick Walton
60137273d2 rt: Disable debug spew in rust_shape 2011-09-01 11:47:58 -07:00
Marijn Haverbeke
fb196e6ef1 Make alias analysis properly recognize closures in call position
I figured this'd break a few things, but in fact it causes no problems
whatsoever.
2011-09-01 16:38:30 +02:00
Marijn Haverbeke
6ba4eacddf Make resolve recognize upvars
Upvars are now marked with def_upvar throughout, not just when going
through freevars::lookup_def. This makes things less error-prone. One
thing to watch out for is that def_upvar is used in `for each` bodies
too, when they refer to a local outside the body.
2011-09-01 16:32:44 +02:00
Marijn Haverbeke
2d1dec78e7 Move mutability checking into its own pass.
Having it in the alias pass was slightly more efficient (finding
expression roots has to be done in both passes), but further muddled
up the already complex alias checker.

Also factors out some duplication in the mutability-checking code.
2011-09-01 16:32:38 +02:00
Marijn Haverbeke
34ae491ca9 Store arg mode and objfield mutability in their def 2011-09-01 16:32:38 +02:00
Marijn Haverbeke
9ba3fe5e40 Clean up handling of restriction contexts in alias analysis 2011-09-01 09:45:55 +02:00
Brian Anderson
91f05fba11 Reexport std::str::alloc. Windows still needs this. Issue #855 2011-08-31 21:15:08 -07:00
Erick Tryzelaar
b199e9da92 Expose STDERR to rust. 2011-08-31 20:40:00 -07:00
Patrick Walton
614a930c51 rt: Make the dynamic stack self-describing 2011-08-31 19:19:05 -07:00
Patrick Walton
729437d2c0 rt: Set n_params appropriately in upcall_get_type_desc 2011-08-31 18:03:12 -07:00
Brian Anderson
53a9d5a1d2 Start paring down std::str. Issue #855 2011-08-31 16:24:09 -07:00
Brian Anderson
cb55ef6e12 Convert benchmarks to istrs. Issue #855 2011-08-31 16:24:08 -07:00
Brian Anderson
04700066f3 Convert fuzzer to istrs. Issue #855 2011-08-31 16:24:08 -07:00
Brian Anderson
81b31429e4 Remove more uses of str from std::run. Issue #855 2011-08-31 16:24:08 -07:00
Brian Anderson
1772ee3c43 Remove a few more usages of std::str from rustc. Issue #855 2011-08-31 16:24:08 -07:00
Patrick Walton
dc6f78561c rt: Prevent trailing commas from showing up when logging oddly aligned arrays 2011-08-31 16:22:19 -07:00
Patrick Walton
dfcbfa61f3 rt: Introduce "end_dp" bailouts in order to avoid marching past the end of oddly aligned vectors 2011-08-31 16:02:17 -07:00
Patrick Walton
143569fce4 rt: Make |align| a member of the shape glue class instead of threading it through every function 2011-08-31 15:25:32 -07:00
Michael Sullivan
03ddc8fdd3 Don't check arguments types if there are an incorrect number of args. Closes #871. 2011-08-31 16:46:46 -04:00
Michael Sullivan
7c02517f75 Check all paths return properly in blocks. Closes #874. 2011-08-31 16:15:02 -04:00
Michael Sullivan
722fa00681 Get rid of the hack that ignores () typed things in fn tail position.
Closes #868. Unfortunately, this causes certain invalid programs to
fail type-checking instead of failing type-state when a type-state
error message would probably be more intuitive. (Although, by any
reasonable interpretation of the static semantics, it technically
ought to be a type error.)
2011-08-31 16:01:25 -04:00
Brian Anderson
498e38b705 Convert uses of #fmt to #ifmt. Issue #855 2011-08-31 11:44:06 -07:00
Michael Sullivan
959938e891 Produce the start of an immutable treemap. 2011-08-31 14:10:15 -04:00
Marijn Haverbeke
6209e844ee Replace xfail-stageN with simply xfail-test
Closes #799
2011-08-31 16:32:16 +02:00
Marijn Haverbeke
66bc014720 Revert "Replace xfail-stageN with simply xfail-test"
This reverts commit 574194f6bc.
2011-08-31 14:24:08 +02:00
Marijn Haverbeke
574194f6bc Replace xfail-stageN with simply xfail-test
Closes #799
2011-08-31 13:43:09 +02:00
Brian Anderson
c36d29c1dc Register new snapshots 2011-08-31 00:44:40 -07:00
Brian Anderson
be2ad97a61 Allow main to take istrs. Issue #855 2011-08-30 23:57:09 -07:00
Brian Anderson
4007006574 Convert compiletest to istrs. Issue #855 2011-08-30 21:08:07 -07:00
Brian Anderson
eb70267e5e Convert #env to istrs. Temporarily disable usage in rustc. Issue #855 2011-08-30 21:08:07 -07:00
Brian Anderson
04928ed3f0 Add a FIXME about the bogosity of aio::ip_to_sbuf 2011-08-30 21:08:07 -07:00
Brian Anderson
c94d4cff03 Convert std::net to istrs. Issue #855 2011-08-30 21:08:07 -07:00
Brian Anderson
0abec867c3 Support istrs as fail argument. Issue #855 2011-08-30 21:08:07 -07:00
Brian Anderson
4c936d7992 Add #ifmt extension, like #fmt but for istrs. Issue #855 2011-08-30 21:08:07 -07:00
Brian Anderson
9e2c5f77a4 Remove the %S istr conversion from #fmt
I want to do the #fmt transition a different way. Issue #855
2011-08-30 21:08:07 -07:00
Patrick Walton
fc0212a63b rt: Override the character interpretation of u8/i8 values when logging 2011-08-30 19:34:27 -07:00
Patrick Walton
c6a47e4087 rustc: Hoist derived tydesc GC roots up to the top of the function so the GC doesn't try to access uninitialized tydescs 2011-08-30 17:46:56 -07:00
Tim Chevalier
6d8bb3ce29 Un-xfail zip-same-length
There was a type error that was getting reported poorly. Fixed it.
(Now to figure out why the error was reported so poorly...)
2011-08-30 17:19:13 -07:00
Tim Chevalier
9f7ed2f054 Add a total version of vec::last that has a precondition 2011-08-30 17:17:42 -07:00
Tim Chevalier
4fc72c2130 XFAIL zip-same-length -- that's ok, since it's a new test 2011-08-30 16:43:12 -07:00
Tim Chevalier
819b00079c Library test cases for vec::zip 2011-08-30 16:42:32 -07:00
Tim Chevalier
268533a920 Add a precondition on vec::zip
vec::zip now has the precondition that the two argument vectors
are the same length. Changed uses of it to reflect that.

Also added a few vector-enumerating utilities to vec.rs, which
necessitated in making some functions in u8 declared-pure.
2011-08-30 16:39:22 -07:00
Tim Chevalier
d37e8cfc67 Test that fn preconditions get typechecked 2011-08-30 16:39:17 -07:00
Tim Chevalier
2e53da5126 Typecheck function preconditions
It turned out that function preconditions weren't getting checked
at all, so you could write a constraint on a fn decl that was total
nonsense. Fixed now.
2011-08-30 16:20:16 -07:00
Tim Chevalier
f62add95da Eliminate an unchecked use of map::get in ppaux 2011-08-30 16:19:52 -07:00
Patrick Walton
b722dc36a5 rt: Fix logging of type-parametric resources 2011-08-30 15:56:42 -07:00
Patrick Walton
05d96f155f rustc: Allow non-type-parametric resources to be logged 2011-08-30 13:50:48 -07:00
Marijn Haverbeke
7bbe8d2e8c Stop relying on klunky hack in alias.rs
It assumed node_ids increased monotonically for locals, but macros
make this no longer the case, and it was a dubious assumption anyway.
It now numbers locals itself and uses that to determine which precede
which.
2011-08-30 17:03:00 +02:00
Marijn Haverbeke
61392f9f82 Clean up trans_build, factor repeated code into function 2011-08-30 14:02:20 +02:00
Marijn Haverbeke
e17e6af4f0 Change a number of result-returning functions to return @block_ctxt
The uniformity doesn't seem to be worth the extra noise and pointless
code being generated. If something doesn't produce a value, don't make
it return one. (For now, trans_[exprtype] things are left in the result-
returning form, even when they never return anything useful, since in
that case uniformity is arguably helpful.)
2011-08-30 13:50:58 +02:00
Marijn Haverbeke
adec3ecfe0 Remove compiler-bug-workaround that's no longer needed 2011-08-30 13:10:10 +02:00
Marijn Haverbeke
c1ba28c777 Glob-import trans_build in other trans files
The capitalization already prevents name clashes. Being able to refer to the
bitcode-construction primitives directly makes the code cleaner.
2011-08-30 13:04:57 +02:00
Graydon Hoare
41fb042def Stab-in-the-dark error fix for the crashing windows tinderboxes. Helps win2 anyways. 2011-08-29 17:35:24 -07:00
Patrick Walton
f1ed03dfa5 rt: Have data::walk_fn be defensive regarding whether the derived implementation of walk_fn moves the data pointer 2011-08-29 16:50:06 -07:00
Patrick Walton
0a4d43379e rt: Move to a custom alignof since __alignof__ returns the "preferred" alignment rather than the one that gets used in structs 2011-08-29 16:24:03 -07:00