Skip to content

Commit fe90159

Browse files
committed
"constant propagate" rust_new_exit_task_glue to its only use.
1 parent fbc0e84 commit fe90159

File tree

7 files changed

+12
-20
lines changed

7 files changed

+12
-20
lines changed

src/rt/rust.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ rust_start(uintptr_t main_fn, rust_crate const *crate, int argc,
9999
}
100100

101101
uintptr_t main_args[4] = {0, 0, 0, (uintptr_t)args->args};
102-
dom->root_task->start((uintptr_t)rust_new_exit_task_glue,
103-
main_fn,
102+
dom->root_task->start(main_fn,
104103
(uintptr_t)&main_args, sizeof(main_args));
105104

106105
int ret = dom->start_main_loop();

src/rt/rust_dom.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,7 @@ rust_dom::start_main_loop() {
262262
rust_timer timer(this);
263263

264264
DLOG(this, dom, "started domain loop");
265-
DLOG(this, dom, "activate glue: " PTR ", exit glue: " PTR,
266-
root_crate->get_activate_glue(), rust_new_exit_task_glue);
265+
DLOG(this, dom, "activate glue: " PTR, root_crate->get_activate_glue());
267266

268267
while (number_of_live_tasks() > 0) {
269268
A(this, kernel->is_deadlocked() == false, "deadlock");

src/rt/rust_internal.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,6 @@ rust_crate_cache : public dom_owned<rust_crate_cache>,
357357
void flush();
358358
};
359359

360-
extern "C" void rust_new_exit_task_glue();
361-
362360
#include "rust_dwarf.h"
363361

364362
class

src/rt/rust_task.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ rust_task::~rust_task()
135135
cache->deref();
136136
}
137137

138+
extern "C" void rust_new_exit_task_glue();
139+
138140
void
139-
rust_task::start(uintptr_t exit_task_glue,
140-
uintptr_t spawnee_fn,
141+
rust_task::start(uintptr_t spawnee_fn,
141142
uintptr_t args,
142143
size_t callsz)
143144
{
144-
LOGPTR(dom, "exit-task glue", exit_task_glue);
145145
LOGPTR(dom, "from spawnee", spawnee_fn);
146146

147147
// Set sp to last uintptr_t-sized cell of segment
@@ -184,7 +184,7 @@ rust_task::start(uintptr_t exit_task_glue,
184184

185185
*spp-- = (uintptr_t) 0x0; // retp
186186

187-
*spp-- = (uintptr_t) exit_task_glue;
187+
*spp-- = (uintptr_t) rust_new_exit_task_glue;
188188

189189
for (size_t j = 0; j < n_callee_saves; ++j) {
190190
*spp-- = (uintptr_t)NULL;

src/rt/rust_task.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ rust_task : public maybe_proxy<rust_task>,
5555

5656
~rust_task();
5757

58-
void start(uintptr_t exit_task_glue,
59-
uintptr_t spawnee_fn,
58+
void start(uintptr_t spawnee_fn,
6059
uintptr_t args,
6160
size_t callsz);
6261
void grow(size_t n_frame_bytes);

src/rt/rust_upcall.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,7 @@ upcall_start_task(rust_task *spawner,
560560
", spawnee 0x%" PRIxPTR
561561
", callsz %" PRIdPTR ")", task->name, task,
562562
spawnee_fn, callsz);
563-
task->start((uintptr_t)rust_new_exit_task_glue, spawnee_fn,
564-
args, callsz);
563+
task->start(spawnee_fn, args, callsz);
565564
return task;
566565
}
567566

@@ -612,18 +611,17 @@ static void *rust_thread_start(void *ptr)
612611
extern "C" CDECL maybe_proxy<rust_task> *
613612
upcall_start_thread(rust_task *task,
614613
rust_proxy<rust_task> *child_task_proxy,
615-
uintptr_t exit_task_glue,
616614
uintptr_t spawnee_fn,
617615
size_t callsz) {
618616
LOG_UPCALL_ENTRY(task);
619617
rust_dom *parenet_dom = task->dom;
620618
rust_handle<rust_task> *child_task_handle = child_task_proxy->handle();
621619
LOG(task, task,
622-
"exit_task_glue: " PTR ", spawnee_fn " PTR
620+
"spawnee_fn " PTR
623621
", callsz %" PRIdPTR ")",
624-
exit_task_glue, spawnee_fn, callsz);
622+
spawnee_fn, callsz);
625623
rust_task *child_task = child_task_handle->referent();
626-
child_task->start(exit_task_glue, spawnee_fn,
624+
child_task->start(spawnee_fn,
627625
task->rust_sp, callsz);
628626
#if defined(__WIN32__)
629627
HANDLE thread;

src/rt/test/rust_test_runtime.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ rust_task_test::worker::run() {
5353
rust_handle<rust_dom> *handle =
5454
kernel->create_domain(crate, "test");
5555
rust_dom *domain = handle->referent();
56-
domain->root_task->start((uintptr_t)rust_new_exit_task_glue,
57-
(uintptr_t)&task_entry, (uintptr_t)NULL, 0);
56+
domain->root_task->start((uintptr_t)&task_entry, (uintptr_t)NULL, 0);
5857
domain->start_main_loop();
5958
kernel->destroy_domain(domain);
6059
}

0 commit comments

Comments
 (0)