5 // LLVM generates a call to this to allocate more stack space in a functiono
6 // prolog when we run out.
8 #if defined(__APPLE__) || defined(_WIN32)
9 #define RUST_NEW_STACK _rust_new_stack
10 #define RUST_DEL_STACK _rust_del_stack
11 #define MORESTACK ___morestack
13 #define RUST_NEW_STACK rust_new_stack
14 #define RUST_DEL_STACK rust_del_stack
15 #define MORESTACK __morestack
18 // Naturally, nobody can agree as to
19 // which arguments should go in which
37 // Hastily and probably incorrectly ported from i386 version.
38 // Actually this calling convention doens't make so much sense
40 mov %rcx, ARG0 // param 0: amount of space needed
41 mov %rdx, ARG2 // param 2: size of arguments
43 call rust_new_stack_sym
45 mov (%rsp),%rdx // Grab the return pointer.
46 inc %rdx // Skip past the `ret`.
47 mov %rax,%rsp // Switch to the new stack.
48 call *%rdx // Enter the new function.
50 // Now the function that called us has returned, so we need to delete the
52 call rust_new_stack_sym
53 mov %rax,%rsp // Switch back to the old stack.
56 // This is totally broken