49 assert(!HAS_PENDING_EXCEPTION, "call_stub called with pending exception"); |
49 assert(!HAS_PENDING_EXCEPTION, "call_stub called with pending exception"); |
50 |
50 |
51 // Set up the stack if necessary |
51 // Set up the stack if necessary |
52 bool stack_needs_teardown = false; |
52 bool stack_needs_teardown = false; |
53 if (stack->needs_setup()) { |
53 if (stack->needs_setup()) { |
54 size_t stack_used = thread->stack_base() - (address) &stack_used; |
54 size_t zero_stack_size = stack->suggest_size(thread); |
55 size_t stack_free = thread->stack_size() - stack_used; |
|
56 size_t zero_stack_size = align_size_down(stack_free / 2, wordSize); |
|
57 |
|
58 stack->setup(alloca(zero_stack_size), zero_stack_size); |
55 stack->setup(alloca(zero_stack_size), zero_stack_size); |
59 stack_needs_teardown = true; |
56 stack_needs_teardown = true; |
60 } |
57 } |
61 |
58 |
62 // Allocate and initialize our frame |
59 // Allocate and initialize our frame |