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-18 13:48:57 -0400
committerRafael Ávila de Espíndola <respindola@mozilla.com>2011-05-18 13:48:57 -0400
commitcebc9b359db16ea0370fb9f9013507a559e33bcd (patch)
tree2a935143c218ecbbecb3bbbb3ec2a35c9cdd85b1 /src/rt
parentf4e049c41571617de62537aeaadefee9546c6816 (diff)
downloadrust-cebc9b359db16ea0370fb9f9013507a559e33bcd.tar.gz
rust-cebc9b359db16ea0370fb9f9013507a559e33bcd.zip
Remove dead rustboot code.
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust.cpp2
-rw-r--r--src/rt/rust_task.cpp117
-rw-r--r--src/rt/rust_task.h9
-rw-r--r--src/rt/rust_upcall.cpp4
-rw-r--r--src/rt/test/rust_test_runtime.cpp1
5 files changed, 3 insertions, 130 deletions
diff --git a/src/rt/rust.cpp b/src/rt/rust.cpp
index 56c5b4d6672..efb3d3eab37 100644
--- a/src/rt/rust.cpp
+++ b/src/rt/rust.cpp
@@ -103,7 +103,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(crate->get_exit_task_glue(),
-                          crate->abi_tag, main_fn,
+                          main_fn,
                           (uintptr_t)&main_args, sizeof(main_args));
 
     int ret = dom->start_main_loop();
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 20843d51460..13295f5ae7d 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -137,127 +137,10 @@ rust_task::~rust_task()
 
 void
 rust_task::start(uintptr_t exit_task_glue,
-                 uintptr_t spawnee_abi,
                  uintptr_t spawnee_fn,
                  uintptr_t args,
                  size_t callsz)
 {
-    if (spawnee_abi == ABI_X86_RUSTBOOT_CDECL)
-        start_rustboot(exit_task_glue, spawnee_fn, args, callsz);
-    else
-        start_rustc(exit_task_glue, spawnee_fn, args, callsz);
-}
-
-void
-rust_task::start_rustboot(uintptr_t exit_task_glue,
-                          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
-    rust_sp -= sizeof(uintptr_t);
-
-    // NB: Darwin needs "16-byte aligned" stacks *at the point of the call
-    // instruction in the caller*. This means that the address at which the
-    // word before retpc is pushed must always be 16-byte aligned.
-    //
-    // see: "Mac OS X ABI Function Call Guide"
-
-
-    // Begin synthesizing frames. There are two: a "fully formed"
-    // exit-task frame at the top of the stack -- that pretends to be
-    // mid-execution -- and a just-starting frame beneath it that
-    // starts executing the first instruction of the spawnee. The
-    // spawnee *thinks* it was called by the exit-task frame above
-    // it. It wasn't; we put that fake frame in place here, but the
-    // illusion is enough for the spawnee to return to the exit-task
-    // frame when it's done, and exit.
-    uintptr_t *spp = (uintptr_t *)rust_sp;
-
-
-    // The exit_task_glue frame we synthesize above the frame we activate:
-    make_aligned_room_for_bytes(spp, 2 * sizeof(uintptr_t));
-    *spp-- = (uintptr_t) 0;          // closure-or-obj
-    *spp-- = (uintptr_t) this;       // task
-    I(dom, spp == align_down(spp));
-    *spp-- = (uintptr_t) 0x0;        // output
-    *spp-- = (uintptr_t) 0x0;        // retpc
-
-    uintptr_t exit_task_frame_base = 0;
-
-    for (size_t j = 0; j < n_callee_saves; ++j) {
-
-        // We want 'frame_base' to point to the old fp in this (exit-task)
-        // frame, because we're going to inject this frame-pointer into
-        // the callee-save frame pointer value in the *next* (spawnee)
-        // frame. A cheap trick, but this means the spawnee frame will
-        // restore the proper frame pointer of the glue frame as it runs
-        // its epilogue.
-        if (j == callee_save_fp)
-            exit_task_frame_base = (uintptr_t)spp;
-
-        *spp-- = 0;
-    }
-
-    *spp-- = (uintptr_t) dom->root_crate;  // crate ptr
-    *spp-- = (uintptr_t) 0;                // frame_glue_fns
-
-    I(dom, args);
-    make_aligned_room_for_bytes(spp, callsz - sizeof(uintptr_t));
-
-    // Copy args from spawner to spawnee.
-    uintptr_t *src = (uintptr_t *)args;
-    src += 1;                  // spawn-call output slot
-    src += 1;                  // spawn-call task slot
-    src += 1;                  // spawn-call closure-or-obj slot
-
-    // Undo previous sp-- so we're pointing at the last word pushed.
-    ++spp;
-
-    // Memcpy all but the task, output and env pointers
-    callsz -= (3 * sizeof(uintptr_t));
-    spp = (uintptr_t*) (((uintptr_t)spp) - callsz);
-    memcpy(spp, src, callsz);
-
-    // Move sp down to point to last implicit-arg cell (env).
-    spp--;
-
-    // The *implicit* incoming args to the spawnee frame we're
-    // activating:
-    *spp-- = (uintptr_t) 0x0;               // closure-or-obj
-
-    // in CDECL mode we write the task + outptr to the spawnee stack.
-    *spp-- = (uintptr_t) this;            // task
-    *spp-- = (uintptr_t) 0;               // output addr
-
-    I(dom, spp+1 == align_down(spp+1));
-    *spp-- = (uintptr_t) exit_task_glue;  // retpc
-
-    // The context the activate_glue needs to switch stack.
-    *spp-- = (uintptr_t) spawnee_fn;      // instruction to start at
-    for (size_t j = 0; j < n_callee_saves; ++j) {
-        // callee-saves to carry in when we activate
-        if (j == callee_save_fp)
-            *spp-- = exit_task_frame_base;
-        else
-            *spp-- = (uintptr_t)NULL;
-    }
-
-    // Back up one, we overshot where sp should be.
-    rust_sp = (uintptr_t) (spp+1);
-
-    transition(&dom->newborn_tasks, &dom->running_tasks);
-}
-
-void
-rust_task::start_rustc(uintptr_t exit_task_glue,
-                       uintptr_t spawnee_fn,
-                       uintptr_t args,
-                       size_t callsz)
-{
     LOGPTR(dom, "exit-task glue", exit_task_glue);
     LOGPTR(dom, "from spawnee", spawnee_fn);
 
diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h
index 9169a0b3418..88d99879ace 100644
--- a/src/rt/rust_task.h
+++ b/src/rt/rust_task.h
@@ -56,18 +56,9 @@ rust_task : public maybe_proxy<rust_task>,
     ~rust_task();
 
     void start(uintptr_t exit_task_glue,
-               uintptr_t spawnee_abi,
                uintptr_t spawnee_fn,
                uintptr_t args,
                size_t callsz);
-    void start_rustboot(uintptr_t exit_task_glue,
-                        uintptr_t spawnee_fn,
-                        uintptr_t args,
-                        size_t callsz);
-    void start_rustc(uintptr_t exit_task_glue,
-                     uintptr_t spawnee_fn,
-                     uintptr_t args,
-                     size_t callsz);
     void grow(size_t n_frame_bytes);
     bool running();
     bool blocked();
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 11dddce7346..a1569f07e45 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -578,7 +578,7 @@ upcall_start_task(rust_task *spawner,
              ", spawnee 0x%" PRIxPTR
              ", callsz %" PRIdPTR ")", task->name, task, exit_task_glue,
              spawnee_fn, callsz);
-    task->start(exit_task_glue, spawnee_abi, spawnee_fn,
+    task->start(exit_task_glue, spawnee_fn,
                 spawner->rust_sp, callsz);
     return task;
 }
@@ -642,7 +642,7 @@ upcall_start_thread(rust_task *task,
               ", callsz %" PRIdPTR ")",
               exit_task_glue, spawnee_fn, callsz);
     rust_task *child_task = child_task_handle->referent();
-    child_task->start(exit_task_glue, spawnee_abi, spawnee_fn,
+    child_task->start(exit_task_glue, 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 e0e24156e6f..1cde532e94a 100644
--- a/src/rt/test/rust_test_runtime.cpp
+++ b/src/rt/test/rust_test_runtime.cpp
@@ -54,7 +54,6 @@ rust_task_test::worker::run() {
         kernel->create_domain(crate, "test");
     rust_dom *domain = handle->referent();
     domain->root_task->start(crate->get_exit_task_glue(),
-                             ABI_X86_RUSTBOOT_CDECL,
                              (uintptr_t)&task_entry, (uintptr_t)NULL, 0);
     domain->start_main_loop();
     kernel->destroy_domain(domain);