From 139b1d1b314edce0584646a4032e6a6e66167b71 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Fri, 9 Sep 2011 14:02:07 +0200 Subject: [PATCH] Get rid of some unused upcalls I guess these became obsolete when the communication stuff moved into the stdlib. --- src/comp/back/upcall.rs | 15 ++------------ src/rt/rust_builtin.cpp | 4 +--- src/rt/rust_upcall.cpp | 45 ----------------------------------------- src/rt/rustrt.def.in | 5 ----- 4 files changed, 3 insertions(+), 66 deletions(-) diff --git a/src/comp/back/upcall.rs b/src/comp/back/upcall.rs index c3ae653316b..774cb30c001 100644 --- a/src/comp/back/upcall.rs +++ b/src/comp/back/upcall.rs @@ -24,12 +24,7 @@ import lib::llvm::llvm::ValueRef; import lib::llvm::llvm::TypeRef; type upcalls = - {grow_task: ValueRef, - _yield: ValueRef, - sleep: ValueRef, - _fail: ValueRef, - kill: ValueRef, - exit: ValueRef, + {_fail: ValueRef, malloc: ValueRef, free: ValueRef, shared_malloc: ValueRef, @@ -61,13 +56,7 @@ fn declare_upcalls(_tn: type_names, tydesc_type: TypeRef, let d = bind decl_with_taskptr(taskptr_type, llmod, _, _, _); let dr = bind decl(llmod, _, _, _); - let empty_vec: [TypeRef] = []; - ret @{grow_task: dv("grow_task", [T_size_t()]), - _yield: dv("yield", empty_vec), - sleep: dv("sleep", [T_size_t()]), - _fail: dv("fail", [T_ptr(T_i8()), T_ptr(T_i8()), T_size_t()]), - kill: dv("kill", [taskptr_type]), - exit: dv("exit", empty_vec), + ret @{_fail: dv("fail", [T_ptr(T_i8()), T_ptr(T_i8()), T_size_t()]), malloc: d("malloc", [T_size_t(), T_ptr(tydesc_type)], T_ptr(T_i8())), free: dv("free", [T_ptr(T_i8()), T_int()]), diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 7614269a122..5e0c9dbf4c2 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -160,11 +160,9 @@ rand_free(rust_task *task, randctx *rctx) task->free(rctx); } -extern "C" CDECL void upcall_sleep(rust_task *task, size_t time_in_us); - extern "C" CDECL void task_sleep(rust_task *task, size_t time_in_us) { - upcall_sleep(task, time_in_us); + task->yield(time_in_us); } extern "C" CDECL void diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index 330b10dc178..2d7791e876f 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -20,20 +20,6 @@ check_stack(rust_task *task) { } #endif -extern "C" void -upcall_grow_task(rust_task *task, size_t n_frame_bytes) { - I(task->sched, false); - LOG_UPCALL_ENTRY(task); - task->grow(n_frame_bytes); -} - -extern "C" CDECL void -upcall_yield(rust_task *task) { - LOG_UPCALL_ENTRY(task); - LOG(task, comm, "upcall yield()"); - task->yield(1); -} - // Copy elements from one vector to another, // dealing with reference counts static inline void @@ -54,15 +40,6 @@ copy_elements(rust_task *task, type_desc *elem_t, } } -extern "C" CDECL void -upcall_sleep(rust_task *task, size_t time_in_us) { - LOG_UPCALL_ENTRY(task); - LOG(task, task, "elapsed %" PRIu64 " us", - task->yield_timer.elapsed_us()); - LOG(task, task, "sleep %d us", time_in_us); - task->yield(time_in_us); -} - extern "C" CDECL void upcall_fail(rust_task *task, char const *expr, @@ -73,28 +50,6 @@ upcall_fail(rust_task *task, task->fail(); } -/** - * Called whenever a task's ref count drops to zero. - */ -extern "C" CDECL void -upcall_kill(rust_task *task, rust_task_id tid) { - LOG_UPCALL_ENTRY(task); - rust_task *target = task->kernel->get_task_by_id(tid); - target->kill(); - target->deref(); -} - -/** - * Called by the exit glue when the task terminates. - */ -extern "C" CDECL void -upcall_exit(rust_task *task) { - LOG_UPCALL_ENTRY(task); - task->die(); - task->notify_tasks_waiting_to_join(); - task->yield(1); -} - extern "C" CDECL uintptr_t upcall_malloc(rust_task *task, size_t nbytes, type_desc *td) { LOG_UPCALL_ENTRY(task); diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index 856046a65fc..a0e7c972eeb 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -71,17 +71,12 @@ upcall_dynastack_alloc upcall_dynastack_alloc_2 upcall_dynastack_free upcall_dynastack_mark -upcall_exit upcall_fail upcall_free upcall_get_type_desc -upcall_grow_task upcall_vec_grow upcall_vec_push -upcall_kill upcall_log_type upcall_malloc upcall_shared_malloc upcall_shared_free -upcall_sleep -upcall_yield