rt: Remove check_stack_alignment

This function does not do what it tries to do and it is expensive
This commit is contained in:
Brian Anderson 2012-06-07 01:44:09 -07:00
parent d8c16df153
commit 89483b0b83
3 changed files with 0 additions and 34 deletions

View File

@ -4,18 +4,15 @@
#define RECORD_SP_LIMIT _record_sp_limit
#define GET_SP_LIMIT _get_sp_limit
#define GET_SP _get_sp
#define CHECK_STACK _check_stack_alignment
#else
#define RECORD_SP_LIMIT record_sp_limit
#define GET_SP_LIMIT get_sp_limit
#define GET_SP get_sp
#define CHECK_STACK check_stack_alignment
#endif
.globl RECORD_SP_LIMIT
.globl GET_SP_LIMIT
.globl GET_SP
.globl CHECK_STACK
#if defined(__linux__) || defined(__FreeBSD__)
RECORD_SP_LIMIT:
@ -61,10 +58,3 @@ GET_SP_LIMIT:
GET_SP:
movl %esp, %eax
ret
// This will segfault if not called on a 16-byte boundary
CHECK_STACK:
subl $28, %esp
movaps %xmm0, (%esp)
addl $28, %esp
ret

View File

@ -4,18 +4,15 @@
#define RECORD_SP_LIMIT _record_sp_limit
#define GET_SP_LIMIT _get_sp_limit
#define GET_SP _get_sp
#define CHECK_STACK _check_stack_alignment
#else
#define RECORD_SP_LIMIT record_sp_limit
#define GET_SP_LIMIT get_sp_limit
#define GET_SP get_sp
#define CHECK_STACK check_stack_alignment
#endif
.globl RECORD_SP_LIMIT
.globl GET_SP_LIMIT
.globl GET_SP
.globl CHECK_STACK
#if defined(__linux__)
RECORD_SP_LIMIT:
@ -53,10 +50,3 @@ GET_SP_LIMIT:
GET_SP:
movq %rsp, %rax
ret
// This will segfault if not called on a 16-byte boundary
CHECK_STACK:
subq $24, %rsp
movaps %xmm0, (%rsp)
addq $24, %rsp
ret

View File

@ -28,24 +28,10 @@
(task)->name, (task));
#endif
// This is called to ensure we've set up our rust stacks
// correctly. Strategically placed at entry to upcalls because they begin on
// the rust stack and happen frequently enough to catch most stack changes,
// including at the beginning of all landing pads.
// FIXME: Enable this for windows
#if (defined __linux__ || defined __APPLE__ || defined __FreeBSD__) \
&& (defined(GCC_VERSION) && GCC_VERSION > 40300)
extern "C" void
check_stack_alignment() __attribute__ ((aligned (16)));
#else
static void check_stack_alignment() { }
#endif
#define UPCALL_SWITCH_STACK(A, F) call_upcall_on_c_stack((void*)A, (void*)F)
inline void
call_upcall_on_c_stack(void *args, void *fn_ptr) {
check_stack_alignment();
rust_task *task = rust_get_current_task();
task->call_on_c_stack(args, fn_ptr);
}