369 |
369 |
370 // Make the call |
370 // Make the call |
371 intptr_t result[4 - LogBytesPerWord]; |
371 intptr_t result[4 - LogBytesPerWord]; |
372 ffi_call(handler->cif(), (void (*)()) function, result, arguments); |
372 ffi_call(handler->cif(), (void (*)()) function, result, arguments); |
373 |
373 |
374 // Change the thread state back to _thread_in_Java. |
374 // Change the thread state back to _thread_in_Java and ensure it |
|
375 // is seen by the GC thread. |
375 // ThreadStateTransition::transition_from_native() cannot be used |
376 // ThreadStateTransition::transition_from_native() cannot be used |
376 // here because it does not check for asynchronous exceptions. |
377 // here because it does not check for asynchronous exceptions. |
377 // We have to manage the transition ourself. |
378 // We have to manage the transition ourself. |
378 thread->set_thread_state(_thread_in_native_trans); |
379 thread->set_thread_state_fence(_thread_in_native_trans); |
379 |
|
380 // Make sure new state is visible in the GC thread |
|
381 InterfaceSupport::serialize_thread_state(thread); |
|
382 |
380 |
383 // Handle safepoint operations, pending suspend requests, |
381 // Handle safepoint operations, pending suspend requests, |
384 // and pending asynchronous exceptions. |
382 // and pending asynchronous exceptions. |
385 if (SafepointMechanism::should_block(thread) || |
383 if (SafepointMechanism::should_block(thread) || |
386 thread->has_special_condition_for_native_trans()) { |
384 thread->has_special_condition_for_native_trans()) { |