< prev index next >

src/hotspot/share/runtime/interfaceSupport.inline.hpp

Print this page

 67   static void deoptimizeAll();
 68   static void verify_stack();
 69   static void verify_last_frame();
 70 # endif
 71 };
 72 
 73 
 74 // Basic class for all thread transition classes.
 75 
 76 class ThreadStateTransition : public StackObj {
 77  protected:
 78   JavaThread* _thread;
 79 
 80  public:
 81   ThreadStateTransition(JavaThread *thread) : _thread(thread) {
 82     assert(thread != NULL, "must be active Java thread");
 83     assert(thread == Thread::current(), "must be current thread");
 84   }
 85 
 86   static inline void transition_from_java(JavaThread *thread, JavaThreadState to) {
 87     assert(thread->thread_state() == _thread_in_Java, "coming from wrong thread state");
 88     assert(to == _thread_in_vm || to == _thread_in_native, "invalid transition");
 89     thread->set_thread_state(to);
 90   }
 91 
 92   // We never install asynchronous exceptions when coming (back) in to the runtime
 93   // from native code because the runtime is not set up to handle exceptions floating
 94   // around at arbitrary points.
 95   static inline void transition_from_native(JavaThread *thread, JavaThreadState to, bool check_asyncs = true) {
 96     assert(thread->thread_state() == _thread_in_native, "coming from wrong thread state");
 97     assert(to == _thread_in_vm || to == _thread_in_Java, "invalid transition");
 98     assert(!thread->has_last_Java_frame() || thread->frame_anchor()->walkable(), "Unwalkable stack in native transition");
 99 
100     thread->set_thread_state_fence(_thread_in_vm);
101     SafepointMechanism::process_if_requested_with_exit_check(thread, to != _thread_in_Java ? false : check_asyncs);
102     thread->set_thread_state(to);
103   }
104 
105   static inline void transition_from_vm(JavaThread *thread, JavaThreadState to, bool check_asyncs = true) {
106     assert(thread->thread_state() == _thread_in_vm, "coming from wrong thread state");
107     if (to == _thread_in_Java) {

 67   static void deoptimizeAll();
 68   static void verify_stack();
 69   static void verify_last_frame();
 70 # endif
 71 };
 72 
 73 
 74 // Basic class for all thread transition classes.
 75 
 76 class ThreadStateTransition : public StackObj {
 77  protected:
 78   JavaThread* _thread;
 79 
 80  public:
 81   ThreadStateTransition(JavaThread *thread) : _thread(thread) {
 82     assert(thread != NULL, "must be active Java thread");
 83     assert(thread == Thread::current(), "must be current thread");
 84   }
 85 
 86   static inline void transition_from_java(JavaThread *thread, JavaThreadState to) {
 87     assert(thread->thread_state() == _thread_in_Java, "coming from wrong thread state: %s", thread->thread_state_name());
 88     assert(to == _thread_in_vm || to == _thread_in_native, "invalid transition");
 89     thread->set_thread_state(to);
 90   }
 91 
 92   // We never install asynchronous exceptions when coming (back) in to the runtime
 93   // from native code because the runtime is not set up to handle exceptions floating
 94   // around at arbitrary points.
 95   static inline void transition_from_native(JavaThread *thread, JavaThreadState to, bool check_asyncs = true) {
 96     assert(thread->thread_state() == _thread_in_native, "coming from wrong thread state");
 97     assert(to == _thread_in_vm || to == _thread_in_Java, "invalid transition");
 98     assert(!thread->has_last_Java_frame() || thread->frame_anchor()->walkable(), "Unwalkable stack in native transition");
 99 
100     thread->set_thread_state_fence(_thread_in_vm);
101     SafepointMechanism::process_if_requested_with_exit_check(thread, to != _thread_in_Java ? false : check_asyncs);
102     thread->set_thread_state(to);
103   }
104 
105   static inline void transition_from_vm(JavaThread *thread, JavaThreadState to, bool check_asyncs = true) {
106     assert(thread->thread_state() == _thread_in_vm, "coming from wrong thread state");
107     if (to == _thread_in_Java) {
< prev index next >