Commit graph

5266 commits

Author SHA1 Message Date
Patrick Walton
db72bd90f5 mk: Introduce CFG_DISABLE_OPTIMIZE_CXX 2011-08-24 11:59:21 -07:00
Marijn Haverbeke
fa97793139 Revert "Back out copy-glue"
This reverts commit 629ee94a0b.
2011-08-24 20:30:20 +02:00
Brian Anderson
60547f6500 Use memmove to load istr literals. Issue #855 2011-08-24 10:24:59 -07:00
Marijn Haverbeke
629ee94a0b Back out copy-glue
This wasn't a good idea after all.
2011-08-24 17:05:53 +02:00
Marijn Haverbeke
15b540ded4 Use a single builder object throughout
This seems to be faster than creating separate ones for each block
context.
2011-08-24 16:57:33 +02:00
Marijn Haverbeke
b9112525ba Move to a more lightweight builder system
You now do

    bld::Ret(bcx, someval)

where you used to say

    bcx.build.Ret(someval)

Two fewer boxes are allocated for each block context, and build calls
no longer go through a vtable.
2011-08-24 16:48:10 +02:00
Marijn Haverbeke
9f44df65ef Ensure values created in an alt guard are cleaned up properly 2011-08-24 14:01:56 +02:00
Marijn Haverbeke
054914712e Remove rust_start_ivec 2011-08-24 13:59:22 +02: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
bead045f27 Check for is_terminated after translating a block
Closes #861
2011-08-24 10:55:34 +02:00
Brian Anderson
18576e55f7 Resolve a number of FIXMEs 2011-08-23 18:55:37 -07:00
Brian Anderson
c1f2394245 Zero locals with initializers that may break or terminate. Closes #787 2011-08-23 16:29:21 -07:00
Graydon Hoare
c011f13144 Add kind-checking for assign-op, copy, ret, be, fail exprs. Fix caught kinding-violations in rustc and libstd. 2011-08-23 15:58:53 -07:00
Brian Anderson
a3c8d4a5a5 Recheck the while loop contition after continuing. Closes #825 2011-08-23 14:51:22 -07:00
Brian Anderson
68fd28c2c1 Cleanup formatting in std::sha1
This file has suffered a lot of reformats and was looking pretty ragged
2011-08-23 13:22:44 -07:00
Brian Anderson
7b12924813 Fix pretty-printing of istr literals. Issue #855 2011-08-23 11:09:38 -07:00
Brian Anderson
c274d16b7f Eliminate unused variable warnings in stdtest 2011-08-22 21:33:52 -07:00
Brian Anderson
45b614f54a Add ivec::from_str and to_str methods. Issue #855 2011-08-22 21:33:52 -07:00
Brian Anderson
663d07d319 Add std::istr. Issue #855 2011-08-22 21:33:49 -07:00
Brian Anderson
55c54f0db5 Promote std::task::rustrt::leak to std::unsafe::leak
I want to use this for std::istr
2011-08-22 18:05:34 -07:00
Brian Anderson
d6e4fa6b44 Teach rustc to append istrs. Issue #855 2011-08-22 17:40:06 -07:00
Brian Anderson
3ab86fb79e Teach rustc to add istrs. Issue #855 2011-08-22 16:39:18 -07:00
Brian Anderson
aae212727d Encode the istr shape correctly. Issue #855 2011-08-22 16:12:42 -07:00
Brian Anderson
6841f3827a Fix ivec self-append. Closes #816 2011-08-22 15:04:28 -07:00
Brian Anderson
0f1f5e67ea Create correct drop glue for istrs. Issue #855 2011-08-22 14:34:55 -07:00
Brian Anderson
fd8ca2cf5d Translate istr literals. Issue #855 2011-08-22 14:34:36 -07:00
Brian Anderson
0a93a48ff5 Extract trans_ivec::alloc_with_heap from trans_ivec::trans_ivec
Need this for building istrs
2011-08-22 13:30:53 -07:00
Brian Anderson
309a7534d7 Move trans::ivec to middle::trans_ivec 2011-08-22 12:04:05 -07:00
Brian Anderson
179658e20f Move trans_ivec into the ivec module 2011-08-22 11:23:46 -07:00
Brian Anderson
3a5bfae9d9 Silence unused variable warnings in compiletest 2011-08-22 11:00:43 -07:00
Brian Anderson
152cbaade7 Move functions from syntax::ast to syntax::ast_util
This leaves syntax::ast just defining the AST, which strikes me as somewhat
nicer
2011-08-22 10:44:04 -07:00
Brian Anderson
a3affaa20f Remove ast::spawn_dom 2011-08-22 10:42:29 -07:00
Marijn Haverbeke
7d08678b74 Implement pattern guards
The syntax is

    alt x {
        mypat where mycond { ... }
    }

The condition may refer to any of the variables bound by the pattern.
When a guard fails, pattern-matching continues with the next pattern.

Closes #857
2011-08-22 17:49:31 +02:00
Marijn Haverbeke
a2466233b4 Fix bug introduced by 1a45a84e73 2011-08-22 17:49:31 +02:00
Marijn Haverbeke
1a45a84e73 Start using copy glue to copy bits that may contain ivecs
This is not currently necessary, but will be, when I land the new ivec
representation.
2011-08-22 14:17:27 +02:00
Marijn Haverbeke
3948f132d9 Write a type_structurally_contains, use it to rewrite has_dynamic_size
(I'll be using this for type-needs-copy-glue in the near future.)
2011-08-22 14:06:20 +02:00
Marijn Haverbeke
42864377a4 Remove silly restriction on passing type params by alias
Since they are now passed by pointer, this is no longer a problem
2011-08-22 14:06:20 +02:00
Marijn Haverbeke
10269dfaeb Replace &ty::t with ty::t throughout the compiler
Type handles are uints, passing them by reference only causes
unnecessary spilling.
2011-08-22 14:06:17 +02:00
Marijn Haverbeke
081caf5bb8 Do not check for self-assign unless dest is initialized
Also, give copy_val and move_val a more sane return type.
2011-08-22 14:05:56 +02:00
Marijn Haverbeke
c930af74d5 Write call_copy_glue 2011-08-22 14:05:54 +02:00
Marijn Haverbeke
cd5e4c21ee Add skeleton of copy glue that actually copies 2011-08-22 11:41:49 +02:00
Marijn Haverbeke
7588a89553 Rename copy_glue back to take_glue 2011-08-22 10:42:56 +02:00
Marijn Haverbeke
b24f978011 Drop arguments on the caller side, not the callee
This makes it easier for the caller to optimize the take/drop away for
temporary values, and opens up new possibilities for alias handling.

Breaks tail calls.
2011-08-22 10:16:09 +02:00
Marijn Haverbeke
35c962e9a1 Pass structural types by pointer, not by value
If we lose tail calls, this is possible. It simplifies things a lot.

Direct motivation: We want ivecs with pointers pointing into
themselves. When copying those, the pointers have to be adjusted. It
is impossible to this when copying them with Load/Store.
2011-08-22 10:16:09 +02:00
Brian Anderson
6ad5b71ad9 Conditionally define CDECL and FASTCALL on windows
These may already be defined by other includes. Hopefully puts out the windows
fire.
2011-08-20 16:31:38 -07:00
Brian Anderson
7dad31d11c Fix comment typos 2011-08-20 16:30:27 -07:00
Brian Anderson
abdb6cd71b Rewrite reap_dead_tasks to never grab the sched lock before a task lock
Doing so contradicts the locking order used everywhere else and causes
deadlocks.

Un-XFAIL task-perf-spawnalot

Closes #854
2011-08-20 16:21:27 -07:00
Patrick Walton
25416bfae1 rustc: Introduce ABI versioning so we can change value representations without breaking the compiler 2011-08-20 14:22:09 -07:00
Patrick Walton
2f650038ad rt: Move the GetProcAddress/dlsym stuff out of rust_gc.cpp into rust_abi.h 2011-08-20 14:06:04 -07:00
Brian Anderson
15e456d547 Convert task-perf-spawnalot to spawn_joinable. XFAIL 2011-08-20 13:02:53 -07:00