Commit Graph

663 Commits

Author SHA1 Message Date
Graydon Hoare
91d640f90f Merge obj-drop and closure-drop code, handles freeing bound exteriors now. 2010-08-25 16:21:50 -07:00
Graydon Hoare
8e0f486ea6 First pass of updating the in-memory layout of closures, for issue 81. 2010-08-25 14:42:28 -07:00
Graydon Hoare
c2b6c27d65 Fix edge case in uint->string conversion. 2010-08-25 13:54:27 -07:00
Graydon Hoare
b2b72a08db Janitorial work on obj box / body / field terminology, following froystig's brave lead. 2010-08-25 12:08:05 -07:00
Graydon Hoare
af6e1d2c2b Fix ghastly typestate bug breaking nested functions. 2010-08-25 12:08:05 -07:00
Patrick Walton
a48c382549 Introduce "type patterns" to the typechecker in preparation for function type-param inference 2010-08-25 11:16:29 -07:00
Roy Frostig
2b9a48b9c9 Obj ctors are not obj fns so translate their frame entry as such. 2010-08-25 10:27:17 -07:00
Michael Bebenita
3ab8cc6018 Fixed the location of the failing XFailed test. 2010-08-24 21:27:47 -07:00
Michael Bebenita
64ff82ecf9 Implemented an lock free queue based on this paper http://www.cs.rochester.edu/~scott/papers/1996_PODC_queues.pdf, the "lock free queue" we had before wasn't lock free at all. 2010-08-24 21:07:14 -07:00
Roy Frostig
d9fe885ba5 Comment on env var required for std.dbg to do any logging. 2010-08-24 19:55:45 -07:00
Roy Frostig
7ccdb88374 Add support in dbg.debug_obj for printing the obj body. 2010-08-24 19:49:39 -07:00
Roy Frostig
d9e3fb2c5d Add std.dbg module for inspecting rust values in memory. 2010-08-24 18:37:42 -07:00
Graydon Hoare
2dc3a37f93 First successful hashmap lookups. Yay. 2010-08-24 17:38:04 -07:00
Graydon Hoare
e846643d23 Fix mod-bug in std.map, work around bug in closure typaram capture, enable insert-tests in lib-map.rs. 2010-08-24 17:23:09 -07:00
Graydon Hoare
9ea37bd47b Fix residual nonsense of storing crate-rel displacements in a closure pair (made it impossible to pass between crates, of course). 2010-08-24 17:09:03 -07:00
Patrick Walton
1b117f936d Remove obsolete TODO about checking for return statements 2010-08-24 16:11:43 -07:00
Graydon Hoare
de6535c1c2 Elide preempt check on thunk and ctor frames. Wins 8kb on rustc. 2010-08-24 11:57:51 -07:00
Graydon Hoare
8d787d1e08 Avoid emitting unnecessary frame glue. Wins a couple hundred kb of rustc. 2010-08-24 11:45:48 -07:00
Graydon Hoare
87c9a9e25d Avoid iterating ty parts on drop when there are no heap pointers in ty. Wins several tens of kb on rustc. 2010-08-24 11:44:14 -07:00
Graydon Hoare
b5255b4534 Shrink size of glue calls. Wins a few tens of kb on rustc. 2010-08-24 11:42:24 -07:00
Graydon Hoare
07d355d1af Add lexer.reader to rustc for tracking position, char conversion, holding keyword tables. 2010-08-24 09:59:41 -07:00
Graydon Hoare
47501f1659 Make _str.eq suitable for map.hashmap; add _str.hash that does simple djb-hash. 2010-08-24 09:59:02 -07:00
Graydon Hoare
10316fbfa5 Make error reporting slightly more regular. 2010-08-24 09:58:26 -07:00
Graydon Hoare
14262c7311 Rename lib tests, enable lib-int.rs using _str.eq for now. 2010-08-24 09:09:04 -07:00
Graydon Hoare
ca3ca041f3 Add very basic char / str literal handling to rustc lexer. 2010-08-24 08:56:42 -07:00
Graydon Hoare
df3ea680ea Tidy lexer. 2010-08-24 08:50:56 -07:00
Graydon Hoare
2745a5ebb2 Handle line-comments and a few more symbols in rustc lexer. 2010-08-23 19:17:04 -07:00
Graydon Hoare
6e3a77c3a3 Merge remote branch 'tohava/master'
Conflicts:
	src/boot/fe/ast.ml
2010-08-23 18:19:42 -07:00
Patrick Walton
ed92925083 Warn when the value of "spawn" is unused, as it's useless 2010-08-20 17:15:27 -07:00
Or Brostovski
0830b5bf24 Modified parser to handle alt type andadded a few tests
ast.ml - modified arm types for easier polymorphism
       - fixed a bug in fmt_type_arm
dead.ml - modified arm types for easier polymorphism
common.ml - added 'either'
          - added some useful auxiliary functions
item.ml - modified arm code to be more polymorphic and handle both alt-tag and alt-type, also fixed the problematic case in bad-alt.rs
Makefile - added XFAIL for new alt-type test
bad-alt.rs - added test for invalid alt syntax
alt-type-simple.rs - added simple test for alt type
2010-08-21 02:41:43 +03:00
Graydon Hoare
c0e173e19a Stringify op tokens. 2010-08-20 15:57:59 -07:00
Graydon Hoare
a2bd79a6ac Redo _uint.to_str to work with chars and only one tmp str, built left-to-right. 2010-08-20 15:37:20 -07:00
Graydon Hoare
db377bae3a Accumulate number tokens properly, handle newline, EQ and EQEQ in rustc lexer. 2010-08-20 15:36:48 -07:00
Patrick Walton
08f191d6d9 Lex commas too in the self-hosted compiler 2010-08-20 14:58:15 -07:00
Patrick Walton
fc05ea0371 Use pattern matching for the one-byte structural symbols in the self-hosted compiler 2010-08-20 14:35:59 -07:00
Roy Frostig
8097a10c36 XFAIL _io test because darwin and winnt are burning. 2010-08-20 13:29:19 -07:00
Roy Frostig
2da4fecacd Test the buffered reader and writer in _io. 2010-08-20 12:57:38 -07:00
Roy Frostig
af64e4f305 Allow every test to make a .tmp file that is cleaned up before execution. 2010-08-20 12:48:45 -07:00
Graydon Hoare
eecd1f47d7 Fix some lexer bugs in rustc. Beginning to lex stuff now. 2010-08-20 12:12:37 -07:00
Graydon Hoare
1db0cb208d Add ungetc and re-indent _io.rs. 2010-08-20 12:12:11 -07:00
Graydon Hoare
34e5e98cf7 Re-XFAIL destructor-ordering.rs. Valgrind doesn't like it (though oddly, doesn't make the tbox burn). 2010-08-20 11:48:31 -07:00
Graydon Hoare
0f224f977d Expand rustc lexer to do almost-nearly-nontrivial stuff. 2010-08-20 11:42:44 -07:00
Graydon Hoare
9fc4fc6692 Add _uint module to std, move some code around. 2010-08-20 11:42:44 -07:00
Graydon Hoare
5f9750ca2c Modify session to report errors in an emacs-parser-friendlier way. 2010-08-20 11:42:44 -07:00
Patrick Walton
4c28d9a54a Un-XFAIL some tests that (seem to) rely on large task stacks 2010-08-20 11:11:39 -07:00
Patrick Walton
fac28ad42f Disable task-growing logic for now until #151 is fixed 2010-08-20 11:05:06 -07:00
Graydon Hoare
9363c1ab7f Use str += u8 in rustc lexer. 2010-08-20 10:03:31 -07:00
Graydon Hoare
ddd8feea31 Support single-element append on vec, str. Closes #44. 2010-08-20 09:58:22 -07:00
Graydon Hoare
40fccac7fb Add some code to lexer in rustc. 2010-08-19 18:42:32 -07:00
Graydon Hoare
b34cb1b631 Fix a bunch of typestate bugs in handling if and while statement wirings. 2010-08-19 18:42:32 -07:00
Roy Frostig
4a7aa75b5d Make _io.buf_reader read more than 0 bytes at a time. 2010-08-19 17:37:22 -07:00
Patrick Walton
b6b348a13c Export all item code to stabs on Windows (including e.g. object methods) 2010-08-19 16:50:18 -07:00
Patrick Walton
31aceda09e Export glue as stabs on Windows as well 2010-08-19 16:15:37 -07:00
Patrick Walton
09ebda7ce5 Add some mangled stabs to help debugging on Windows 2010-08-19 15:38:57 -07:00
Patrick Walton
cd6be20caa Use "/usr/bin/env python" per the prevailing style 2010-08-19 10:25:58 -07:00
Patrick Walton
64be30936b Don't complain about \r when core.autocrlf is on in Git... and work in Python 2.4, 2.6, and 3.x. 2010-08-18 16:14:44 -07:00
Patrick Walton
1d10582d62 Revert "Don't complain about \r when core.autocrlf is on in Git"
This reverts commit 828afaa2fa.
2010-08-18 16:04:50 -07:00
Graydon Hoare
4727532e95 Simplify lexer/parser structure to use stdio_reader. 2010-08-18 15:41:24 -07:00
Graydon Hoare
f0d4e6c511 Add stdio_reader to io, just use FILE* values for now. We have things to do. 2010-08-18 15:41:24 -07:00
Patrick Walton
b4f92774d0 Don't complain about \r when core.autocrlf is on in Git (now working with Python 2.6). 2010-08-18 15:30:31 -07:00
Patrick Walton
724d7235e5 Revert "Don't complain about \r when core.autocrlf is on in Git"
This reverts commit 828afaa2fa.
2010-08-18 15:24:44 -07:00
Patrick Walton
828afaa2fa Don't complain about \r when core.autocrlf is on in Git 2010-08-18 15:19:36 -07:00
Patrick Walton
61156ea714 Fail during build if we can't determine the current Git revision 2010-08-18 12:57:23 -07:00
Graydon Hoare
51412cb5fa Add do-nothing obj type for lexer to rustc. 2010-08-18 11:35:34 -07:00
Graydon Hoare
a1b57e69cd Add mod token to rustc. 2010-08-18 11:35:12 -07:00
Graydon Hoare
49f668dff3 Add mod common to rustc. 2010-08-18 11:34:47 -07:00
Graydon Hoare
b5ad78f316 Change indent on rustc.rc. 2010-08-18 11:34:22 -07:00
Graydon Hoare
102ec16877 Flesh out the ast module in rustc a little. 2010-08-18 09:00:10 -07:00
Graydon Hoare
9db70bfc42 Add test code that exercises LLVM in rustc. Works. 2010-08-18 00:19:45 -07:00
Graydon Hoare
3f2c39b3d8 Fix symbol names on LLVM C library binding and library-name for LLVM. 2010-08-18 00:19:25 -07:00
Graydon Hoare
9277f551d3 Add support for casting native types. 2010-08-18 00:18:46 -07:00
Michael Bebenita
a4b8c74f9f Added simple deadlock detection in the scheduler. 2010-08-17 23:49:57 -07:00
Michael Bebenita
2c1ec6771b Lots of changes around memory managment in the Runtime. Added memory regions and fixed race caused by calling rust_srv::malloc() from multiple threads when sending messages. 2010-08-17 23:49:57 -07:00
Michael Bebenita
9fa2b53d8c Add a "special" rust_log flag to be used for debugging in cases where the full log output prevents races from occurring. 2010-08-17 23:49:57 -07:00
Michael Bebenita
e20752de68 Added labels to blocking conditions. 2010-08-17 23:49:57 -07:00
Michael Bebenita
7ff39ea448 Fixed deadlock by removing channel flushing. 2010-08-17 23:49:57 -07:00
Michael Bebenita
6e9f0f952d Made the lock_free_queue lock (temporarily, until fixed). 2010-08-17 23:49:57 -07:00
Michael Bebenita
028702a798 Updates to run.py. You can now pass in the rust_log and a flag to terminate on the first failure. 2010-08-17 23:49:57 -07:00
Graydon Hoare
766b91d88b Add support for a reserved-words list and reserve the various not-supported-but-plausible IEEE datatypes. 2010-08-17 14:48:00 -07:00
Michael Bebenita
560d7b4983 Re-xfailed tests because Windows is still complaining. 2010-08-16 23:28:01 -07:00
Michael Bebenita
5d98a311e4 Putting out the burning tree on Windows. Turns out you can completely starve threads by not yielding on windows/vmware, really weird. 2010-08-16 18:44:26 -07:00
Michael Bebenita
14f5b5750d Un-xfailed working tests. 2010-08-16 15:05:57 -07:00
Michael Bebenita
b40a9fa787 Pulled rust_srv in its own file. Some cleanup, and added varargs to assertion macros. 2010-08-16 15:05:57 -07:00
Graydon Hoare
7e62aa6801 Absent any deep overhauls to syntax or constant-handling, hack in the ability to project a cexp var binding to a token in the parser. Use it in comp/rustc.rc and comp/lib/llvm.rs. 2010-08-16 13:02:46 -07:00
Patrick Walton
176899a970 Evil solution to the problem of importing the same opaque from two different files. Closes #145. 2010-08-13 16:33:04 -07:00
Roy Frostig
abe307cf45 Uncomment recently-no-longer-failing std.deque tests. Add a few arbitrary-access checks. 2010-08-13 11:55:25 -07:00
Roy Frostig
73ee16b1a4 A little tidy-up that should have gone in with 4e376852e7. 2010-08-12 19:20:29 -07:00
Graydon Hoare
8149bb1411 Zero LMA/VMA of debug sections in elf. Closes #148. 2010-08-12 18:45:41 -07:00
Roy Frostig
4e376852e7 Fix max_sz bug that ended up causing us to index incorrectly into a vec of tag types. Add a testcase. 2010-08-12 16:21:08 -07:00
Roy Frostig
6bce296d9f Address FIXME in _vec waiting on closed issue #108. 2010-08-12 13:18:10 -07:00
Roy Frostig
445d3fe39c Add vec debugging utility to _vec module. 2010-08-12 13:11:49 -07:00
Graydon Hoare
5267b77d3b Add more LLVM library bindings to rustc. 2010-08-12 12:10:36 -07:00
Graydon Hoare
bc0d1fbae5 Add modelines and related emacs chatter to rustc. 2010-08-12 10:29:23 -07:00
Graydon Hoare
c599b32646 Kill old parser support for type-parametric modules. We don't support those. 2010-08-12 10:28:23 -07:00
Graydon Hoare
5297582ba2 Add mostly-empty AST module to rustc. 2010-08-12 10:27:50 -07:00
Michael Bebenita
988695a96c Added support for task sleeping in the scheduler. 2010-08-11 21:24:04 -07:00
Graydon Hoare
88d9a79ac8 Some ELF correctness issues, but apparently none enough to placate gdb. 2010-08-11 16:57:34 -07:00
Roy Frostig
22719e45b8 Remove commented-out code that slipped in during last commit. 2010-08-11 16:10:44 -07:00
Michael Bebenita
74e12fcef6 Ignore upcall_flush for channels that are disassociated from ports. This makes task-comm-10 break a little less hard, but it still leaks because messages pending in the channel are never freed. 2010-08-11 16:08:45 -07:00
Michael Bebenita
c56ecc1d56 Added a -v(algrind) option to run.py. 2010-08-11 16:08:45 -07:00
Michael Bebenita
18beb7a33d Increment ref counts of objects sent along channels. 2010-08-11 16:08:45 -07:00
Michael Bebenita
8ac15c6844 Added test cases. 2010-08-11 16:08:45 -07:00
Michael Bebenita
d584de7a37 Made ref_count a word sized value. 2010-08-11 16:08:45 -07:00
Michael Bebenita
ff93e5e196 Print domain and task names in log prefix. 2010-08-11 16:08:45 -07:00
Roy Frostig
f307688bf4 Add native vec[u8] to str converter. Put in workaround for leak in str to vec[u8] converter. Add testcase exercising both. Drive-by fix a potential array-out-of-bounds write on rust_str buffers. 2010-08-11 16:06:45 -07:00
Roy Frostig
8e02a2bcb5 Fix reverse-indexing bug in _vec.init_fn. 2010-08-11 15:56:19 -07:00
Graydon Hoare
9faaf9eaf4 Tidy up run script. 2010-08-11 14:28:01 -07:00
Graydon Hoare
bf341f829b Change dwarf output on linux to switch from relative to absolute addresses based on library-mode-ness, might help fight ASLR-induced confusion. 2010-08-11 14:27:47 -07:00
Graydon Hoare
60e5ad384e Put out burning tinderbox on OSX. 2010-08-10 16:49:36 -07:00
Graydon Hoare
5d2e94838e un-XFAIL lib-deque.rs, as it seems to have been waiting on something recently fixed. 2010-08-10 16:35:40 -07:00
Graydon Hoare
9f6dec9e13 Always bounce mul/div/mod ops. Closes #131 harder. 2010-08-10 16:03:58 -07:00
Graydon Hoare
5b5bcf9cfb Merge commit 'tohava/master'
Conflicts:
	src/boot/fe/ast.ml
2010-08-10 14:46:24 -07:00
Graydon Hoare
dbe8760af3 Merge commit 'jyasskin/work'
Conflicts:
	src/rt/rust_dom.cpp
	src/rt/rust_upcall.cpp
2010-08-10 13:26:00 -07:00
Roy Frostig
75e46cc4d0 Fix a deque size bookkeeping bug. 2010-08-10 11:40:33 -07:00
Roy Frostig
fd0750b218 Get object's captured typarams when querying for an object method's typarams in Trans. Together with commit 982dcc29bf this... Closes #138. 2010-08-09 19:19:32 -07:00
Roy Frostig
982dcc29bf Get object's captured typarams when calculating sizes in the backend's fn-prologue-generation for object methods. 2010-08-09 15:45:08 -07:00
Michael Bebenita
76e03be459 XFailed some tests. 2010-08-09 08:49:54 -07:00
Michael Bebenita
97d6342bf0 Synthesize a flush_chan upcall right before a channel's ref_count drops to zero. This should only happen in the Rust code and not in the drop glue, or on the unwind path. This change allows the task owning the channel to block on a flush and delete its own channel. This change also cleans up some code around rust_port and rust_chan. 2010-08-09 08:15:34 -07:00
Michael Bebenita
5917ca3519 Fixed deadlock in the scheduler caused by condition variables. 2010-08-09 08:06:08 -07:00
Michael Bebenita
4641fcef61 Added peek() to ptr_vec. 2010-08-09 08:01:40 -07:00
Michael Bebenita
f65c885c83 Made ref_count signed to help detect negative ref_count bugs. 2010-08-09 08:00:04 -07:00
Michael Bebenita
30734a9a7b Some pretty printing in the runtime. 2010-08-09 07:52:07 -07:00
Michael Bebenita
9ff6a3d031 Added class to abstract away platform specific thread primitives. 2010-08-09 07:42:06 -07:00
Michael Bebenita
56cd4e458a Made the runtime keep track of all live domains and print their state. 2010-08-09 07:34:11 -07:00
Michael Bebenita
c5744c8aef Added the RUST_SEED env variable to seed the Rust task scheduler -- helpful when debugging task race conditions within a single thread domain. 2010-08-09 07:30:48 -07:00
Michael Bebenita
768adb3ddd Added a python script to run test cases repeatedly. This helps with debugging race conditions. 2010-08-09 07:27:39 -07:00
Michael Bebenita
0e422c748b Added "none" option to rust_log env string to disable all log output. 2010-08-09 07:07:00 -07:00
Michael Bebenita
d2c2fbe7ca Added timed_wait to condition variables. 2010-08-09 07:04:38 -07:00
Michael Bebenita
8395d46163 Changed seemingly incorrect stk_field_valgrind_id. 2010-08-09 07:01:20 -07:00
Michael Bebenita
76ba8f1d84 Changed array_list::replace() return behavior. 2010-08-09 06:59:46 -07:00
Michael Bebenita
d647c163fd Updated/added test cases. 2010-08-09 06:53:37 -07:00
Jeffrey Yasskin
b71340552f Add names to tasks and domains. These can either be an explicit literal string
after the "spawn" keyword, or implicitly the call expression used to start the
spawn.
2010-08-09 11:43:16 +02:00
Jeffrey Yasskin
df75a968c5 Fix LLVM translation of modules. 2010-08-08 14:29:53 -07:00
Or Brostovski
4467d7683d Merge branch 'master' of git://github.com/graydon/rust
Conflicts:
	src/boot/fe/ast.ml
2010-08-07 16:43:08 +03:00
Or Brostovski
b1c86beea8 Added AST pretty printing for communication alt statement, closes issue 19. 2010-08-07 13:44:44 +03:00
Or Brostovski
459e860457 Added forgotten handling for alt_type_else, and also for stmt_note 2010-08-06 17:34:31 -07:00
Or Brostovski
122ea68b12 Added AST pretty printing for slice expression 2010-08-06 17:34:31 -07:00
Or Brostovski
a0cc4817e9 Added AST logging, and modified AST for consistent handling of alt stmts.
- Modified the arm types, instead of a single arm type, there are now 2 (soon to be 3) arm types, one for each type of alt statement
- Added AST logging for constrained type (see fmt_constrained)
- Added AST logging for STMT_alt_type
- Created a generic fmt_arm for use with all alt statements
2010-08-06 17:34:31 -07:00
Jeffrey Yasskin
3f6e8ffe64 Implement _str.len() to return the number of bytes, rename it to byte_len(),
and add a test.
2010-08-06 17:29:21 -07:00
Jeffrey Yasskin
581a95a804 Add an int->str conversion function.
The test currently fails because string equality isn't implemented.
2010-08-06 17:25:27 -07:00
Jeffrey Yasskin
987589e946 Change the destructor-ordering test to use channels instead of a shared mutable object.
This test used to take advantage of a hole in the type system that allows
objects with destructors to refer to stateful objects.
2010-08-06 17:17:04 -07:00
Jeffrey Yasskin
fdb842f9e6 Fix LLVM translation of modules. 2010-08-06 17:14:59 -07:00
Roy Frostig
80a1cd3d1e Redo yesterday's buf_writer-wrapper in a less silly and convoluted way. Add integer stringifying functions to _int module. 2010-08-06 15:48:23 -07:00
Roy Frostig
514fb4b321 Accept uint literals as literal patterns. 2010-08-06 15:44:09 -07:00
Tohava
7d38caf9c3 Added forgotten handling for alt_type_else, and also for stmt_note 2010-08-06 17:15:55 +03:00
Tohava
4bc173fd3c Added AST pretty printing for slice expression 2010-08-06 16:11:15 +03:00
Graydon Hoare
db561b52ff Degrade emitter size cache to just a flat hashtable with regular flushes (sigh) and re-introduce horrible bounce-off-spill hack for DIV, MUL, etc. 2010-08-05 17:44:35 -07:00
Graydon Hoare
9da8101cc8 Something is wrong with the emitter size cache; disable for now, possibly put out flaming tinderboxes. 2010-08-05 13:28:43 -07:00
Patrick Walton
53b01dc006 Add a valgrind suppression for Snow Leopard dyld 2010-08-05 12:00:34 -07:00
Graydon Hoare
935b4347e2 Mop up workarounds in stdlib no longer required as issue #93 is closed. 2010-08-05 10:10:39 -07:00