Skip to content

Commit 0d83b90

Browse files
committed
---
yaml --- r: 95657 b: refs/heads/dist-snap c: e4c6523 h: refs/heads/master i: 95655: f302933 v: v3
1 parent c7c1803 commit 0d83b90

File tree

28 files changed

+218
-707
lines changed

28 files changed

+218
-707
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: c5074ae6463876bbb9511e980fe890bebc881e41
9+
refs/heads/dist-snap: e4c6523c65c45d0fc4485b9e691043c7b5c61a94
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
branch = master
99
[submodule "src/gyp"]
1010
path = src/gyp
11-
url = https://github.com/brson/gyp.git
11+
url = https://git.chromium.org/external/gyp.git

branches/dist-snap/src/libextra/arc.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,10 @@ pub struct Arc<T> { priv x: UnsafeArc<T> }
117117
*/
118118
impl<T:Freeze+Send> Arc<T> {
119119
/// Create an atomically reference counted wrapper.
120-
#[inline]
121120
pub fn new(data: T) -> Arc<T> {
122121
Arc { x: UnsafeArc::new(data) }
123122
}
124123

125-
#[inline]
126124
pub fn get<'a>(&'a self) -> &'a T {
127125
unsafe { &*self.x.get_immut() }
128126
}
@@ -150,7 +148,6 @@ impl<T:Freeze + Send> Clone for Arc<T> {
150148
* object. However, one of the `arc` objects can be sent to another task,
151149
* allowing them to share the underlying data.
152150
*/
153-
#[inline]
154151
fn clone(&self) -> Arc<T> {
155152
Arc { x: self.x.clone() }
156153
}
@@ -170,7 +167,6 @@ pub struct MutexArc<T> { priv x: UnsafeArc<MutexArcInner<T>> }
170167

171168
impl<T:Send> Clone for MutexArc<T> {
172169
/// Duplicate a mutex-protected Arc. See arc::clone for more details.
173-
#[inline]
174170
fn clone(&self) -> MutexArc<T> {
175171
// NB: Cloning the underlying mutex is not necessary. Its reference
176172
// count would be exactly the same as the shared state's.
@@ -353,7 +349,6 @@ pub struct RWArc<T> {
353349

354350
impl<T:Freeze + Send> Clone for RWArc<T> {
355351
/// Duplicate a rwlock-protected Arc. See arc::clone for more details.
356-
#[inline]
357352
fn clone(&self) -> RWArc<T> {
358353
RWArc { x: self.x.clone() }
359354
}

branches/dist-snap/src/libextra/comm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pub fn rendezvous<T: Send>() -> (SyncPort<T>, SyncChan<T>) {
136136
#[cfg(test)]
137137
mod test {
138138
use comm::{DuplexStream, rendezvous};
139-
use std::rt::test::run_in_uv_task;
139+
use std::rt::test::run_in_newsched_task;
140140
use std::task::spawn_unlinked;
141141

142142

@@ -165,7 +165,7 @@ mod test {
165165
#[test]
166166
fn recv_a_lot() {
167167
// Rendezvous streams should be able to handle any number of messages being sent
168-
do run_in_uv_task {
168+
do run_in_newsched_task {
169169
let (port, chan) = rendezvous();
170170
do spawn {
171171
do 1000000.times { chan.send(()) }

branches/dist-snap/src/librustc/middle/borrowck/gather_loans/mod.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,12 @@ fn gather_loans_in_expr(this: &mut GatherLoanCtxt,
230230

231231
// make sure that the thing we are pointing out stays valid
232232
// for the lifetime `scope_r` of the resulting ptr:
233-
let expr_ty = ty::expr_ty(tcx, ex);
234-
if !ty::type_is_bot(expr_ty) {
235-
let scope_r = ty_region(tcx, ex.span, expr_ty);
236-
this.guarantee_valid(ex.id,
237-
ex.span,
238-
base_cmt,
239-
LoanMutability::from_ast_mutability(mutbl),
240-
scope_r);
241-
}
233+
let scope_r = ty_region(tcx, ex.span, ty::expr_ty(tcx, ex));
234+
this.guarantee_valid(ex.id,
235+
ex.span,
236+
base_cmt,
237+
LoanMutability::from_ast_mutability(mutbl),
238+
scope_r);
242239
visit::walk_expr(this, ex, ());
243240
}
244241

branches/dist-snap/src/librustc/middle/trans/base.rs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,37 @@ pub fn get_extern_const(externs: &mut ExternMap, llmod: ModuleRef,
288288
return c;
289289
}
290290
}
291+
pub fn umax(cx: @mut Block, a: ValueRef, b: ValueRef) -> ValueRef {
292+
let _icx = push_ctxt("umax");
293+
let cond = ICmp(cx, lib::llvm::IntULT, a, b);
294+
return Select(cx, cond, b, a);
295+
}
296+
297+
pub fn umin(cx: @mut Block, a: ValueRef, b: ValueRef) -> ValueRef {
298+
let _icx = push_ctxt("umin");
299+
let cond = ICmp(cx, lib::llvm::IntULT, a, b);
300+
return Select(cx, cond, a, b);
301+
}
302+
303+
// Given a pointer p, returns a pointer sz(p) (i.e., inc'd by sz bytes).
304+
// The type of the returned pointer is always i8*. If you care about the
305+
// return type, use bump_ptr().
306+
pub fn ptr_offs(bcx: @mut Block, base: ValueRef, sz: ValueRef) -> ValueRef {
307+
let _icx = push_ctxt("ptr_offs");
308+
let raw = PointerCast(bcx, base, Type::i8p());
309+
InBoundsGEP(bcx, raw, [sz])
310+
}
311+
312+
// Increment a pointer by a given amount and then cast it to be a pointer
313+
// to a given type.
314+
pub fn bump_ptr(bcx: @mut Block, t: ty::t, base: ValueRef, sz: ValueRef) ->
315+
ValueRef {
316+
let _icx = push_ctxt("bump_ptr");
317+
let ccx = bcx.ccx();
318+
let bumped = ptr_offs(bcx, base, sz);
319+
let typ = type_of(ccx, t).ptr_to();
320+
PointerCast(bcx, bumped, typ)
321+
}
291322

292323
// Returns a pointer to the body for the box. The box may be an opaque
293324
// box. The result will be casted to the type of body_t, if it is statically
@@ -403,6 +434,10 @@ pub fn malloc_general(bcx: @mut Block, t: ty::t, heap: heap) -> MallocResult {
403434
assert!(heap != heap_exchange);
404435
malloc_general_dyn(bcx, t, heap, llsize_of(bcx.ccx(), ty))
405436
}
437+
pub fn malloc_boxed(bcx: @mut Block, t: ty::t)
438+
-> MallocResult {
439+
malloc_general(bcx, t, heap_managed)
440+
}
406441

407442
pub fn heap_for_unique(bcx: @mut Block, t: ty::t) -> heap {
408443
if ty::type_contents(bcx.tcx(), t).contains_managed() {
@@ -499,6 +534,12 @@ pub fn set_no_split_stack(f: ValueRef) {
499534
}
500535
}
501536

537+
pub fn set_glue_inlining(f: ValueRef, t: ty::t) {
538+
if ty::type_is_structural(t) {
539+
set_optimize_for_size(f);
540+
} else { set_always_inline(f); }
541+
}
542+
502543
// Double-check that we never ask LLVM to declare the same symbol twice. It
503544
// silently mangles such symbols, breaking our linkage model.
504545
pub fn note_unique_llvm_symbol(ccx: &mut CrateContext, sym: @str) {

branches/dist-snap/src/librustc/middle/trans/glue.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ pub fn declare_generic_glue(ccx: &mut CrateContext, t: ty::t, llfnty: Type,
674674
debug!("{} is for type {}", fn_nm, ppaux::ty_to_str(ccx.tcx, t));
675675
note_unique_llvm_symbol(ccx, fn_nm);
676676
let llfn = decl_cdecl_fn(ccx.llmod, fn_nm, llfnty);
677+
set_glue_inlining(llfn, t);
677678
return llfn;
678679
}
679680

branches/dist-snap/src/libstd/ptr.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@ impl<T> Clone for *T {
4747
}
4848
}
4949

50-
impl<T> Clone for *mut T {
51-
#[inline]
52-
fn clone(&self) -> *mut T {
53-
*self
54-
}
55-
}
56-
5750
/// Return the first offset `i` such that `f(buf[i]) == true`.
5851
#[inline]
5952
pub unsafe fn position<T>(buf: *T, f: &fn(&T) -> bool) -> uint {

0 commit comments

Comments
 (0)