hotspot/src/share/vm/runtime/thread.hpp
changeset 22870 f939d9a0440d
parent 22859 7b88983393b7
child 22876 57aa8995d43b
equal deleted inserted replaced
22869:d479c1cebc3e 22870:f939d9a0440d
  1031   // Allocates a new Java level thread object for this thread. thread_name may be NULL.
  1031   // Allocates a new Java level thread object for this thread. thread_name may be NULL.
  1032   void allocate_threadObj(Handle thread_group, char* thread_name, bool daemon, TRAPS);
  1032   void allocate_threadObj(Handle thread_group, char* thread_name, bool daemon, TRAPS);
  1033 
  1033 
  1034   // Last frame anchor routines
  1034   // Last frame anchor routines
  1035 
  1035 
  1036   JavaFrameAnchor* frame_anchor(void)                { return &_anchor; }
  1036   JavaFrameAnchor* frame_anchor(void)            { return &_anchor; }
  1037 
  1037 
  1038   // last_Java_sp
  1038   // last_Java_sp
  1039   bool has_last_Java_frame() const                   { return _anchor.has_last_Java_frame(); }
  1039   bool has_last_Java_frame() const               { return _anchor.has_last_Java_frame(); }
  1040   intptr_t* last_Java_sp() const                     { return _anchor.last_Java_sp(); }
  1040   intptr_t* last_Java_sp() const                 { return _anchor.last_Java_sp(); }
  1041 
  1041 
  1042   // last_Java_pc
  1042   // last_Java_pc
  1043 
  1043 
  1044   address last_Java_pc(void)                         { return _anchor.last_Java_pc(); }
  1044   address last_Java_pc(void)                     { return _anchor.last_Java_pc(); }
  1045 
  1045 
  1046   // Safepoint support
  1046   // Safepoint support
       
  1047 #ifndef PPC64
       
  1048   JavaThreadState thread_state() const           { return _thread_state; }
       
  1049   void set_thread_state(JavaThreadState s)       { _thread_state = s;    }
       
  1050 #else
  1047   // Use membars when accessing volatile _thread_state. See
  1051   // Use membars when accessing volatile _thread_state. See
  1048   // Threads::create_vm() for size checks.
  1052   // Threads::create_vm() for size checks.
  1049   JavaThreadState thread_state() const           {
  1053   JavaThreadState thread_state() const           {
  1050     return (JavaThreadState) OrderAccess::load_acquire((volatile jint*)&_thread_state);
  1054     return (JavaThreadState) OrderAccess::load_acquire((volatile jint*)&_thread_state);
  1051   }
  1055   }
  1052   void set_thread_state(JavaThreadState s)       {
  1056   void set_thread_state(JavaThreadState s)       {
  1053     OrderAccess::release_store((volatile jint*)&_thread_state, (jint)s);
  1057     OrderAccess::release_store((volatile jint*)&_thread_state, (jint)s);
  1054   }
  1058   }
  1055   ThreadSafepointState *safepoint_state() const  { return _safepoint_state;  }
  1059 #endif
       
  1060   ThreadSafepointState *safepoint_state() const  { return _safepoint_state; }
  1056   void set_safepoint_state(ThreadSafepointState *state) { _safepoint_state = state; }
  1061   void set_safepoint_state(ThreadSafepointState *state) { _safepoint_state = state; }
  1057   bool is_at_poll_safepoint()                    { return _safepoint_state->is_at_poll_safepoint(); }
  1062   bool is_at_poll_safepoint()                    { return _safepoint_state->is_at_poll_safepoint(); }
  1058 
  1063 
  1059   // thread has called JavaThread::exit() or is terminated
  1064   // thread has called JavaThread::exit() or is terminated
  1060   bool is_exiting()                              { return _terminated == _thread_exiting || is_terminated(); }
  1065   bool is_exiting()                              { return _terminated == _thread_exiting || is_terminated(); }