about summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
authorRafael Ávila de Espíndola <respindola@mozilla.com>2011-05-24 15:51:22 -0400
committerRafael Ávila de Espíndola <respindola@mozilla.com>2011-05-24 15:51:22 -0400
commitfe90159b86c0a044ce0bcef534e4800ea35ba01b (patch)
tree2b1cd2d821cb497755206fc74f6692b86ef2113c /src/rt
parentfbc0e840e3e660c0f0acd3e738d005b2a4aec00f (diff)
downloadrust-fe90159b86c0a044ce0bcef534e4800ea35ba01b.tar.gz
rust-fe90159b86c0a044ce0bcef534e4800ea35ba01b.zip
"constant propagate" rust_new_exit_task_glue to its only use.
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust.cpp3
-rw-r--r--src/rt/rust_dom.cpp3
-rw-r--r--src/rt/rust_internal.h2
-rw-r--r--src/rt/rust_task.cpp8
-rw-r--r--src/rt/rust_task.h3
-rw-r--r--src/rt/rust_upcall.cpp10
-rw-r--r--src/rt/test/rust_test_runtime.cpp3
7 files changed, 12 insertions, 20 deletions
diff --git a/src/rt/rust.cpp b/src/rt/rust.cpp
index 1e708be0a49..e7db7ed5e34 100644
--- a/src/rt/rust.cpp
+++ b/src/rt/rust.cpp
@@ -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();
diff --git a/src/rt/rust_dom.cpp b/src/rt/rust_dom.cpp
index 7a3ed513d66..d5187ca7480 100644
--- a/src/rt/rust_dom.cpp
+++ b/src/rt/rust_dom.cpp
@@ -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");
diff --git a/src/rt/rust_internal.h b/src/rt/rust_internal.h
index 8bbc5f0d8f6..213c724e7ce 100644
--- a/src/rt/rust_internal.h
+++ b/src/rt/rust_internal.h
@@ -357,8 +357,6 @@ public:
     void flush();
 };
 
-extern "C" void rust_new_exit_task_glue();
-
 #include "rust_dwarf.h"
 
 class
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 13295f5ae7d..09665e11298 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -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;
diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h
index 88d99879ace..1bfe7ae4bda 100644
--- a/src/rt/rust_task.h
+++ b/src/rt/rust_task.h
@@ -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);
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 48d6a67ce44..c86a071eddf 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -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;
diff --git a/src/rt/test/rust_test_runtime.cpp b/src/rt/test/rust_test_runtime.cpp
index 717d8b0c5f4..ffbc15d95f6 100644
--- a/src/rt/test/rust_test_runtime.cpp
+++ b/src/rt/test/rust_test_runtime.cpp
@@ -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);
 }