7013347: allow crypto functions to be called inline to enhance performance

Reviewed-by: kvn
This commit is contained in:
Tom Rodriguez 2012-02-01 16:57:08 -08:00
parent 5a41427b37
commit 9599296d97
21 changed files with 1376 additions and 167 deletions

View file

@ -182,7 +182,8 @@ class Thread: public ThreadShadow {
_ext_suspended = 0x40000000U, // thread has self-suspended
_deopt_suspend = 0x10000000U, // thread needs to self suspend for deopt
_has_async_exception = 0x00000001U // there is a pending async exception
_has_async_exception = 0x00000001U, // there is a pending async exception
_critical_native_unlock = 0x00000002U // Must call back to unlock JNI critical lock
};
// various suspension related flags - atomically updated
@ -350,6 +351,15 @@ class Thread: public ThreadShadow {
clear_suspend_flag(_has_async_exception);
}
bool do_critical_native_unlock() const { return (_suspend_flags & _critical_native_unlock) != 0; }
void set_critical_native_unlock() {
set_suspend_flag(_critical_native_unlock);
}
void clear_critical_native_unlock() {
clear_suspend_flag(_critical_native_unlock);
}
// Support for Unhandled Oop detection
#ifdef CHECK_UNHANDLED_OOPS
private:
@ -1038,6 +1048,11 @@ class JavaThread: public Thread {
// Check for async exception in addition to safepoint and suspend request.
static void check_special_condition_for_native_trans(JavaThread *thread);
// Same as check_special_condition_for_native_trans but finishes the
// transition into thread_in_Java mode so that it can potentially
// block.
static void check_special_condition_for_native_trans_and_transition(JavaThread *thread);
bool is_ext_suspend_completed(bool called_by_wait, int delay, uint32_t *bits);
bool is_ext_suspend_completed_with_lock(uint32_t *bits) {
MutexLockerEx ml(SR_lock(), Mutex::_no_safepoint_check_flag);
@ -1311,8 +1326,9 @@ class JavaThread: public Thread {
// JNI critical regions. These can nest.
bool in_critical() { return _jni_active_critical > 0; }
bool in_last_critical() { return _jni_active_critical == 1; }
void enter_critical() { assert(Thread::current() == this,
"this must be current thread");
void enter_critical() { assert(Thread::current() == this ||
Thread::current()->is_VM_thread() && SafepointSynchronize::is_synchronizing(),
"this must be current thread or synchronizing");
_jni_active_critical++; }
void exit_critical() { assert(Thread::current() == this,
"this must be current thread");