"constant propagate" rust_new_exit_task_glue to its only use.
This commit is contained in:
parent
fbc0e840e3
commit
fe90159b86
@ -99,8 +99,7 @@ rust_start(uintptr_t main_fn, rust_crate const *crate, int argc,
|
||||
}
|
||||
|
||||
uintptr_t main_args[4] = {0, 0, 0, (uintptr_t)args->args};
|
||||
dom->root_task->start((uintptr_t)rust_new_exit_task_glue,
|
||||
main_fn,
|
||||
dom->root_task->start(main_fn,
|
||||
(uintptr_t)&main_args, sizeof(main_args));
|
||||
|
||||
int ret = dom->start_main_loop();
|
||||
|
@ -262,8 +262,7 @@ rust_dom::start_main_loop() {
|
||||
rust_timer timer(this);
|
||||
|
||||
DLOG(this, dom, "started domain loop");
|
||||
DLOG(this, dom, "activate glue: " PTR ", exit glue: " PTR,
|
||||
root_crate->get_activate_glue(), rust_new_exit_task_glue);
|
||||
DLOG(this, dom, "activate glue: " PTR, root_crate->get_activate_glue());
|
||||
|
||||
while (number_of_live_tasks() > 0) {
|
||||
A(this, kernel->is_deadlocked() == false, "deadlock");
|
||||
|
@ -357,8 +357,6 @@ public:
|
||||
void flush();
|
||||
};
|
||||
|
||||
extern "C" void rust_new_exit_task_glue();
|
||||
|
||||
#include "rust_dwarf.h"
|
||||
|
||||
class
|
||||
|
@ -135,13 +135,13 @@ rust_task::~rust_task()
|
||||
cache->deref();
|
||||
}
|
||||
|
||||
extern "C" void rust_new_exit_task_glue();
|
||||
|
||||
void
|
||||
rust_task::start(uintptr_t exit_task_glue,
|
||||
uintptr_t spawnee_fn,
|
||||
rust_task::start(uintptr_t spawnee_fn,
|
||||
uintptr_t args,
|
||||
size_t callsz)
|
||||
{
|
||||
LOGPTR(dom, "exit-task glue", exit_task_glue);
|
||||
LOGPTR(dom, "from spawnee", spawnee_fn);
|
||||
|
||||
// Set sp to last uintptr_t-sized cell of segment
|
||||
@ -184,7 +184,7 @@ rust_task::start(uintptr_t exit_task_glue,
|
||||
|
||||
*spp-- = (uintptr_t) 0x0; // retp
|
||||
|
||||
*spp-- = (uintptr_t) exit_task_glue;
|
||||
*spp-- = (uintptr_t) rust_new_exit_task_glue;
|
||||
|
||||
for (size_t j = 0; j < n_callee_saves; ++j) {
|
||||
*spp-- = (uintptr_t)NULL;
|
||||
|
@ -55,8 +55,7 @@ rust_task : public maybe_proxy<rust_task>,
|
||||
|
||||
~rust_task();
|
||||
|
||||
void start(uintptr_t exit_task_glue,
|
||||
uintptr_t spawnee_fn,
|
||||
void start(uintptr_t spawnee_fn,
|
||||
uintptr_t args,
|
||||
size_t callsz);
|
||||
void grow(size_t n_frame_bytes);
|
||||
|
@ -560,8 +560,7 @@ upcall_start_task(rust_task *spawner,
|
||||
", spawnee 0x%" PRIxPTR
|
||||
", callsz %" PRIdPTR ")", task->name, task,
|
||||
spawnee_fn, callsz);
|
||||
task->start((uintptr_t)rust_new_exit_task_glue, spawnee_fn,
|
||||
args, callsz);
|
||||
task->start(spawnee_fn, args, callsz);
|
||||
return task;
|
||||
}
|
||||
|
||||
@ -612,18 +611,17 @@ static void *rust_thread_start(void *ptr)
|
||||
extern "C" CDECL maybe_proxy<rust_task> *
|
||||
upcall_start_thread(rust_task *task,
|
||||
rust_proxy<rust_task> *child_task_proxy,
|
||||
uintptr_t exit_task_glue,
|
||||
uintptr_t spawnee_fn,
|
||||
size_t callsz) {
|
||||
LOG_UPCALL_ENTRY(task);
|
||||
rust_dom *parenet_dom = task->dom;
|
||||
rust_handle<rust_task> *child_task_handle = child_task_proxy->handle();
|
||||
LOG(task, task,
|
||||
"exit_task_glue: " PTR ", spawnee_fn " PTR
|
||||
"spawnee_fn " PTR
|
||||
", callsz %" PRIdPTR ")",
|
||||
exit_task_glue, spawnee_fn, callsz);
|
||||
spawnee_fn, callsz);
|
||||
rust_task *child_task = child_task_handle->referent();
|
||||
child_task->start(exit_task_glue, spawnee_fn,
|
||||
child_task->start(spawnee_fn,
|
||||
task->rust_sp, callsz);
|
||||
#if defined(__WIN32__)
|
||||
HANDLE thread;
|
||||
|
@ -53,8 +53,7 @@ rust_task_test::worker::run() {
|
||||
rust_handle<rust_dom> *handle =
|
||||
kernel->create_domain(crate, "test");
|
||||
rust_dom *domain = handle->referent();
|
||||
domain->root_task->start((uintptr_t)rust_new_exit_task_glue,
|
||||
(uintptr_t)&task_entry, (uintptr_t)NULL, 0);
|
||||
domain->root_task->start((uintptr_t)&task_entry, (uintptr_t)NULL, 0);
|
||||
domain->start_main_loop();
|
||||
kernel->destroy_domain(domain);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user