Skip to content

Commit

Permalink
auto merge of #10161 : brson/rust/upcall, r=alexcrichton
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Oct 30, 2013
2 parents e4938aa + 24a69dd commit cd1661d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 45 deletions.
41 changes: 0 additions & 41 deletions src/rt/rust_upcall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,6 @@ typedef int _Unwind_Action;
struct _Unwind_Context;
struct _Unwind_Exception;

typedef void (*CDECL stack_switch_shim)(void*);

/**********************************************************************
* Switches to the C-stack and invokes |fn_ptr|, passing |args| as argument.
* This is used by the C compiler to call foreign functions and by other
* upcalls to switch to the C stack. The return value is passed through a
* field in the args parameter. This upcall is specifically for switching
* to the shim functions generated by rustc.
*/
extern "C" CDECL void
upcall_call_shim_on_c_stack(void *args, void *fn_ptr) {
stack_switch_shim f = (stack_switch_shim)fn_ptr;
f(args);
}

/*
* The opposite of above. Starts on a C stack and switches to the Rust
* stack. This is the only upcall that runs from the C stack.
*/
extern "C" CDECL void
upcall_call_shim_on_rust_stack(void *args, void *fn_ptr) {
// There's no task. Call the function and hope for the best
stack_switch_shim f = (stack_switch_shim)fn_ptr;
f(args);
}

/**********************************************************************/

#ifdef __SEH__
# define PERSONALITY_FUNC __gxx_personality_seh0
#else
Expand Down Expand Up @@ -107,19 +79,6 @@ upcall_rust_personality(int version,
return args.retval;
}

// NB: This needs to be blazing fast. Don't switch stacks
extern "C" CDECL void *
upcall_new_stack(size_t stk_sz, void *args_addr, size_t args_sz) {
assert(false && "newsched shouldn't be growing the stack");
return NULL;
}

// NB: This needs to be blazing fast. Don't switch stacks
extern "C" CDECL void
upcall_del_stack() {
assert(false && "newsched shouldn't be growing the stack");
}

// Landing pads need to call this to insert the
// correct limit into TLS.
// NB: This must run on the Rust stack because it
Expand Down
4 changes: 0 additions & 4 deletions src/rt/rustrt.def.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ rust_win32_rand_acquire
rust_win32_rand_gen
rust_win32_rand_release
upcall_rust_personality
upcall_call_shim_on_c_stack
upcall_call_shim_on_rust_stack
upcall_new_stack
upcall_del_stack
upcall_reset_stack_limit
rust_uv_loop_new
rust_uv_loop_delete
Expand Down

0 comments on commit cd1661d

Please sign in to comment.