Skip to content

Commit 99bd67d

Browse files
committed
---
yaml --- r: 47835 b: refs/heads/incoming c: 831840a h: refs/heads/master i: 47833: 29b6ddf 47831: 3858b30 v: v3
1 parent 5606182 commit 99bd67d

File tree

18 files changed

+195
-176
lines changed

18 files changed

+195
-176
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: 9776c387319f4078fb748c5f365b713d603bfc4f
9+
refs/heads/incoming: 831840ab242b6359333c490653ea477ae9f553cb
1010
refs/heads/dist-snap: 8b98e5a296d95c5e832db0756828e5bec31c6f50
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/etc/x86.supp

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,55 @@
366366
...
367367
}
368368

369+
{
370+
enum-instruction-scheduling-1
371+
Memcheck:Cond
372+
fun:*fold_mod*
373+
...
374+
}
375+
376+
{
377+
enum-instruction-scheduling-2
378+
Memcheck:Cond
379+
fun:*fold_nmod*
380+
...
381+
}
382+
383+
{
384+
enum-instruction-scheduling-3
385+
Memcheck:Cond
386+
fun:*fold_crate*
387+
...
388+
}
389+
390+
{
391+
enum-instruction-scheduling-4
392+
Memcheck:Cond
393+
fun:*fold_enum*
394+
...
395+
}
396+
397+
{
398+
enum-instruction-scheduling-5
399+
Memcheck:Cond
400+
fun:*write_variant*
401+
...
402+
}
403+
404+
{
405+
enum-instruction-scheduling-6
406+
Memcheck:Cond
407+
fun:*merge_method_attrs*
408+
...
409+
}
410+
411+
{
412+
enum-instruction-scheduling-7
413+
Memcheck:Cond
414+
fun:*parse_config_*
415+
...
416+
}
417+
369418
{
370419
llvm-user-new-leak
371420
Memcheck:Leak

branches/incoming/src/libcore/at_vec.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ pub extern mod rustrt {
3030
++n: libc::size_t);
3131
}
3232

33+
#[abi = "rust-intrinsic"]
34+
pub extern mod rusti {
35+
pub fn move_val_init<T>(dst: &mut T, -src: T);
36+
}
37+
3338
/// Returns the number of elements the vector can hold without reallocating
3439
#[inline(always)]
3540
pub pure fn capacity<T>(v: @[const T]) -> uint {
@@ -180,10 +185,9 @@ pub mod traits {
180185
pub mod traits {}
181186

182187
pub mod raw {
183-
use at_vec::{capacity, rustrt};
188+
use at_vec::{capacity, rusti, rustrt};
184189
use cast::transmute;
185190
use libc;
186-
use private::intrinsics::{move_val_init};
187191
use ptr::addr_of;
188192
use ptr;
189193
use sys;
@@ -225,7 +229,7 @@ pub mod raw {
225229
(**repr).unboxed.fill += sys::size_of::<T>();
226230
let p = addr_of(&((**repr).unboxed.data));
227231
let p = ptr::offset(p, fill) as *mut T;
228-
move_val_init(&mut(*p), initval);
232+
rusti::move_val_init(&mut(*p), initval);
229233
}
230234

231235
pub unsafe fn push_slow<T>(v: &mut @[const T], initval: T) {

branches/incoming/src/libcore/num/f32.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use num::strconv;
1818
use num;
1919
use ops;
2020
use option::Option;
21-
use private::intrinsics::floorf32;
2221
use from_str;
2322
use to_str;
2423

@@ -333,6 +332,11 @@ impl ops::Neg<f32> for f32 {
333332
pure fn neg(&self) -> f32 { -*self }
334333
}
335334

335+
#[abi="rust-intrinsic"]
336+
pub extern {
337+
fn floorf32(val: f32) -> f32;
338+
}
339+
336340
impl num::Round for f32 {
337341
#[inline(always)]
338342
pure fn round(&self, mode: num::RoundMode) -> f32 {

branches/incoming/src/libcore/num/f64.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use num::strconv;
1919
use num;
2020
use ops;
2121
use option::Option;
22-
use private::intrinsics::floorf64;
2322
use to_str;
2423
use from_str;
2524

@@ -358,6 +357,11 @@ impl ops::Neg<f64> for f64 {
358357
pure fn neg(&self) -> f64 { -*self }
359358
}
360359

360+
#[abi="rust-intrinsic"]
361+
pub extern {
362+
fn floorf64(val: f64) -> f64;
363+
}
364+
361365
impl num::Round for f64 {
362366
#[inline(always)]
363367
pure fn round(&self, mode: num::RoundMode) -> f64 {

branches/incoming/src/libcore/pipes.rs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ use libc;
9292
use option;
9393
use option::{None, Option, Some, unwrap};
9494
use pipes;
95-
use private::intrinsics;
9695
use ptr;
9796
use private;
9897
use task;
@@ -257,26 +256,37 @@ pub fn entangle_buffer<T: Owned, Tstart: Owned>(
257256
(SendPacketBuffered(p), RecvPacketBuffered(p))
258257
}
259258

259+
#[abi = "rust-intrinsic"]
260+
#[doc(hidden)]
261+
extern mod rusti {
262+
fn atomic_xchg(dst: &mut int, src: int) -> int;
263+
fn atomic_xchg_acq(dst: &mut int, src: int) -> int;
264+
fn atomic_xchg_rel(dst: &mut int, src: int) -> int;
265+
266+
fn atomic_xadd_acq(dst: &mut int, src: int) -> int;
267+
fn atomic_xsub_rel(dst: &mut int, src: int) -> int;
268+
}
269+
260270
// If I call the rusti versions directly from a polymorphic function,
261271
// I get link errors. This is a bug that needs investigated more.
262272
#[doc(hidden)]
263273
pub fn atomic_xchng_rel(dst: &mut int, src: int) -> int {
264274
unsafe {
265-
intrinsics::atomic_xchg_rel(dst, src)
275+
rusti::atomic_xchg_rel(dst, src)
266276
}
267277
}
268278

269279
#[doc(hidden)]
270280
pub fn atomic_add_acq(dst: &mut int, src: int) -> int {
271281
unsafe {
272-
intrinsics::atomic_xadd_acq(dst, src)
282+
rusti::atomic_xadd_acq(dst, src)
273283
}
274284
}
275285

276286
#[doc(hidden)]
277287
pub fn atomic_sub_rel(dst: &mut int, src: int) -> int {
278288
unsafe {
279-
intrinsics::atomic_xsub_rel(dst, src)
289+
rusti::atomic_xsub_rel(dst, src)
280290
}
281291
}
282292

@@ -285,7 +295,7 @@ pub fn swap_task(dst: &mut *rust_task, src: *rust_task) -> *rust_task {
285295
// It might be worth making both acquire and release versions of
286296
// this.
287297
unsafe {
288-
transmute(intrinsics::atomic_xchg(transmute(dst), src as int))
298+
transmute(rusti::atomic_xchg(transmute(dst), src as int))
289299
}
290300
}
291301

@@ -325,14 +335,14 @@ fn wait_event(this: *rust_task) -> *libc::c_void {
325335
#[doc(hidden)]
326336
fn swap_state_acq(dst: &mut State, src: State) -> State {
327337
unsafe {
328-
transmute(intrinsics::atomic_xchg_acq(transmute(dst), src as int))
338+
transmute(rusti::atomic_xchg_acq(transmute(dst), src as int))
329339
}
330340
}
331341
332342
#[doc(hidden)]
333343
fn swap_state_rel(dst: &mut State, src: State) -> State {
334344
unsafe {
335-
transmute(intrinsics::atomic_xchg_rel(transmute(dst), src as int))
345+
transmute(rusti::atomic_xchg_rel(transmute(dst), src as int))
336346
}
337347
}
338348

branches/incoming/src/libcore/private.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ pub mod finally;
3232
pub mod weak_task;
3333
#[path = "private/exchange_alloc.rs"]
3434
pub mod exchange_alloc;
35-
#[path = "private/intrinsics.rs"]
36-
pub mod intrinsics;
3735

3836
extern mod rustrt {
3937
pub unsafe fn rust_create_little_lock() -> rust_little_lock;
@@ -45,6 +43,13 @@ extern mod rustrt {
4543
pub unsafe fn rust_raw_thread_join_delete(thread: *raw_thread);
4644
}
4745

46+
#[abi = "rust-intrinsic"]
47+
extern mod rusti {
48+
fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int;
49+
fn atomic_xadd(dst: &mut int, src: int) -> int;
50+
fn atomic_xsub(dst: &mut int, src: int) -> int;
51+
}
52+
4853
#[allow(non_camel_case_types)] // runtime type
4954
type raw_thread = libc::c_void;
5055

@@ -96,7 +101,7 @@ fn test_run_in_bare_thread_exchange() {
96101

97102
fn compare_and_swap(address: &mut int, oldval: int, newval: int) -> bool {
98103
unsafe {
99-
let old = intrinsics::atomic_cxchg(address, oldval, newval);
104+
let old = rusti::atomic_cxchg(address, oldval, newval);
100105
old == oldval
101106
}
102107
}
@@ -127,8 +132,7 @@ struct ArcDestruct<T> {
127132
}
128133
do task::unkillable {
129134
let data: ~ArcData<T> = cast::reinterpret_cast(&self.data);
130-
let new_count =
131-
intrinsics::atomic_xsub(&mut data.count, 1) - 1;
135+
let new_count = rusti::atomic_xsub(&mut data.count, 1) - 1;
132136
assert new_count >= 0;
133137
if new_count == 0 {
134138
// Were we really last, or should we hand off to an
@@ -201,7 +205,7 @@ pub unsafe fn unwrap_shared_mutable_state<T: Owned>(rc: SharedMutableState<T>)
201205
// Got in. Step 0: Tell destructor not to run. We are now it.
202206
rc.data = ptr::null();
203207
// Step 1 - drop our own reference.
204-
let new_count = intrinsics::atomic_xsub(&mut ptr.count, 1) - 1;
208+
let new_count = rusti::atomic_xsub(&mut ptr.count, 1) - 1;
205209
//assert new_count >= 0;
206210
if new_count == 0 {
207211
// We were the last owner. Can unwrap immediately.
@@ -280,7 +284,7 @@ pub unsafe fn clone_shared_mutable_state<T: Owned>(rc: &SharedMutableState<T>)
280284
-> SharedMutableState<T> {
281285
unsafe {
282286
let ptr: ~ArcData<T> = cast::reinterpret_cast(&(*rc).data);
283-
let new_count = intrinsics::atomic_xadd(&mut ptr.count, 1) + 1;
287+
let new_count = rusti::atomic_xadd(&mut ptr.count, 1) + 1;
284288
assert new_count >= 2;
285289
cast::forget(ptr);
286290
}

branches/incoming/src/libcore/private/at_exit.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ fn exit_runner(exit_fns: *ExitFunctions) {
7070
}
7171
}
7272

73+
#[abi = "rust-intrinsic"]
74+
pub extern mod rusti {
75+
fn move_val_init<T>(dst: &mut T, -src: T);
76+
fn init<T>() -> T;
77+
}
78+
7379
#[test]
7480
fn test_at_exit() {
7581
let i = 10;

branches/incoming/src/libcore/private/exchange_alloc.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use c_malloc = libc::malloc;
1414
use c_free = libc::free;
1515
use managed::raw::{BoxHeaderRepr, BoxRepr};
1616
use cast::transmute;
17-
use private::intrinsics::{atomic_xadd,atomic_xsub};
1817
use ptr::null;
1918
use intrinsic::TyDesc;
2019

@@ -36,15 +35,15 @@ pub unsafe fn malloc(td: *TypeDesc, size: uint) -> *c_void {
3635
box.header.next = null();
3736

3837
let exchange_count = &mut *rust_get_exchange_count_ptr();
39-
atomic_xadd(exchange_count, 1);
38+
rusti::atomic_xadd(exchange_count, 1);
4039

4140
return transmute(box);
4241
}
4342
}
4443

4544
pub unsafe fn free(ptr: *c_void) {
4645
let exchange_count = &mut *rust_get_exchange_count_ptr();
47-
atomic_xsub(exchange_count, 1);
46+
rusti::atomic_xsub(exchange_count, 1);
4847

4948
assert ptr.is_not_null();
5049
c_free(ptr);
@@ -69,3 +68,8 @@ extern {
6968
fn rust_get_exchange_count_ptr() -> *mut int;
7069
}
7170

71+
#[abi = "rust-intrinsic"]
72+
extern mod rusti {
73+
fn atomic_xadd(dst: &mut int, src: int) -> int;
74+
fn atomic_xsub(dst: &mut int, src: int) -> int;
75+
}

branches/incoming/src/libcore/private/global.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ use private::{Exclusive, exclusive};
3636
use private::{SharedMutableState, shared_mutable_state};
3737
use private::{get_shared_immutable_state};
3838
use private::at_exit::at_exit;
39-
use private::intrinsics::atomic_cxchg;
4039
use hashmap::linear::LinearMap;
4140
use sys::Closure;
4241
use task::spawn;
@@ -232,6 +231,11 @@ extern {
232231
fn rust_get_global_data_ptr() -> *mut int;
233232
}
234233

234+
#[abi = "rust-intrinsic"]
235+
extern {
236+
fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int;
237+
}
238+
235239
#[test]
236240
fn test_clone_rc() {
237241
type MyType = SharedMutableState<int>;

0 commit comments

Comments
 (0)