# HG changeset patch # User Gary Benson # Date 1232976975 18000 # Node ID 2b1c03c1e9fa88e453da2ca774dc8900227a2e16 # Parent fed3590e18e73badb6b61d6ebbdeee1f4819d4cd 2009-01-26 Gary Benson * ports/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp (JavaThread::has_special_condition_for_native_trans): New method. * ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp: (CppInterpreter::native_entry): Correctly handle safepoints during post-call thread state transition. diff -r fed3590e18e7 -r 2b1c03c1e9fa ChangeLog --- a/ChangeLog Thu Jan 22 15:06:43 2009 -0500 +++ b/ChangeLog Mon Jan 26 08:36:15 2009 -0500 @@ -1,3 +1,11 @@ +2009-01-26 Gary Benson + + * ports/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp + (JavaThread::has_special_condition_for_native_trans): New method. + * ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp: + (CppInterpreter::native_entry): Correctly handle safepoints + during post-call thread state transition. + 2009-01-22 Gary Benson * ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp: diff -r fed3590e18e7 -r 2b1c03c1e9fa ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Thu Jan 22 15:06:43 2009 -0500 +++ b/ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Mon Jan 26 08:36:15 2009 -0500 @@ -315,14 +315,10 @@ } } - // We need to call check_special_condition_for_native_trans() if - // any of the thread's suspend flags are set. We can't use the - // various accessors because thread->_suspend_flags is volatile - // and may change while we're reading it. - volatile uint32_t *suspend_flags; - suspend_flags = (uint32_t *) - ((address) thread + in_bytes(JavaThread::suspend_flags_offset())); - if (*suspend_flags != 0) { + // Handle safepoint operations, pending suspend requests, + // and pending asynchronous exceptions. + if (SafepointSynchronize::do_call_back() || + thread->has_special_condition_for_native_trans()) { JavaThread::check_special_condition_for_native_trans(thread); CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops()); } diff -r fed3590e18e7 -r 2b1c03c1e9fa ports/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp --- a/ports/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp Thu Jan 22 15:06:43 2009 -0500 +++ b/ports/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp Mon Jan 26 08:36:15 2009 -0500 @@ -95,6 +95,15 @@ } public: + // Check for pending suspend requests and pending asynchronous + // exceptions. There are separate accessors for these, but + // _suspend_flags is volatile so using them would be unsafe. + bool has_special_condition_for_native_trans() + { + return _suspend_flags != 0; + } + + public: bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava)