Commit Graph

3366 Commits

Author SHA1 Message Date
Tim Chevalier
a6f36ba3f5 removing log statement that snuck in there 2011-06-27 11:38:07 -07:00
Tim Chevalier
1656fa19ef Implement move for scalar values
Before, something like:

let int y = 42;
let int x;
x <- y;

would cause an LLVM assertion failure. Fixed it.
2011-06-27 11:32:06 -07:00
Graydon Hoare
bc9fa31618 A little tidying in rt. 2011-06-27 10:08:57 -07:00
Eric Holk
022ebc198b Implementation mising features in lock_and_signal for Win32. Also lowered the minimum stack size to get the pfib benchmark to run without exhausting its address space on Windows. 2011-06-27 09:58:39 -07:00
Eric Holk
681c063ec0 Conservatively serialize nearly all upcalls. Successfuly ran make check with RUST_THREADS=8, so we're probably fairly safe now. In the future we can relax the synchronization to get better performance. 2011-06-27 09:58:39 -07:00
Eric Holk
6367bcf427 Fixed a few concurrency bugs. Still not perfect, but overall it seems much more reliable. 2011-06-27 09:58:39 -07:00
Eric Holk
4d99bf9af2 Added some locking to ports to prevent the case where two threads simultaneously wake up a task blocked on a certain port. 2011-06-27 09:58:39 -07:00
Eric Holk
cb00befff0 Added an environment variable to control how many threads to use. 2011-06-27 09:58:39 -07:00
Eric Holk
4bc773465f Basic multithreading support. The infinite loops test successfully maxes out the CPU. 2011-06-27 09:58:39 -07:00
Eric Holk
91eadfd1ea Added a parallel fibonacci program. It doesn't actually run in parallel yet, but it will give us something fun to test threading with. 2011-06-27 09:58:39 -07:00
Rafael Ávila de Espíndola
bea28ea537 Easy fix for using newer LLVMs: just use the MachOObjectFile.cpp they provide. 2011-06-27 11:52:23 -04:00
Brian Anderson
fcbdac96dd Update README files 2011-06-26 22:27:22 -07:00
Brian Anderson
f2d76bcd7d Remove src/run.py
This script is totally bitrotted
2011-06-26 22:01:32 -07:00
Brian Anderson
16b98f93d5 Update Brian's email address in AUTHORS.txt 2011-06-26 21:58:40 -07:00
Brian Anderson
29a8219c4c Add a very simple map implementation for sequential integer keys
Use it for the ast_map. Cuts 40% off the time spent prior to LLVM.
2011-06-26 20:37:08 -07:00
Brian Anderson
08b49a5d8f Reformulate an assert in ty::tag_variants
This was doing a redundant hashmap lookup. Removing the redundancy trims 5%
(2.8s) off rustc's compile time
2011-06-26 18:02:47 -07:00
Brian Anderson
cfaa0f4b91 Fail typechecking for bad binop/type combinations
Includes assignment operations. Add regression tests for lots of less useful,
less used or unexpected combinations, as well as a selection of compile-fail
tests. Closes #500 (again!)
2011-06-25 19:42:59 -07:00
Brian Anderson
51d07830ba Add a test for mismatched types when comparing functions 2011-06-25 19:28:19 -07:00
Brian Anderson
eb0d56f8c5 Add a FIXME to the docs about literal suffixes 2011-06-25 19:28:19 -07:00
Graydon Hoare
79ba31504b Fixes to speed and clean up makefiles. 2011-06-25 19:23:32 +00:00
Marijn Haverbeke
afa632124f Use single-bar or to make tstate/states.rs prettier
Sorry. This is the kind of thing I do when I'm on a plane and too
tired to manage anything that requires thinking.
2011-06-25 21:16:03 +02:00
Marijn Haverbeke
7432017d5e Primitive support for non-copyable values 2011-06-25 21:15:11 +02:00
Marijn Haverbeke
f6753be655 Allow moving out of temporary values
This will probably need more work, as moving doesn't appear to do
quite the right thing yet in general, and we should also check
somewhere that we're not, for example, moving out the content out of
an immutable field (probably moving out of fields is not okay in
general).
2011-06-25 21:15:11 +02:00
Marijn Haverbeke
61fc12d0d0 Partial implementation of resources
Non-copyability is not enforced yet, and something is still flaky with
dropping of the internal value, so don't actually use them yet. I'm
merging this in so that I don't have to keep merging against new
patches.
2011-06-25 21:15:11 +02:00
Marijn Haverbeke
781a265b88 Remove variable name 'res' from test suite 2011-06-25 21:15:04 +02:00
Tim Chevalier
c772269f08 Fix inexhaustive match in parser 2011-06-24 22:38:01 -07:00
Tim Chevalier
582e1f13f0 Invalidate constraints correctly after an assignment expression
Modified typestate to throw away any constraints mentioning a
variable on the LHS of an assignment, recv, assign_op, or on
either side of a swap.

Some code cleanup as well.
2011-06-24 22:36:53 -07:00
Michael Sullivan
818d7c9398 Use visit_fn_{pre,post} to avoid going past lambdas during writeback instead of explicitly casing. 2011-06-24 15:55:08 -07:00
Michael Sullivan
4499ebe858 Add a test that tests typestate checking inside of fn exprs. 2011-06-24 15:46:20 -07:00
Michael Sullivan
b732ec6f82 Have walk call visit_fn_pre and visit_fn_post on fn expressions.
As a side effect, this fixes a bug where typestate would not properly be checked
inside of fn expressions.
2011-06-24 15:46:20 -07:00
Michael Sullivan
f3717da1b1 Modify the fn vistors in walk so that they can handle functions without names. Update the typestate code to understand this. 2011-06-24 15:46:20 -07:00
Paul Stansifer
142ff011da Make a test compile faster. 2011-06-24 14:47:36 -07:00
Patrick Walton
baf474443a rustc: Increment by the unit size in iter_structural_ty when iterating over interior vectors if the unit size is dynamic 2011-06-24 17:36:30 -04:00
Marijn Haverbeke
2ebd19477b Sanitize use of ids for obj constructors.
Typeck and trans used to, by historical coincidence, use the item_obj
node id, which was used to identify the obj type by the rest of the
system, for the constructor function. This is now identified by the
ctor id stored in the tag throughout.
2011-06-24 21:22:52 +02:00
Marijn Haverbeke
9643aedb04 Remove uses of variable name 'res' from rustc
This in preparation of making 'res' a keyword for defining resources.
Please don't introduce too many new ones in the meantime...
2011-06-24 21:22:23 +02:00
Marijn Haverbeke
d507d5fe91 Remove res idents from stdlib 2011-06-24 21:13:26 +02:00
Marijn Haverbeke
3d7fdb509a Remove def_obj
Since obj constructors and types have different def_ids now,
their def can simply be a def_fn and a def_ty.
2011-06-24 21:13:25 +02:00
Patrick Walton
b4c0893a39 rustc: If needed, duplicate types' heap parts recursively through structural types 2011-06-24 14:32:50 -04:00
Brian Anderson
1e7f06b17a test: Improve ternary operator tests 2011-06-23 23:27:32 -07:00
Brian Anderson
3aa8d7ff45 rustc: Pretty-print ternary operator 2011-06-23 23:14:40 -07:00
Brian Anderson
b9fc4dfc54 rustc: Cleanup trans_if, trans_alt 2011-06-23 22:16:16 -07:00
Brian Anderson
05c0216654 rustc: Add ternary operator. Closes #565
The implementation is so simple it might be considered cheating: at almost
every step the expr_ternary is just converted to expr_if.
2011-06-23 22:16:11 -07:00
Michael Sullivan
5495ad17d1 Fix type inference inside of anonymous functions. 2011-06-23 21:36:10 -07:00
Eric Holk
860e8fd98b Combined set_registers and get_registers into swap_registers. 2011-06-23 20:23:04 -07:00
Eric Holk
98dee91f25 Wrote swap_context in assembly. Closes #548. This also allows us to re-enable optimization on OSX for both gcc and clang. Also, re-enamed task-comm-1.rs, which was previously broken by optimization. 2011-06-23 18:49:29 -07:00
Rafael Ávila de Espíndola
3c534b2bef Remove parse_str_lit_or_env_ident.
We decided to use metadata for the more complex cases, and a simple
string is enough for rustc right now.
2011-06-23 18:42:55 -04:00
Graydon Hoare
14c31c26c2 Flesh out type pp code. 2011-06-23 18:40:44 -04:00
Patrick Walton
f3798fd213 rustc: Load immediate types when iterating over interior vectors 2011-06-23 17:43:03 -04:00
Tim Chevalier
3cf00c1577 Correct error message for argument mode mismatch
If you use a function expecting an alias argument in a context that
expects a function expecting a value argument, or vice versa, the
previous error message complained that the number of arguments was
wrong. Fixed the error message to be accurate.
2011-06-23 11:54:10 -07:00
Lindsey Kuper
5bd65de289 Typo fix in test case. 2011-06-23 10:47:29 -07:00