Mercurial > hg > truffle
comparison src/share/vm/runtime/thread.hpp @ 4873:0382d2b469b2
7013347: allow crypto functions to be called inline to enhance performance
Reviewed-by: kvn
author | never |
---|---|
date | Wed, 01 Feb 2012 16:57:08 -0800 |
parents | 1a2723f7ad8e |
children | 33df1aeaebbf 541c4a5e7b88 |
comparison
equal
deleted
inserted
replaced
4872:aa3d708d67c4 | 4873:0382d2b469b2 |
---|---|
180 | 180 |
181 _external_suspend = 0x20000000U, // thread is asked to self suspend | 181 _external_suspend = 0x20000000U, // thread is asked to self suspend |
182 _ext_suspended = 0x40000000U, // thread has self-suspended | 182 _ext_suspended = 0x40000000U, // thread has self-suspended |
183 _deopt_suspend = 0x10000000U, // thread needs to self suspend for deopt | 183 _deopt_suspend = 0x10000000U, // thread needs to self suspend for deopt |
184 | 184 |
185 _has_async_exception = 0x00000001U // there is a pending async exception | 185 _has_async_exception = 0x00000001U, // there is a pending async exception |
186 _critical_native_unlock = 0x00000002U // Must call back to unlock JNI critical lock | |
186 }; | 187 }; |
187 | 188 |
188 // various suspension related flags - atomically updated | 189 // various suspension related flags - atomically updated |
189 // overloaded for async exception checking in check_special_condition_for_native_trans. | 190 // overloaded for async exception checking in check_special_condition_for_native_trans. |
190 volatile uint32_t _suspend_flags; | 191 volatile uint32_t _suspend_flags; |
346 void set_has_async_exception() { | 347 void set_has_async_exception() { |
347 set_suspend_flag(_has_async_exception); | 348 set_suspend_flag(_has_async_exception); |
348 } | 349 } |
349 void clear_has_async_exception() { | 350 void clear_has_async_exception() { |
350 clear_suspend_flag(_has_async_exception); | 351 clear_suspend_flag(_has_async_exception); |
352 } | |
353 | |
354 bool do_critical_native_unlock() const { return (_suspend_flags & _critical_native_unlock) != 0; } | |
355 | |
356 void set_critical_native_unlock() { | |
357 set_suspend_flag(_critical_native_unlock); | |
358 } | |
359 void clear_critical_native_unlock() { | |
360 clear_suspend_flag(_critical_native_unlock); | |
351 } | 361 } |
352 | 362 |
353 // Support for Unhandled Oop detection | 363 // Support for Unhandled Oop detection |
354 #ifdef CHECK_UNHANDLED_OOPS | 364 #ifdef CHECK_UNHANDLED_OOPS |
355 private: | 365 private: |
1036 } | 1046 } |
1037 static void check_safepoint_and_suspend_for_native_trans(JavaThread *thread); | 1047 static void check_safepoint_and_suspend_for_native_trans(JavaThread *thread); |
1038 // Check for async exception in addition to safepoint and suspend request. | 1048 // Check for async exception in addition to safepoint and suspend request. |
1039 static void check_special_condition_for_native_trans(JavaThread *thread); | 1049 static void check_special_condition_for_native_trans(JavaThread *thread); |
1040 | 1050 |
1051 // Same as check_special_condition_for_native_trans but finishes the | |
1052 // transition into thread_in_Java mode so that it can potentially | |
1053 // block. | |
1054 static void check_special_condition_for_native_trans_and_transition(JavaThread *thread); | |
1055 | |
1041 bool is_ext_suspend_completed(bool called_by_wait, int delay, uint32_t *bits); | 1056 bool is_ext_suspend_completed(bool called_by_wait, int delay, uint32_t *bits); |
1042 bool is_ext_suspend_completed_with_lock(uint32_t *bits) { | 1057 bool is_ext_suspend_completed_with_lock(uint32_t *bits) { |
1043 MutexLockerEx ml(SR_lock(), Mutex::_no_safepoint_check_flag); | 1058 MutexLockerEx ml(SR_lock(), Mutex::_no_safepoint_check_flag); |
1044 // Warning: is_ext_suspend_completed() may temporarily drop the | 1059 // Warning: is_ext_suspend_completed() may temporarily drop the |
1045 // SR_lock to allow the thread to reach a stable thread state if | 1060 // SR_lock to allow the thread to reach a stable thread state if |
1309 } | 1324 } |
1310 | 1325 |
1311 // JNI critical regions. These can nest. | 1326 // JNI critical regions. These can nest. |
1312 bool in_critical() { return _jni_active_critical > 0; } | 1327 bool in_critical() { return _jni_active_critical > 0; } |
1313 bool in_last_critical() { return _jni_active_critical == 1; } | 1328 bool in_last_critical() { return _jni_active_critical == 1; } |
1314 void enter_critical() { assert(Thread::current() == this, | 1329 void enter_critical() { assert(Thread::current() == this || |
1315 "this must be current thread"); | 1330 Thread::current()->is_VM_thread() && SafepointSynchronize::is_synchronizing(), |
1331 "this must be current thread or synchronizing"); | |
1316 _jni_active_critical++; } | 1332 _jni_active_critical++; } |
1317 void exit_critical() { assert(Thread::current() == this, | 1333 void exit_critical() { assert(Thread::current() == this, |
1318 "this must be current thread"); | 1334 "this must be current thread"); |
1319 _jni_active_critical--; | 1335 _jni_active_critical--; |
1320 assert(_jni_active_critical >= 0, | 1336 assert(_jni_active_critical >= 0, |