Skip to content

Commit cb465f3

Browse files
committed
---
yaml --- r: 12255 b: refs/heads/master c: 9d5c20e h: refs/heads/master i: 12253: 9ba45df 12251: 769f330 12247: 4913937 12239: 4c190f5 12223: 09bdeb9 v: v3
1 parent 4c94927 commit cb465f3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+746
-406
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 3a0477c39816c20fc798a33cde56e8b99ddb32b1
2+
refs/heads/master: 9d5c20ecca52afd19c8a1cdc1ac5bc08e71d455d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/AUTHORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Jeff Olson <[email protected]>
3636
Jeffrey Yasskin <[email protected]>
3737
Jesse Ruderman <[email protected]>
3838
Joe Pletcher <[email protected]>
39+
Jon Morton <[email protected]>
3940
Josh Matthews <[email protected]>
4041
Joshua Clark <[email protected]>
4142
Joshua Wise <[email protected]>

trunk/mk/rt.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@ RUNTIME_CS_$(1) := \
5050
rt/rust_builtin.cpp \
5151
rt/rust_run_program.cpp \
5252
rt/rust_env.cpp \
53-
rt/rust_task_thread.cpp \
53+
rt/rust_sched_loop.cpp \
54+
rt/rust_sched_launcher.cpp \
55+
rt/rust_sched_driver.cpp \
5456
rt/rust_scheduler.cpp \
57+
rt/rust_sched_reaper.cpp \
5558
rt/rust_task.cpp \
5659
rt/rust_stack.cpp \
5760
rt/rust_port.cpp \

trunk/mk/tests.mk

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,34 @@ check-full: tidy all check-stage1 check-stage2 check-stage3 \
7474
ifdef CFG_NOTIDY
7575
tidy:
7676
else
77+
78+
ALL_CS := $(wildcard $(S)src/rt/*.cpp \
79+
$(S)src/rt/*/*.cpp \
80+
$(S)src/rt/*/*/*.cpp \
81+
$(S)srcrustllvm/*.cpp)
82+
ALL_CS := $(filter-out $(S)src/rt/bigint/bigint_ext.cpp \
83+
$(S)src/rt/bigint/bigint_int.cpp \
84+
,$(ALL_CS))
85+
ALL_HS := $(wildcard $(S)src/rt/*.h \
86+
$(S)src/rt/*/*.h \
87+
$(S)src/rt/*/*/*.h \
88+
$(S)srcrustllvm/*.h)
89+
ALL_HS := $(filter-out $(S)src/rt/vg/valgrind.h \
90+
$(S)src/rt/vg/memcheck.h \
91+
$(S)src/rt/uthash/uthash.h \
92+
$(S)src/rt/uthash/utlist.h \
93+
$(S)src/rt/msvc/typeof.h \
94+
$(S)src/rt/msvc/stdint.h \
95+
$(S)src/rt/msvc/inttypes.h \
96+
$(S)src/rt/bigint/bigint.h \
97+
,$(ALL_HS))
98+
7799
tidy:
78100
@$(call E, check: formatting)
79101
$(Q)echo \
80-
$(addprefix $(S)src/, $(RUSTLLVM_LIB_CS) $(RUSTLLVM_OBJS_CS) \
81-
$(RUSTLLVM_HDR) \
82-
$(RUNTIME_CS) $(RUNTIME_HDR) $(RUNTIME_S)) \
83102
$(wildcard $(S)src/etc/*.py) \
103+
$(ALL_CS) \
104+
$(ALL_HS) \
84105
$(COMPILER_CRATE) \
85106
$(COMPILER_INPUTS) \
86107
$(CORELIB_CRATE) \

trunk/src/cargo/cargo.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ fn for_each_package(c: cargo, b: fn(source, package)) {
434434

435435
// Runs all programs in directory <buildpath>
436436
fn run_programs(buildpath: str) {
437-
let newv = os::list_dir_path(buildpath);
437+
let newv = os::list_dir(buildpath);
438438
for ct: str in newv {
439439
run::run_program(ct, []);
440440
}
@@ -471,7 +471,7 @@ fn install_one_crate(c: cargo, path: str, cf: str) {
471471
none { ret; }
472472
some(bp) { bp }
473473
};
474-
let newv = os::list_dir_path(buildpath);
474+
let newv = os::list_dir(buildpath);
475475
let exec_suffix = os::exe_suffix();
476476
for ct: str in newv {
477477
if (exec_suffix != "" && str::ends_with(ct, exec_suffix)) ||
@@ -524,7 +524,7 @@ fn rustc_sysroot() -> str {
524524
fn install_source(c: cargo, path: str) {
525525
#debug("source: %s", path);
526526
os::change_dir(path);
527-
let contents = os::list_dir_path(".");
527+
let contents = os::list_dir(".");
528528

529529
#debug("contents: %s", str::connect(contents, ", "));
530530

trunk/src/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fn test_opts(config: config) -> test::test_opts {
127127
fn make_tests(config: config) -> [test::test_desc] {
128128
#debug("making tests from %s", config.src_base);
129129
let mut tests = [];
130-
for file: str in os::list_dir_path(config.src_base) {
130+
for file: str in os::list_dir(config.src_base) {
131131
let file = file;
132132
#debug("inspecting file %s", file);
133133
if is_test(config, file) {

trunk/src/etc/x86.supp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,34 @@
389389
fun:uv_loop_delete
390390
}
391391

392+
{
393+
lock_and_signal-probably-threadsafe-access-outside-of-lock
394+
Helgrind:Race
395+
fun:_ZN15lock_and_signal27lock_held_by_current_threadEv
396+
...
397+
}
398+
399+
{
400+
lock_and_signal-probably-threadsafe-access-outside-of-lock2
401+
Helgrind:Race
402+
fun:_ZN15lock_and_signal6unlockEv
403+
...
404+
}
405+
406+
{
407+
lock_and_signal-probably-threadsafe-access-outside-of-lock3
408+
Helgrind:Race
409+
fun:_ZN15lock_and_signal4lockEv
410+
...
411+
}
412+
413+
{
414+
lock_and_signal-probably-threadsafe-access-outside-of-lock4
415+
Helgrind:Race
416+
fun:_ZN15lock_and_signal4waitEv
417+
...
418+
}
419+
392420
{
393421
uv-async-send-does-racy-things
394422
Helgrind:Race

trunk/src/fuzzer/fuzzer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn find_rust_files(&files: [str], path: str) {
2525
} else if os::path_is_dir(path)
2626
&& !contains(path, "compile-fail")
2727
&& !contains(path, "build") {
28-
for p in os::list_dir_path(path) {
28+
for p in os::list_dir(path) {
2929
find_rust_files(files, p);
3030
}
3131
}

trunk/src/libcore/os.rs

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export close, fclose, fsync_fd, waitpid;
2929
export env, getenv, setenv, fdopen, pipe;
3030
export getcwd, dll_filename, self_exe_path;
3131
export exe_suffix, dll_suffix, sysname;
32-
export homedir, list_dir, list_dir_path, path_is_dir, path_exists,
33-
make_absolute, make_dir, remove_dir, change_dir, remove_file;
32+
export homedir, list_dir, path_is_dir, path_exists, make_absolute,
33+
make_dir, remove_dir, change_dir, remove_file;
3434

3535
// FIXME: move these to str perhaps?
3636
export as_c_charp, fill_charp_buf;
@@ -452,37 +452,26 @@ fn list_dir(p: path) -> [str] {
452452
#[cfg(target_os = "linux")]
453453
#[cfg(target_os = "macos")]
454454
#[cfg(target_os = "freebsd")]
455-
fn star(p: str) -> str { p }
455+
fn star() -> str { "" }
456456

457457
#[cfg(target_os = "win32")]
458-
fn star(p: str) -> str {
459-
let pl = str::len(p);
460-
if pl == 0u || (p[pl - 1u] as char != path::consts::path_sep
461-
** p[pl - 1u] as char != path::consts::alt_path_sep) {
462-
p + path::path_sep() + "*"
463-
} else {
464-
p + "*"
465-
}
466-
}
458+
fn star() -> str { "*" }
467459

468-
rustrt::rust_list_files(star(p)).filter {|filename|
469-
!str::eq(filename, ".") || !str::eq(filename, "..")
470-
}
471-
}
472-
473-
#[doc = "
474-
Lists the contents of a directory
475-
476-
This version prepends each entry with the directory.
477-
"]
478-
fn list_dir_path(p: path) -> [str] {
479460
let mut p = p;
480461
let pl = str::len(p);
481462
if pl == 0u || (p[pl - 1u] as char != path::consts::path_sep
482463
&& p[pl - 1u] as char != path::consts::alt_path_sep) {
483464
p += path::path_sep();
484465
}
485-
os::list_dir(p).map {|f| p + f}
466+
let mut full_paths: [str] = [];
467+
for vec::each(rustrt::rust_list_files(p + star())) {|filename|
468+
if !str::eq(filename, ".") {
469+
if !str::eq(filename, "..") {
470+
full_paths += [p + filename];
471+
}
472+
}
473+
}
474+
ret full_paths;
486475
}
487476

488477
#[doc = "Removes a directory at the specified path"]
@@ -761,4 +750,4 @@ mod tests {
761750
assert (!os::path_exists("test/nonexistent-bogus-path"));
762751
}
763752

764-
}
753+
}

trunk/src/rt/arch/x86_64/context.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ struct registers_t {
3131
class context {
3232
public:
3333
registers_t regs;
34-
34+
3535
context();
36-
36+
3737
context *next;
38-
38+
3939
void swap(context &out);
4040
void call(void *f, void *arg, void *sp);
4141
};

trunk/src/rt/memory_region.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class memory_region {
4141

4242
inline alloc_header *get_header(void *mem);
4343
inline void *get_data(alloc_header *);
44-
4544

4645
rust_srv *_srv;
4746
memory_region *_parent;

trunk/src/rt/rust.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,20 @@ rust_start(uintptr_t main_fn, int argc, char **argv, void* crate_map) {
8080
rust_sched_id sched_id = kernel->create_scheduler(env->num_sched_threads);
8181
rust_scheduler *sched = kernel->get_scheduler_by_id(sched_id);
8282
rust_task *root_task = sched->create_task(NULL, "main");
83-
rust_task_thread *thread = root_task->thread;
8483
command_line_args *args
8584
= new (kernel, "main command line args")
8685
command_line_args(root_task, argc, argv);
8786

88-
DLOG(thread, dom, "startup: %d args in 0x%" PRIxPTR,
87+
LOG(root_task, dom, "startup: %d args in 0x%" PRIxPTR,
8988
args->argc, (uintptr_t)args->args);
9089
for (int i = 0; i < args->argc; i++) {
91-
DLOG(thread, dom, "startup: arg[%d] = '%s'", i, args->argv[i]);
90+
LOG(root_task, dom, "startup: arg[%d] = '%s'", i, args->argv[i]);
9291
}
9392

9493
root_task->start((spawn_fn)main_fn, NULL, args->args);
9594
root_task = NULL;
9695

97-
int ret = kernel->wait_for_schedulers();
96+
int ret = kernel->wait_for_exit();
9897
delete args;
9998
delete kernel;
10099
delete srv;

trunk/src/rt/rust_box_annihilator.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ class annihilator : public shape::data<annihilator,shape::ptr> {
5858
}
5959

6060
void walk_tag2(shape::tag_info &tinfo, uint32_t tag_variant) {
61-
shape::data<annihilator,shape::ptr>::walk_variant1(tinfo, tag_variant);
61+
shape::data<annihilator,shape::ptr>
62+
::walk_variant1(tinfo, tag_variant);
6263
}
6364

6465
void walk_uniq2() {
@@ -83,7 +84,7 @@ class annihilator : public shape::data<annihilator,shape::ptr> {
8384
if (pair.env) {
8485
// free closed over data:
8586
shape::data<annihilator,shape::ptr>::walk_fn_contents1();
86-
87+
8788
// now free the ptr:
8889
task->kernel->free(pair.env);
8990
}

0 commit comments

Comments
 (0)