Skip to content

Commit d5c6878

Browse files
committed
---
yaml --- r: 79444 b: refs/heads/snap-stage3 c: acad9f3 h: refs/heads/master v: v3
1 parent daca4fe commit d5c6878

File tree

20 files changed

+212
-138
lines changed

20 files changed

+212
-138
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 124eb2119c78651cfaaa7a046a101fa2e20f83ca
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 28d042e198d700287f0b946b13dab3b99e0ed962
4+
refs/heads/snap-stage3: acad9f35b3aef8cc0d82c6a43c662ddc0f946568
55
refs/heads/try: ac820906c0e53eab79a98ee64f7231f57c3887b4
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/.gitmodules

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,5 @@
44
branch = master
55
[submodule "src/libuv"]
66
path = src/libuv
7-
url = https://github.com/alexcrichton/libuv.git
7+
url = https://github.com/brson/libuv.git
88
branch = master
9-
[submodule "src/gyp"]
10-
path = src/gyp
11-
url = https://git.chromium.org/external/gyp.git

branches/snap-stage3/mk/dist.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ PKG_ICO = $(S)src/etc/pkg/rust-logo.ico
1212
PKG_EXE = $(PKG_DIR)-install.exe
1313
endif
1414

15-
PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp
15+
PKG_GITMODULES := $(S)src/libuv $(S)src/llvm
1616

1717
PKG_FILES := \
1818
$(S)COPYRIGHT \

branches/snap-stage3/mk/rt.mk

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -170,51 +170,36 @@ LIBUV_DEPS := $$(wildcard \
170170
$$(S)src/libuv/*/*/*/*)
171171
endif
172172

173-
LIBUV_MAKEFILE_$(1)_$(2) := $$(CFG_BUILD_DIR)$$(RT_BUILD_DIR_$(1)_$(2))/libuv/Makefile
174-
LIBUV_NO_LOAD = run-benchmarks.target.mk run-tests.target.mk \
175-
uv_dtrace_header.target.mk uv_dtrace_provider.target.mk
176-
177-
export PYTHONPATH := $(PYTHONPATH):$$(S)src/gyp/pylib
178-
179-
$$(LIBUV_MAKEFILE_$(1)_$(2)):
180-
(cd $(S)src/libuv/ && \
181-
./gyp_uv -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) -D ninja \
182-
-Goutput_dir=$$(@D) --generator-output $$(@D))
183-
184173
# XXX: Shouldn't need platform-specific conditions here
185174
ifdef CFG_WINDOWSY_$(1)
186175
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
187-
$$(Q)$$(MAKE) -C $$(S)src/libuv -f Makefile.mingw \
188-
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
189-
AR="$$(AR_$(1))" \
176+
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
177+
builddir_name="$$(CFG_BUILD_DIR)/$$(RT_BUILD_DIR_$(1)_$(2))/libuv" \
178+
OS=mingw \
190179
V=$$(VERBOSE)
191-
$$(Q)cp $$(S)src/libuv/libuv.a $$@
192180
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
193-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)_$(2))
194-
$$(Q)$$(MAKE) -C $$(@D) \
181+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
182+
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
195183
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
196184
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
197185
CC="$$(CC_$(1))" \
198186
CXX="$$(CXX_$(1))" \
199187
LINK="$$(CXX_$(1))" \
200188
AR="$$(AR_$(1))" \
201189
PLATFORM=android \
202-
host=android OS=linux \
203-
builddir="." \
204190
BUILDTYPE=Release \
205-
NO_LOAD="$$(LIBUV_NO_LOAD)" \
191+
builddir_name="$$(CFG_BUILD_DIR)/$$(RT_BUILD_DIR_$(1)_$(2))/libuv" \
192+
host=android OS=linux \
206193
V=$$(VERBOSE)
207194
else
208-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)_$(2))
209-
$$(Q)$$(MAKE) -C $$(@D) \
195+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
196+
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
210197
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
211198
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
212199
CC="$$(CC_$(1))" \
213200
CXX="$$(CXX_$(1))" \
214201
AR="$$(AR_$(1))" \
215-
builddir="." \
216-
BUILDTYPE=Release \
217-
NO_LOAD="$$(LIBUV_NO_LOAD)" \
202+
builddir_name="$$(CFG_BUILD_DIR)/$$(RT_BUILD_DIR_$(1)_$(2))/libuv" \
218203
V=$$(VERBOSE)
219204
endif
220205

branches/snap-stage3/src/gyp

Lines changed: 0 additions & 1 deletion
This file was deleted.

branches/snap-stage3/src/libextra/crypto/sha2.rs

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,8 @@ use cryptoutil::{write_u64_be, write_u32_be, read_u64v_be, read_u32v_be, add_byt
1414
add_bytes_to_bits_tuple, FixedBuffer, FixedBuffer128, FixedBuffer64, StandardPadding};
1515
use digest::Digest;
1616

17-
18-
// Sha-512 and Sha-256 use basically the same calculations which are implemented by these macros.
19-
// Inlining the calculations seems to result in better generated code.
20-
macro_rules! schedule_round( ($t:expr) => (
21-
W[$t] = sigma1(W[$t - 2]) + W[$t - 7] + sigma0(W[$t - 15]) + W[$t - 16];
22-
)
23-
)
24-
25-
macro_rules! sha2_round(
26-
($A:ident, $B:ident, $C:ident, $D:ident,
27-
$E:ident, $F:ident, $G:ident, $H:ident, $K:ident, $t:expr) => (
28-
{
29-
$H += sum1($E) + ch($E, $F, $G) + $K[$t] + W[$t];
30-
$D += $H;
31-
$H += sum0($A) + maj($A, $B, $C);
32-
}
33-
)
34-
)
35-
36-
37-
// A structure that represents that state of a digest computation for the SHA-2 512 family of digest
38-
// functions
17+
// A structure that represents that state of a digest computation for the SHA-2 512 family
18+
// of digest functions
3919
struct Engine512State {
4020
H0: u64,
4121
H1: u64,
@@ -108,6 +88,25 @@ impl Engine512State {
10888

10989
let mut W = [0u64, ..80];
11090

91+
// Sha-512 and Sha-256 use basically the same calculations which are implemented by
92+
// these macros. Inlining the calculations seems to result in better generated code.
93+
macro_rules! schedule_round( ($t:expr) => (
94+
W[$t] = sigma1(W[$t - 2]) + W[$t - 7] + sigma0(W[$t - 15]) + W[$t - 16];
95+
)
96+
)
97+
98+
macro_rules! sha2_round(
99+
($A:ident, $B:ident, $C:ident, $D:ident,
100+
$E:ident, $F:ident, $G:ident, $H:ident, $K:ident, $t:expr) => (
101+
{
102+
$H += sum1($E) + ch($E, $F, $G) + $K[$t] + W[$t];
103+
$D += $H;
104+
$H += sum0($A) + maj($A, $B, $C);
105+
}
106+
)
107+
)
108+
109+
111110
read_u64v_be(W.mut_slice(0, 16), data);
112111

113112
// Putting the message schedule inside the same loop as the round calculations allows for
@@ -505,6 +504,25 @@ impl Engine256State {
505504

506505
let mut W = [0u32, ..64];
507506

507+
// Sha-512 and Sha-256 use basically the same calculations which are implemented
508+
// by these macros. Inlining the calculations seems to result in better generated code.
509+
macro_rules! schedule_round( ($t:expr) => (
510+
W[$t] = sigma1(W[$t - 2]) + W[$t - 7] + sigma0(W[$t - 15]) + W[$t - 16];
511+
)
512+
)
513+
514+
macro_rules! sha2_round(
515+
($A:ident, $B:ident, $C:ident, $D:ident,
516+
$E:ident, $F:ident, $G:ident, $H:ident, $K:ident, $t:expr) => (
517+
{
518+
$H += sum1($E) + ch($E, $F, $G) + $K[$t] + W[$t];
519+
$D += $H;
520+
$H += sum0($A) + maj($A, $B, $C);
521+
}
522+
)
523+
)
524+
525+
508526
read_u32v_be(W.mut_slice(0, 16), data);
509527

510528
// Putting the message schedule inside the same loop as the round calculations allows for

branches/snap-stage3/src/libstd/rt/io/net/tcp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ mod test {
182182
do run_in_newsched_task {
183183
let mut called = false;
184184
do io_error::cond.trap(|e| {
185-
assert_eq!(e.kind, ConnectionRefused);
185+
assert!(e.kind == ConnectionRefused);
186186
called = true;
187187
}).inside {
188188
let addr = SocketAddr { ip: Ipv4Addr(0, 0, 0, 0), port: 1 };

branches/snap-stage3/src/libstd/rt/uv/addrinfo.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use ptr::null;
1717
use rt::uv::uvll;
1818
use rt::uv::uvll::UV_GETADDRINFO;
1919
use rt::uv::{Loop, UvError, NativeHandle};
20-
use rt::uv::status_to_maybe_uv_error;
20+
use rt::uv::status_to_maybe_uv_error_with_loop;
2121
use rt::uv::net::UvAddrInfo;
2222

2323
type GetAddrInfoCallback = ~fn(GetAddrInfoRequest, &UvAddrInfo, Option<UvError>);
@@ -90,7 +90,8 @@ impl GetAddrInfoRequest {
9090
status: c_int,
9191
res: *uvll::addrinfo) {
9292
let mut req: GetAddrInfoRequest = NativeHandle::from_native_handle(req);
93-
let err = status_to_maybe_uv_error(status);
93+
let loop_ = req.get_loop();
94+
let err = status_to_maybe_uv_error_with_loop(loop_.native_handle(), status);
9495
let addrinfo = UvAddrInfo(res);
9596
let data = req.get_req_data();
9697
(*data.getaddrinfo_cb.get_ref())(req, &addrinfo, err);

branches/snap-stage3/src/libstd/rt/uv/async.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl AsyncWatcher {
3434

3535
extern fn async_cb(handle: *uvll::uv_async_t, status: c_int) {
3636
let mut watcher: AsyncWatcher = NativeHandle::from_native_handle(handle);
37-
let status = status_to_maybe_uv_error(status);
37+
let status = status_to_maybe_uv_error(watcher, status);
3838
let data = watcher.get_watcher_data();
3939
let cb = data.async_cb.get_ref();
4040
(*cb)(watcher, status);

branches/snap-stage3/src/libstd/rt/uv/file.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use prelude::*;
1212
use ptr::null;
1313
use libc::c_void;
1414
use rt::uv::{Request, NativeHandle, Loop, FsCallback, Buf,
15-
status_to_maybe_uv_error, UvError};
15+
status_to_maybe_uv_error_with_loop, UvError};
1616
use rt::uv::uvll;
1717
use rt::uv::uvll::*;
1818
use super::super::io::support::PathLike;
@@ -62,7 +62,7 @@ impl FsRequest {
6262
pub fn open_sync<P: PathLike>(loop_: &Loop, path: &P, flags: int, mode: int)
6363
-> Result<int, UvError> {
6464
let result = FsRequest::open_common(loop_, path, flags, mode, None);
65-
sync_cleanup(result)
65+
sync_cleanup(loop_, result)
6666
}
6767

6868
fn unlink_common<P: PathLike>(loop_: &Loop, path: &P, cb: Option<FsCallback>) -> int {
@@ -83,11 +83,11 @@ impl FsRequest {
8383
}
8484
pub fn unlink<P: PathLike>(loop_: &Loop, path: &P, cb: FsCallback) {
8585
let result = FsRequest::unlink_common(loop_, path, Some(cb));
86-
sync_cleanup(result);
86+
sync_cleanup(loop_, result);
8787
}
8888
pub fn unlink_sync<P: PathLike>(loop_: &Loop, path: &P) -> Result<int, UvError> {
8989
let result = FsRequest::unlink_common(loop_, path, None);
90-
sync_cleanup(result)
90+
sync_cleanup(loop_, result)
9191
}
9292

9393
pub fn install_req_data(&self, cb: Option<FsCallback>) {
@@ -140,9 +140,9 @@ impl NativeHandle<*uvll::uv_fs_t> for FsRequest {
140140
}
141141
}
142142

143-
fn sync_cleanup(result: int)
143+
fn sync_cleanup(loop_: &Loop, result: int)
144144
-> Result<int, UvError> {
145-
match status_to_maybe_uv_error(result as i32) {
145+
match status_to_maybe_uv_error_with_loop(loop_.native_handle(), result as i32) {
146146
Some(err) => Err(err),
147147
None => Ok(result)
148148
}
@@ -186,7 +186,7 @@ impl FileDescriptor {
186186
pub fn write_sync(&mut self, loop_: &Loop, buf: Buf, offset: i64)
187187
-> Result<int, UvError> {
188188
let result = self.write_common(loop_, buf, offset, None);
189-
sync_cleanup(result)
189+
sync_cleanup(loop_, result)
190190
}
191191

192192
fn read_common(&mut self, loop_: &Loop, buf: Buf,
@@ -214,7 +214,7 @@ impl FileDescriptor {
214214
pub fn read_sync(&mut self, loop_: &Loop, buf: Buf, offset: i64)
215215
-> Result<int, UvError> {
216216
let result = self.read_common(loop_, buf, offset, None);
217-
sync_cleanup(result)
217+
sync_cleanup(loop_, result)
218218
}
219219

220220
fn close_common(self, loop_: &Loop, cb: Option<FsCallback>) -> int {
@@ -236,11 +236,12 @@ impl FileDescriptor {
236236
}
237237
pub fn close_sync(self, loop_: &Loop) -> Result<int, UvError> {
238238
let result = self.close_common(loop_, None);
239-
sync_cleanup(result)
239+
sync_cleanup(loop_, result)
240240
}
241241
}
242242
extern fn compl_cb(req: *uv_fs_t) {
243243
let mut req: FsRequest = NativeHandle::from_native_handle(req);
244+
let loop_ = req.get_loop();
244245
// pull the user cb out of the req data
245246
let cb = {
246247
let data = req.get_req_data();
@@ -251,7 +252,8 @@ extern fn compl_cb(req: *uv_fs_t) {
251252
// in uv_fs_open calls, the result will be the fd in the
252253
// case of success, otherwise it's -1 indicating an error
253254
let result = req.get_result();
254-
let status = status_to_maybe_uv_error(result);
255+
let status = status_to_maybe_uv_error_with_loop(
256+
loop_.native_handle(), result);
255257
// we have a req and status, call the user cb..
256258
// only giving the user a ref to the FsRequest, as we
257259
// have to clean it up, afterwards (and they aren't really

branches/snap-stage3/src/libstd/rt/uv/idle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl IdleWatcher {
4343
let mut idle_watcher: IdleWatcher = NativeHandle::from_native_handle(handle);
4444
let data = idle_watcher.get_watcher_data();
4545
let cb: &IdleCallback = data.idle_cb.get_ref();
46-
let status = status_to_maybe_uv_error(status);
46+
let status = status_to_maybe_uv_error(idle_watcher, status);
4747
(*cb)(idle_watcher, status);
4848
}
4949
}
@@ -57,7 +57,7 @@ impl IdleWatcher {
5757
let mut idle_watcher: IdleWatcher = NativeHandle::from_native_handle(handle);
5858
let data = idle_watcher.get_watcher_data();
5959
let cb: &IdleCallback = data.idle_cb.get_ref();
60-
let status = status_to_maybe_uv_error(status);
60+
let status = status_to_maybe_uv_error(idle_watcher, status);
6161
(*cb)(idle_watcher, status);
6262
}
6363
}

0 commit comments

Comments
 (0)