Mercurial > hg > graal-jvmci-8
comparison src/cpu/zero/vm/stack_zero.inline.hpp @ 22852:c6affd32651a
8064815: Zero+PPC64: Stack overflow when running Maven
Reviewed-by: kvn, simonis
Contributed-by: sgehwolf@redhat.com
author | simonis |
---|---|
date | Tue, 18 Nov 2014 19:17:16 +0100 |
parents | f95d63e2154a |
children |
comparison
equal
deleted
inserted
replaced
22851:ddce0b7cee93 | 22852:c6affd32651a |
---|---|
46 | 46 |
47 // This method returns the amount of ABI stack available for us | 47 // This method returns the amount of ABI stack available for us |
48 // to use under normal circumstances. Note that the returned | 48 // to use under normal circumstances. Note that the returned |
49 // value can be negative. | 49 // value can be negative. |
50 inline int ZeroStack::abi_stack_available(Thread *thread) const { | 50 inline int ZeroStack::abi_stack_available(Thread *thread) const { |
51 int stack_used = thread->stack_base() - (address) &stack_used; | 51 guarantee(Thread::current() == thread, "should run in the same thread"); |
52 int stack_used = thread->stack_base() - (address) &stack_used | |
53 + (StackYellowPages+StackRedPages+StackShadowPages) * os::vm_page_size(); | |
52 int stack_free = thread->stack_size() - stack_used; | 54 int stack_free = thread->stack_size() - stack_used; |
53 return stack_free - shadow_pages_size(); | 55 return stack_free; |
54 } | 56 } |
55 | 57 |
56 #endif // CPU_ZERO_VM_STACK_ZERO_INLINE_HPP | 58 #endif // CPU_ZERO_VM_STACK_ZERO_INLINE_HPP |