Mercurial > hg > release > icedtea6-1.4.1
changeset 1332:eb8b5c5aa4db
2009-01-22 Gary Benson <gbenson@redhat.com>
* ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp:
(CppInterpreter::native_entry): Correctly handle asynchronous
exceptions during post-call thread state transition.
author | Gary Benson <gbenson@redhat.com> |
---|---|
date | Thu, 22 Jan 2009 14:27:41 -0500 |
parents | c29bbfa41f2b |
children | 6c02b699206d |
files | ChangeLog ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp |
diffstat | 2 files changed, 38 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Jan 22 14:18:45 2009 -0500 +++ b/ChangeLog Thu Jan 22 14:27:41 2009 -0500 @@ -1,5 +1,11 @@ +2009-01-22 Gary Benson <gbenson@redhat.com> + + * ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp: + (CppInterpreter::native_entry): Correctly handle asynchronous + exceptions during post-call thread state transition. + 2009-01-22 Omair Majid <omajid@redhat.com> - Ioana Ivan <iivan@redhat.com> + Ioana Ivan <iivan@redhat.com> * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java (start): Return silently if already started.
--- a/ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Thu Jan 22 14:18:45 2009 -0500 +++ b/ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Thu Jan 22 14:27:41 2009 -0500 @@ -292,15 +292,43 @@ // Set up the Java frame anchor thread->set_last_Java_frame(); - // Change the thread state to native + // Change the thread state to _thread_in_native ThreadStateTransition::transition_from_java(thread, _thread_in_native); // Make the call intptr_t result[4 - LogBytesPerWord]; ffi_call(handler->cif(), (void (*)()) function, result, arguments); - // Change the thread state back to Java - ThreadStateTransition::transition_from_native(thread, _thread_in_Java); + // Change the thread state back to _thread_in_Java. + // ThreadStateTransition::transition_from_native() cannot be used + // here because it does not check for asynchronous exceptions. + // We have to manage the transition ourself. + thread->set_thread_state(_thread_in_native_trans); + + // Make sure new state is visible in the GC thread + if (os::is_MP()) { + if (UseMembar) { + OrderAccess::fence(); + } + else { + InterfaceSupport::serialize_memory(thread); + } + } + + // 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) { + JavaThread::check_special_condition_for_native_trans(thread); + CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops()); + } + + // Finally we can change the thread state to _thread_in_Java. + thread->set_thread_state(_thread_in_Java); fixup_after_potential_safepoint(); // Clear the frame anchor