Commit Graph

20661 Commits

Author SHA1 Message Date
toddaaro
a5f55b3ead minor tweaks - unboxed the coroutine so that it is no longer a ~ pointer inside the task struct, and also added an assert to verify that send is never called inside scheduler context as it is undefined (BROKEN) if that happens 2013-08-01 15:17:19 -07:00
toddaaro
997719c13d Fixed a race where a scheduler configured to only run tasks pinned to it would "bounch" a regular task in and out of the work queue without allowing a different scheduler to run it. 2013-08-01 15:16:01 -07:00
Ben Blum
37f385e44b Have linked failure tests run on the new scheduler instead of requiring RUST_NEWRT to test. 2013-08-01 15:16:01 -07:00
toddaaro
f7eed22387 A major refactoring that changes the way the runtime uses TLS. In the
old design the TLS held the scheduler struct, and the scheduler struct
held the active task. This posed all sorts of weird problems due to
how we wanted to use the contents of TLS. The cleaner approach is to
leave the active task in TLS and have the task hold the scheduler. To
make this work out the scheduler has to run inside a regular task, and
then once that is the case the context switching code is massively
simplified, as instead of three possible paths there is only one. The
logical flow is also easier to follow, as the scheduler struct acts
somewhat like a "token" indicating what is active.

These changes also necessitated changing a large number of runtime
tests, and rewriting most of the runtime testing helpers.

Polish level is "low", as I will very soon start on more scheduler
changes that will require wiping the polish off. That being said there
should be sufficient comments around anything complex to make this
entirely respectable as a standalone commit.
2013-08-01 15:14:00 -07:00
bors
82b24559e6 auto merge of #8190 : thestinger/rust/for, r=thestinger 2013-08-01 12:52:29 -07:00
Daniel Micay
94f1a5d6f8 migrate to foreach 2013-08-01 15:28:45 -04:00
Huon Wilson
7c21ccc483 rustc: add a lint for for, suggesting foreach or do.
This is just to aid the transistion to the new `for` loop, by
pointing at each location where the old one occurs.
2013-08-01 15:07:19 -04:00
bors
479809a267 auto merge of #8166 : emillon/rust/clean-tests-mk, r=brson
Hello,

While looking at `tests.mk` I noticed two errors:

  - there's a `srcrustllvm` instead of `src/rustllvm`
  - some filtered out files don't exist anymore

These two commits fix these issues. Thanks!
2013-08-01 11:10:35 -07:00
bors
7daea7c9c1 auto merge of #8165 : graydon/rust/2013-07-31-new-codegen-tests, r=brson
r? @pcwalton or someone
2013-08-01 09:28:36 -07:00
blake2-ppc
78cde5b9fb std: Change Times trait to use do instead of for
Change the former repetition::

    for 5.times { }

to::

    do 5.times { }

.times() cannot be broken with `break` or `return` anymore; for those
cases, use a numerical range loop instead.
2013-08-01 16:54:22 +02:00
blake2-ppc
7e210a8129 std: Replace for with do { .. } expr in std::gc
Change all users of old-style for with internal iterators to using
`do`-loops.

The code in stackwalk.rs does not actually implement the
looping protocol (no break on return false).

The code in gc.rs does not use loop breaks, nor does any code using it.

We remove the capacity to break from the loops in std::gc and implement
the walks using `do { .. }` expressions.

No behavior change.
2013-08-01 16:54:22 +02:00
blake2-ppc
e5a64f2add std: Remove the internal iterator methods from trait Set
.intersection(), .union() etc methods in trait std::container::Set use
internal iters. Remove these methods from the trait.

I reported issue #8154 for the reinstatement of iterator-based set algebra
methods to the Set trait.

For bitv and treemap, that lack Iterator implementations of set
operations, preserve them as methods directly on the types themselves.

For HashSet, these methods are replaced by the present .union_iter()
etc.
2013-08-01 16:54:22 +02:00
blake2-ppc
310e0b6e92 extra: Use external iterators in bitv implementation
Convert some internally used functions to use a external iterators.

Change all uses of remaining internal iterators to use `do` expr
2013-08-01 16:54:22 +02:00
blake2-ppc
dbcb74e247 extra: Replace for with do { .. } expr where internal iterators are used 2013-08-01 16:54:22 +02:00
blake2-ppc
b18bd785ec std: Replace for with do { .. } expr where internal iterators are used 2013-08-01 16:54:22 +02:00
blake2-ppc
02bdf90cf6 extra: Use do instead of for in extra::iter 2013-08-01 16:54:22 +02:00
blake2-ppc
6d7a0c8cbc std: Use do blocks instead of for with .iter_bytes() 2013-08-01 16:54:22 +02:00
bors
fe28ac6891 auto merge of #8164 : brson/rust/noportset, r=pcwalton
...haredChan.
2013-08-01 07:46:38 -07:00
bors
18d124b9b5 auto merge of #8158 : bblum/rust/task-cleanup, r=brson
r? @brson
2013-08-01 06:01:39 -07:00
bors
9824d90ffd auto merge of #8155 : stepancheg/rust/unit-zero, r=alexcrichton 2013-08-01 04:19:35 -07:00
bors
5c6069c7a9 auto merge of #8184 : thestinger/rust/retreat, r=huonw 2013-08-01 02:37:36 -07:00
Daniel Micay
1fc4db2d08 migrate many for loops to foreach 2013-08-01 05:34:55 -04:00
Daniel Micay
5f59c46e0f rc: from_{owned,const} -> from_{send,freeze} 2013-08-01 04:39:00 -04:00
bors
1b018dd9ba auto merge of #8149 : omasanori/rust/cleanup, r=alexcrichton
Fixed a warning.
2013-08-01 00:40:33 -07:00
bors
8ec70ae5de auto merge of #8162 : thestinger/rust/no-copy, r=brson 2013-07-31 22:52:31 -07:00
Daniel Micay
b57ffef37e convert pure to a reserved keyword 2013-08-01 01:00:32 -04:00
Daniel Micay
dabd476203 make in and foreach get treated as keywords 2013-08-01 00:21:13 -04:00
bors
0c716c66fb auto merge of #8177 : graydon/rust/2013-07-31-register-new-snapshots, r=thestinger
r? someone
2013-07-31 20:55:34 -07:00
Graydon Hoare
4700b00ef7 register snapshots. 2013-07-31 19:38:43 -07:00
Daniel Micay
c47be6929b remove copy as a keyword 2013-07-31 20:18:28 -04:00
Daniel Micay
4bad515854 rm ancient error for lowercase kinds
3 of these kinds no longer even exist in the CamelCase form
2013-07-31 20:18:26 -04:00
Etienne Millon
0e2a086350 mk/tests.mk: remove mention of nonexistent files 2013-08-01 00:36:06 +02:00
Etienne Millon
bd980bcbf5 mk/tests.mk: fix typo "srcrustllvm" 2013-08-01 00:36:01 +02:00
Graydon Hoare
8261f2c37c test: add more codegen tests, add copyright headers to all. 2013-07-31 15:02:22 -07:00
Brian Anderson
ebd14c92f8 std: Remove PortSet. Not supported by new scheduler. Replace uses with SharedChan. 2013-07-31 14:59:49 -07:00
bors
ef87e2cc96 auto merge of #8151 : sanxiyn/rust/atomicrmw, r=cmr
#8039 broke ARM build, and nothing uses these yet.
2013-07-31 14:58:20 -07:00
bors
66a0b5870d auto merge of #8150 : dotdash/rust/assert_bloat, r=huonw
Assertions without a message get a generated message that consists of a
prefix plus the stringified expression that is being asserted. That
prefix is currently a unique string, while a static string would be
sufficient and needs less code.
2013-07-31 12:58:22 -07:00
Ben Blum
bc7cee7bbf Move atomically to unstable::sync, and document what it actually does. Close #7872. 2013-07-31 14:37:22 -04:00
Ben Blum
2e6dc161b6 Give tasks useful names. #2891 2013-07-31 14:37:22 -04:00
bors
e07e49ea8f auto merge of #8147 : dotdash/rust/assertion_option, r=pcwalton
Builds are considerably faster without assertions, so when working on
e.g. libstd, which doesn't directly interact with LLVM, one might want
to disable them.
2013-07-31 11:10:20 -07:00
bors
389aba0952 auto merge of #8146 : dotdash/rust/simple_take_glue, r=thestinger
These glue function just return void, no point in having a copy for each
type.
2013-07-31 09:22:21 -07:00
bors
9e857458d6 auto merge of #8145 : brson/rust/rttestfixes, r=pcwalton
Two commits here that fix test case dependencies on the old scheduler.
2013-07-31 07:34:24 -07:00
OGINO Masanori
6a69d27a0f Remove unused variables.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-07-31 23:22:57 +09:00
Stepan Koltsov
a5912736be Implement Zero for unit 2013-07-31 18:19:26 +04:00
bors
5d409ccd30 auto merge of #8143 : brson/rust/change-dir-lock, r=luqmana 2013-07-31 05:46:21 -07:00
bors
6296dc0d73 auto merge of #8141 : graydon/rust/foreach-in-sketch, r=brson
This is a preliminary implementation of `for ... in ... { ...}` using a transitionary keyword `foreach`. Codesize seems to be a little bit down (10% or less non-opt) and otherwise it seems quite trivial to rewrite lambda-based loops to use it. Once we've rewritten the codebase away from lambda-based `for` we can retarget that word at the same production, snapshot, rewrite the keywords in one go, and expire `foreach`.

Feedback welcome. It's a desugaring-based approach which is arguably something we should have been doing for other constructs before. I apologize both for the laziness associated with doing it this way and with any sense that I'm bending rules I put in place previously concerning "never doing desugarings". I put the expansion in `expand.rs` and would be amenable to the argument that the code there needs better factoring / more helpers / to move to a submodule or helper function. It does seem to work at this point, though, and I gather we'd like to get the shift done relatively quickly.
2013-07-31 03:58:21 -07:00
Seo Sanghyeon
428ea7d7ce Revert atomicrmw {max, min, umax, umin} 2013-07-31 19:44:20 +09:00
bors
8b7e241e02 auto merge of #8139 : brson/rust/rm-old-task-apis, r=pcwalton
This removes a bunch of options from the task builder interface that are irrelevant to the new scheduler and were generally unused anyway. It also bumps the stack size of new scheduler tasks so that there's enough room to run rustc and changes the interface to `Thread` to not implicitly join threads on destruction, but instead require an explicit, and mandatory, call to `join`.
2013-07-31 02:10:24 -07:00
Björn Steinbrink
c725926cf5 Reduce code bloat from assert!()
Assertions without a message get a generated message that consists of a
prefix plus the stringified expression that is being asserted. That
prefix is currently a unique string, while a static string would be
sufficient and needs less code.
2013-07-31 10:15:52 +02:00
Björn Steinbrink
02f7f72a9a Provide a "configure" option to disable LLVM assertions
Builds are considerably faster without assertions, so when working on
e.g. libstd, which doesn't directly interact with LLVM, one might want
to disable them.
2013-07-31 09:41:46 +02:00