< prev index next >

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

Print this page
rev 50896 : 8206003: SafepointSynchronize with TLH: StoreStore barriers should be moved out of the loop
Reviewed-by: eosterlund, rehn, dholmes


 153   if (_stack_guard_state == stack_guard_unused) {
 154     low_addr = stack_end();
 155   } else {
 156     low_addr = stack_reserved_zone_base();
 157   }
 158   return cur_sp > low_addr ? cur_sp - low_addr : 0;
 159 }
 160 
 161 inline bool JavaThread::stack_guards_enabled() {
 162 #ifdef ASSERT
 163   if (os::uses_stack_guard_pages() &&
 164       !(DisablePrimordialThreadGuardPages && os::is_primordial_thread())) {
 165     assert(_stack_guard_state != stack_guard_unused, "guard pages must be in use");
 166   }
 167 #endif
 168   return _stack_guard_state == stack_guard_enabled;
 169 }
 170 
 171 // The release make sure this store is done after storing the handshake
 172 // operation or global state
 173 inline void JavaThread::set_polling_page(void* poll_value) {
 174   OrderAccess::release_store(polling_page_addr(), poll_value);





 175 }
 176 
 177 // The aqcquire make sure reading of polling page is done before
 178 // the reading the handshake operation or the global state
 179 inline volatile void* JavaThread::get_polling_page() {
 180   return OrderAccess::load_acquire(polling_page_addr());
 181 }
 182 
 183 inline bool JavaThread::is_exiting() const {
 184   // Use load-acquire so that setting of _terminated by
 185   // JavaThread::exit() is seen more quickly.
 186   TerminatedTypes l_terminated = (TerminatedTypes)
 187       OrderAccess::load_acquire((volatile jint *) &_terminated);
 188   return l_terminated == _thread_exiting || check_is_terminated(l_terminated);
 189 }
 190 
 191 inline bool JavaThread::is_terminated() const {
 192   // Use load-acquire so that setting of _terminated by
 193   // JavaThread::exit() is seen more quickly.
 194   TerminatedTypes l_terminated = (TerminatedTypes)


 153   if (_stack_guard_state == stack_guard_unused) {
 154     low_addr = stack_end();
 155   } else {
 156     low_addr = stack_reserved_zone_base();
 157   }
 158   return cur_sp > low_addr ? cur_sp - low_addr : 0;
 159 }
 160 
 161 inline bool JavaThread::stack_guards_enabled() {
 162 #ifdef ASSERT
 163   if (os::uses_stack_guard_pages() &&
 164       !(DisablePrimordialThreadGuardPages && os::is_primordial_thread())) {
 165     assert(_stack_guard_state != stack_guard_unused, "guard pages must be in use");
 166   }
 167 #endif
 168   return _stack_guard_state == stack_guard_enabled;
 169 }
 170 
 171 // The release make sure this store is done after storing the handshake
 172 // operation or global state
 173 inline void JavaThread::set_polling_page_release(void* poll_value) {
 174   OrderAccess::release_store(polling_page_addr(), poll_value);
 175 }
 176 
 177 // Caller is responsible for using a memory barrier if needed.
 178 inline void JavaThread::set_polling_page(void* poll_value) {
 179   *polling_page_addr() = poll_value;
 180 }
 181 
 182 // The aqcquire make sure reading of polling page is done before
 183 // the reading the handshake operation or the global state
 184 inline volatile void* JavaThread::get_polling_page() {
 185   return OrderAccess::load_acquire(polling_page_addr());
 186 }
 187 
 188 inline bool JavaThread::is_exiting() const {
 189   // Use load-acquire so that setting of _terminated by
 190   // JavaThread::exit() is seen more quickly.
 191   TerminatedTypes l_terminated = (TerminatedTypes)
 192       OrderAccess::load_acquire((volatile jint *) &_terminated);
 193   return l_terminated == _thread_exiting || check_is_terminated(l_terminated);
 194 }
 195 
 196 inline bool JavaThread::is_terminated() const {
 197   // Use load-acquire so that setting of _terminated by
 198   // JavaThread::exit() is seen more quickly.
 199   TerminatedTypes l_terminated = (TerminatedTypes)
< prev index next >