< prev index next >
src/hotspot/share/runtime/thread.cpp
Print this page
*** 1016,1040 ****
InterfaceSupport::check_gc_alot();
}
}
#endif // ASSERT
bool Thread::is_in_stack(address adr) const {
assert(Thread::current() == this, "is_in_stack can only be called from current thread");
address end = os::current_stack_pointer();
! // Allow non Java threads to call this without stack_base
! if (_stack_base == NULL) return true;
! if (stack_base() > adr && adr >= end) return true;
!
! return false;
}
bool Thread::is_in_usable_stack(address adr) const {
size_t stack_guard_size = os::uses_stack_guard_pages() ? JavaThread::stack_guard_zone_size() : 0;
size_t usable_stack_size = _stack_size - stack_guard_size;
! return ((adr < stack_base()) && (adr >= stack_base() - usable_stack_size));
}
// We had to move these methods here, because vm threads get into ObjectSynchronizer::enter
// However, there is a note in JavaThread::is_lock_owned() about the VM threads not being
--- 1016,1038 ----
InterfaceSupport::check_gc_alot();
}
}
#endif // ASSERT
+ // Check for adr in the live portion of our stack.
bool Thread::is_in_stack(address adr) const {
assert(Thread::current() == this, "is_in_stack can only be called from current thread");
address end = os::current_stack_pointer();
! return (stack_base() > adr && adr >= end);
}
+ // Check for adr in the usable portion of our stack.
bool Thread::is_in_usable_stack(address adr) const {
size_t stack_guard_size = os::uses_stack_guard_pages() ? JavaThread::stack_guard_zone_size() : 0;
size_t usable_stack_size = _stack_size - stack_guard_size;
! return ((stack_base() > adr) && (adr >= (stack_base() - usable_stack_size)));
}
// We had to move these methods here, because vm threads get into ObjectSynchronizer::enter
// However, there is a note in JavaThread::is_lock_owned() about the VM threads not being
< prev index next >