diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-02-03 12:47:01 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-02-03 23:48:12 -0800 |
| commit | f94339cc1c98a1ae3ee3beb94c848009167a58d9 (patch) | |
| tree | 557b51759b825ea48071cbddbd023b687a8c4098 /src/rt/rust_upcall.cpp | |
| parent | f3343b35717edbfb88c7d1fae790e43d5d7cb732 (diff) | |
| download | rust-f94339cc1c98a1ae3ee3beb94c848009167a58d9.tar.gz rust-f94339cc1c98a1ae3ee3beb94c848009167a58d9.zip | |
rt: Rename rust_scheduler to rust_task_thread
Diffstat (limited to 'src/rt/rust_upcall.cpp')
| -rw-r--r-- | src/rt/rust_upcall.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index fc9e8af9f02..6c666fb8189 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -8,7 +8,7 @@ #include "rust_cc.h" #include "rust_internal.h" -#include "rust_scheduler.h" +#include "rust_task_thread.h" #include "rust_unwind.h" #include "rust_upcall.h" #include "rust_util.h" @@ -46,9 +46,9 @@ static void check_stack_alignment() { } inline void call_upcall_on_c_stack(void *args, void *fn_ptr) { check_stack_alignment(); - rust_task *task = rust_scheduler::get_task(); - rust_scheduler *sched = task->sched; - sched->c_context.call_shim_on_c_stack(args, fn_ptr); + rust_task *task = rust_task_thread::get_task(); + rust_task_thread *thread = task->thread; + thread->c_context.call_shim_on_c_stack(args, fn_ptr); } extern "C" void record_sp(void *limit); @@ -62,21 +62,21 @@ extern "C" void record_sp(void *limit); */ extern "C" CDECL void upcall_call_shim_on_c_stack(void *args, void *fn_ptr) { - rust_task *task = rust_scheduler::get_task(); + rust_task *task = rust_task_thread::get_task(); // FIXME (1226) - The shim functions generated by rustc contain the // morestack prologue, so we need to let them know they have enough // stack. record_sp(0); - rust_scheduler *sched = task->sched; + rust_task_thread *thread = task->thread; try { - sched->c_context.call_shim_on_c_stack(args, fn_ptr); + thread->c_context.call_shim_on_c_stack(args, fn_ptr); } catch (...) { - A(sched, false, "Native code threw an exception"); + A(thread, false, "Native code threw an exception"); } - task = rust_scheduler::get_task(); + task = rust_task_thread::get_task(); task->record_stack_limit(); } @@ -90,7 +90,7 @@ struct s_fail_args { extern "C" CDECL void upcall_s_fail(s_fail_args *args) { - rust_task *task = rust_scheduler::get_task(); + rust_task *task = rust_task_thread::get_task(); LOG_UPCALL_ENTRY(task); LOG_ERR(task, upcall, "upcall fail '%s', %s:%" PRIdPTR, args->expr, args->file, args->line); @@ -116,7 +116,7 @@ struct s_malloc_args { extern "C" CDECL void upcall_s_malloc(s_malloc_args *args) { - rust_task *task = rust_scheduler::get_task(); + rust_task *task = rust_task_thread::get_task(); LOG_UPCALL_ENTRY(task); LOG(task, mem, "upcall malloc(0x%" PRIxPTR ")", args->td); @@ -153,11 +153,11 @@ struct s_free_args { extern "C" CDECL void upcall_s_free(s_free_args *args) { - rust_task *task = rust_scheduler::get_task(); + rust_task *task = rust_task_thread::get_task(); LOG_UPCALL_ENTRY(task); - rust_scheduler *sched = task->sched; - DLOG(sched, mem, + rust_task_thread *thread = task->thread; + DLOG(thread, mem, "upcall free(0x%" PRIxPTR ", is_gc=%" PRIdPTR ")", (uintptr_t)args->ptr); @@ -200,7 +200,7 @@ struct s_shared_malloc_args { extern "C" CDECL void upcall_s_shared_malloc(s_shared_malloc_args *args) { - rust_task *task = rust_scheduler::get_task(); + rust_task *task = rust_task_thread::get_task(); LOG_UPCALL_ENTRY(task); LOG(task, mem, @@ -232,11 +232,11 @@ struct s_shared_free_args { extern "C" CDECL void upcall_s_shared_free(s_shared_free_args *args) { - rust_task *task = rust_scheduler::get_task(); + rust_task *task = rust_task_thread::get_task(); LOG_UPCALL_ENTRY(task); - rust_scheduler *sched = task->sched; - DLOG(sched, mem, + rust_task_thread *thread = task->thread; + DLOG(thread, mem, "upcall shared_free(0x%" PRIxPTR")", (uintptr_t)args->ptr); task->kernel->free(args->ptr); @@ -262,7 +262,7 @@ struct s_create_shared_type_desc_args { void upcall_s_create_shared_type_desc(s_create_shared_type_desc_args *args) { - rust_task *task = rust_scheduler::get_task(); + rust_task *task = rust_task_thread::get_task(); LOG_UPCALL_ENTRY(task); // Copy the main part of the type descriptor: @@ -301,7 +301,7 @@ upcall_create_shared_type_desc(type_desc *td) { void upcall_s_free_shared_type_desc(type_desc *td) { // n.b.: invoked from rust_cc.cpp as well as generated code - rust_task *task = rust_scheduler::get_task(); + rust_task *task = rust_task_thread::get_task(); LOG_UPCALL_ENTRY(task); if (td) { @@ -337,7 +337,7 @@ struct s_get_type_desc_args { extern "C" CDECL void upcall_s_get_type_desc(s_get_type_desc_args *args) { - rust_task *task = rust_scheduler::get_task(); + rust_task *task = rust_task_thread::get_task(); LOG_UPCALL_ENTRY(task); LOG(task, cache, "upcall get_type_desc with size=%" PRIdPTR @@ -375,7 +375,7 @@ struct s_intern_dict_args { extern "C" CDECL void upcall_s_intern_dict(s_intern_dict_args *args) { - rust_task *task = rust_scheduler::get_task(); + rust_task *task = rust_task_thread::get_task(); LOG_UPCALL_ENTRY(task); rust_crate_cache *cache = task->get_crate_cache(); args->res = cache->get_dict(args->n_fields, args->dict); @@ -397,7 +397,7 @@ struct s_vec_grow_args { extern "C" CDECL void upcall_s_vec_grow(s_vec_grow_args *args) { - rust_task *task = rust_scheduler::get_task(); + rust_task *task = rust_task_thread::get_task(); LOG_UPCALL_ENTRY(task); reserve_vec(task, args->vp, args->new_sz); (*args->vp)->fill = args->new_sz; @@ -438,7 +438,7 @@ struct s_vec_push_args { extern "C" CDECL void upcall_s_vec_push(s_vec_push_args *args) { - rust_task *task = rust_scheduler::get_task(); + rust_task *task = rust_task_thread::get_task(); LOG_UPCALL_ENTRY(task); size_t new_sz = (*args->vp)->fill + args->elt_ty->size; reserve_vec(task, args->vp, new_sz); @@ -456,7 +456,7 @@ upcall_vec_push(rust_vec** vp, type_desc* elt_ty, void* elt) { upcall_s_vec_push(&args); // Do the stack check to make sure this op, on the Rust stack, is behaving - rust_task *task = rust_scheduler::get_task(); + rust_task *task = rust_task_thread::get_task(); task->check_stack_canary(); } @@ -471,7 +471,7 @@ struct s_dynastack_mark_args { extern "C" CDECL void upcall_s_dynastack_mark(s_dynastack_mark_args *args) { - args->retval = rust_scheduler::get_task()->dynastack.mark(); + args->retval = rust_task_thread::get_task()->dynastack.mark(); } extern "C" CDECL void * @@ -496,7 +496,7 @@ extern "C" CDECL void upcall_s_dynastack_alloc(s_dynastack_alloc_args *args) { size_t sz = args->sz; args->retval = sz ? - rust_scheduler::get_task()->dynastack.alloc(sz, NULL) : NULL; + rust_task_thread::get_task()->dynastack.alloc(sz, NULL) : NULL; } extern "C" CDECL void * @@ -522,7 +522,7 @@ upcall_s_dynastack_alloc_2(s_dynastack_alloc_2_args *args) { size_t sz = args->sz; type_desc *ty = args->ty; args->retval = sz ? - rust_scheduler::get_task()->dynastack.alloc(sz, ty) : NULL; + rust_task_thread::get_task()->dynastack.alloc(sz, ty) : NULL; } extern "C" CDECL void * @@ -538,7 +538,7 @@ struct s_dynastack_free_args { extern "C" CDECL void upcall_s_dynastack_free(s_dynastack_free_args *args) { - return rust_scheduler::get_task()->dynastack.free(args->ptr); + return rust_task_thread::get_task()->dynastack.free(args->ptr); } /** Frees space in the dynamic stack. */ @@ -587,7 +587,7 @@ upcall_rust_personality(int version, s_rust_personality_args args = {(_Unwind_Reason_Code)0, version, actions, exception_class, ue_header, context}; - rust_task *task = rust_scheduler::get_task(); + rust_task *task = rust_task_thread::get_task(); // The personality function is run on the stack of the // last function that threw or landed, which is going @@ -659,7 +659,7 @@ struct s_new_stack_args { extern "C" CDECL void upcall_s_new_stack(struct s_new_stack_args *args) { - rust_task *task = rust_scheduler::get_task(); + rust_task *task = rust_task_thread::get_task(); args->result = task->new_stack(args->stk_sz, args->args_addr, args->args_sz); @@ -674,7 +674,7 @@ upcall_new_stack(size_t stk_sz, void *args_addr, size_t args_sz) { extern "C" CDECL void upcall_s_del_stack() { - rust_task *task = rust_scheduler::get_task(); + rust_task *task = rust_task_thread::get_task(); task->del_stack(); } @@ -689,7 +689,7 @@ upcall_del_stack() { // needs to acquire the value of the stack pointer extern "C" CDECL void upcall_reset_stack_limit() { - rust_task *task = rust_scheduler::get_task(); + rust_task *task = rust_task_thread::get_task(); task->reset_stack_limit(); } |
