Commit Graph

19157 Commits

Author SHA1 Message Date
bors
6df66c194d auto merge of #7109 : bblum/rust/rwlocks, r=brson
r? @brson

links to issues: #7065 the race that's fixed; #7066 the perf improvement I added. There are also some minor cleanup commits here.

To measure the performance improvement from replacing the exclusive with an atomic uint, I edited the ```msgsend-ring-rw-arcs``` bench test to do a ```write_downgrade``` instead of just a ```write```, so that it stressed the code paths that accessed ```read_count```. (At first I was still using ```write``` and saw no performance difference whatsoever, whoooops.)

The bench test measures how long it takes to send 1,000,000 messages by using rwarcs to emulate pipes. I also measured the performance difference imposed by the fix to the ```access_lock``` race (which involves taking an extra semaphore in the ```cond.wait()``` path). The net result is that fixing the race imposes a 4% to 5% slowdown, but doing the atomic uint optimization gives a 6% to 8% speedup.

Note that this speedup will be most visible in read- or downgrade-heavy workloads. If an RWARC's only users are writers, the optimization doesn't matter. All the same, I think this more than justifies the extra complexity I mentioned in #7066.

The raw numbers are:
```
with xadd read count
        before write_cond fix
                4.18 to 4.26 us/message
        with write_cond fix
                4.35 to 4.39 us/message
                
with exclusive read count
        before write_cond fix
                4.41 to 4.47 us/message
        with write_cond fix
                4.65 to 4.76 us/message
```
2013-06-15 04:07:03 -07:00
bors
da42e6b7a0 auto merge of #7133 : kballard/rust/terminfo-parm, r=thestinger
Implement conditional support in terminfo, along with a few other related operators.

Fix implementation of non-commutative arithmetic operators.

Remove all known cases of task failure from `terminfo::parm::expand`, and change the method signature.

Fix some other miscellaneous issues.
2013-06-15 03:07:05 -07:00
Philipp Brueschweiler
c7013ba1fc std::dynamic_lib: start fixing windows implementation
The code compiles and runs under windows now, but I couldn't look up any
symbol from the current executable (dlopen(NULL)), and calling looked
up external function handles doesn't seem to work correctly under windows.
2013-06-15 10:10:49 +02:00
bors
83d44f87e5 auto merge of #7125 : alexcrichton/rust/rusti-issues, r=brson
This un-reverts the reverts of the rusti commits made awhile back. These were reverted for an LLVM failure in rustpkg. I believe that this is not a problem with these commits, but rather that rustc is being used in parallel for rustpkg tests (in-process). This is not working yet (almost! see #7011), so I serialized all the tests to run one after another.

@brson, I'm mainly just guessing as to the cause of the LLVM failures in rustpkg tests. I'm confident that running tests in parallel is more likely to be the problem than those commits I made.

Additionally, this fixes two recently reported issues with rusti.
2013-06-15 01:04:05 -07:00
Steven Stewart-Gallus
5de67f9cc9 Cleaned up driver.rs 2013-06-15 00:43:19 -07:00
bors
7d1065e913 auto merge of #7122 : thestinger/rust/std, r=luqmana 2013-06-14 23:37:08 -07:00
Tim Chevalier
e3c4104d74 rustpkg: Write more automated tests
Automate more tests described in the commands.txt file,
and add infrastructure for running them. Right now, tests shell
out to call rustpkg. This is not ideal.
2013-06-14 22:46:01 -07:00
Tim Chevalier
1adbb4520b rustc: Don't continue to resolve if there's an error in lang_items
This confused me when it happened.
2013-06-14 22:45:43 -07:00
bors
c83bceddbb auto merge of #7121 : huonw/rust/rand-call, r=pnkfelix
r? @pnkfelix
2013-06-14 22:37:13 -07:00
bors
1ba6fa4777 auto merge of #7110 : thestinger/rust/iterator, r=brson 2013-06-14 21:37:27 -07:00
Huon Wilson
18542568a8 std: rename .connect/.concat in VectorVector to avoid conflicting with StrVector.
This is caused by StrVector having a generic implementation for &[S]
and so #5898 means that method resolution of ~[~[1]].concat() sees that
both StrVector and VectorVector have methods that (superficially) match.

They are now connect_vec and concat_vec, which means that they can actually be
called.
2013-06-15 14:15:56 +10:00
bors
1104e659d5 auto merge of #7144 : dotdash/rust/caches, r=graydon
The lookups for these items in external crates currently cause repeated
decoding of the EBML metadata, which is pretty slow. Adding caches to
avoid the repeated decoding reduces the time required for the type
checking of librustc by about 25%.
2013-06-14 20:28:09 -07:00
Daniel Micay
824a6277af rm CopyableNonstrictIter
copies can just be done explicitly: `xs.transform(|x|x.clone())`
2013-06-14 23:15:42 -04:00
Daniel Micay
d68be89e69 rm MutableIter
replaced with mutable implementations of Iterator
2013-06-14 23:15:42 -04:00
Daniel Micay
8111701604 rm ExtendedMutableIter
replaced with `xs.mut_iter().enumerate()`
2013-06-14 23:15:42 -04:00
Daniel Micay
585f5f7f79 add IteratorUtil to the prelude 2013-06-14 23:15:42 -04:00
Björn Steinbrink
a710e61903 Add caches for method and impl metadata
The lookups for these items in external crates currently cause repeated
decoding of the EBML metadata, which is pretty slow. Adding caches to
avoid the repeated decoding reduces the time required for the type
checking of librustc by about 25%.
2013-06-15 04:28:19 +02:00
bors
104e6120b1 auto merge of #7116 : thestinger/rust/whitespace, r=luqmana 2013-06-14 19:25:05 -07:00
Alex Crichton
893c70d7bc Add Zero impls for lots of common types 2013-06-14 19:12:37 -07:00
Alex Crichton
07f5ab1009 Implement a deriving(Zero) attribute 2013-06-14 19:12:37 -07:00
Erick Tryzelaar
ac83f4b732 std: add a fixme to note performance issues in vec::from_elem. 2013-06-14 16:58:55 -07:00
Brian Anderson
38e05747b5 xfail run-pass/auto-encode.rs 2013-06-14 16:50:53 -07:00
Kevin Ballard
da4e614742 Fix line lengths in terminfo 2013-06-14 13:03:42 -07:00
Kevin Ballard
f31767df66 Implement terminfo param conditionals
Implement the %?, %t, %e, and %; operators. Also implement the %<, %=,
%> operators, without which conditionals aren't very useful.

Fix the order of parameters for the arithmetic operators.

Implement the missing %^ operator.
2013-06-14 12:37:54 -07:00
Kevin Ballard
6423548818 Fix a bunch of failure cases in terminfo
Replace all potentially-failing operations with Err returns and add
tests.

Remove the Char parameter type; characters are represented as Numbers.

Fix integer constants to work properly when there are multiple constants
in the same capability string.

Tweak loop to use iterators instead of indexing into cap.
2013-06-14 12:37:54 -07:00
Kevin Ballard
e990239a3a Don't require &mut [Param] with terminfo::parm::expand() 2013-06-14 12:37:53 -07:00
Kevin Ballard
c9e234a1ae Tweak terminfo::parm::expand function signature
Take a new struct Variables instead of two &mut [] vectors for static
and dynamic variables.
2013-06-14 12:37:53 -07:00
Kevin Ballard
9f9e505405 Tweak new terminfo logical operator support 2013-06-14 12:37:53 -07:00
Corey Richardson
821a962feb Various terminfo parameterization changes 2013-06-14 12:37:53 -07:00
Huon Wilson
d361802540 rustdoc: add syntax highlighting to item signatures.
This means that type definitions and function signatures have
pretty colours.

It uses the following template:

~~~ {.rust}
<code>
~~~
2013-06-15 02:19:19 +10:00
Graydon Hoare
eadd83da8b Merge pull request #7129 from erickt/fix-std-path-tests
std: get std::path tests to work again
2013-06-14 09:06:56 -07:00
Erick Tryzelaar
f7e1daa8e3 std: get std::path tests to work again 2013-06-14 07:13:32 -07:00
Felix S. Klock II
876f6deb4a fixed code to placate new restrictions on form of function/method invocations. 2013-06-14 09:36:03 +02:00
Alex Crichton
9c3b1cbc19 Resolve LLVM crashing in rustpkg tests 2013-06-13 22:53:30 -07:00
Alex Crichton
dc18321ef5 Don't run passes again on JIT code
These passes are already run beforehand, no need to do them twice.
2013-06-13 22:53:10 -07:00
Alex Crichton
079ffa362f Correctly parse commands for rusti
Closes #7120
2013-06-13 21:48:16 -07:00
Alex Crichton
a90fffe367 Revert "Revert "Have JIT execution take ownership of the LLVMContextRef""
This reverts commit 19adece68b.
2013-06-13 21:25:18 -07:00
Alex Crichton
1a3edecbf2 Revert "Revert "Remove all usage of the global LLVMContextRef""
This reverts commit 541c657a73.
2013-06-13 21:25:12 -07:00
Brian Anderson
7755018074 Revert "std: convert {vec,str}::to_owned to methods."
This fixes the strange random crashes in compile-fail tests.

This reverts commit 96cd61ad03.

Conflicts:
	src/librustc/driver/driver.rs
	src/libstd/str.rs
	src/libsyntax/ext/quote.rs
2013-06-13 19:06:47 -07:00
Daniel Micay
2b13606d9f update the libstd docstring for the rename 2013-06-13 21:41:11 -04:00
Huon Wilson
8431e609ea xfail test on windows, because extern mod doesn't work there 2013-06-14 11:12:06 +10:00
Huon Wilson
e6c3e4a000 syntax: revert the uint -> u32 "fix"; make the names/comment match. 2013-06-14 11:12:06 +10:00
Huon Wilson
f93a974558 syntax: correct the Rand::rand call to select enum variants in #[deriving(Rand)].
Previously, this was not a global call, and so when `#[deriving(Rand)]`
was in any module other than the top-level one, it failed (unless there
was a `use std;` in scope).

Also, fix a minor inconsistency between uints and u32s for this piece
of code.
2013-06-14 11:12:06 +10:00
Daniel Micay
ec27644870 automated whitespace fixes 2013-06-13 18:03:08 -04:00
Graydon Hoare
b417bc8511 Update CONTRIBUTING.md 2013-06-13 15:41:34 -06:00
Felix S. Klock II
b03a0b27aa make pp file conform to actual output, noting some oddities along the way. 2013-06-13 23:40:24 +02:00
Felix S. Klock II
0f4d5c2134 checkpoint block-comment-wchar state. 2013-06-13 23:40:24 +02:00
Felix S. Klock II
1deebeef7d Fix #3961 : use char range methods instead of byte offsets to detect whitespace. 2013-06-13 23:40:24 +02:00
Brian Anderson
541c657a73 Revert "Remove all usage of the global LLVMContextRef"
This reverts commit 779191cd4b.

Conflicts:
	src/librustc/middle/trans/base.rs
	src/librustc/middle/trans/common.rs
2013-06-13 13:08:57 -07:00
Brian Anderson
19adece68b Revert "Have JIT execution take ownership of the LLVMContextRef"
This reverts commit 5c5095d25e.

Conflicts:
	src/librusti/rusti.rc
2013-06-13 13:08:57 -07:00