src/hotspot/share/prims/jni.cpp
changeset 51996 84743156e780
parent 51554 5b0d86499960
child 52302 912b79d983d9
equal deleted inserted replaced
51995:f7babf9d1592 51996:84743156e780
  3777 }
  3777 }
  3778 
  3778 
  3779 void quicken_jni_functions() {
  3779 void quicken_jni_functions() {
  3780   // Replace Get<Primitive>Field with fast versions
  3780   // Replace Get<Primitive>Field with fast versions
  3781   if (UseFastJNIAccessors && !JvmtiExport::can_post_field_access()
  3781   if (UseFastJNIAccessors && !JvmtiExport::can_post_field_access()
  3782       && !VerifyJNIFields && !CountJNICalls && !CheckJNICalls
  3782       && !VerifyJNIFields && !CountJNICalls && !CheckJNICalls) {
  3783 #if defined(_WINDOWS) && defined(IA32) && defined(COMPILER2)
       
  3784       // windows x86 currently needs SEH wrapper and the gain of the fast
       
  3785       // versions currently isn't certain for server vm on uniprocessor.
       
  3786       && os::is_MP()
       
  3787 #endif
       
  3788   ) {
       
  3789     address func;
  3783     address func;
  3790     func = JNI_FastGetField::generate_fast_get_boolean_field();
  3784     func = JNI_FastGetField::generate_fast_get_boolean_field();
  3791     if (func != (address)-1) {
  3785     if (func != (address)-1) {
  3792       jni_NativeInterface.GetBooleanField = (GetBooleanField_t)func;
  3786       jni_NativeInterface.GetBooleanField = (GetBooleanField_t)func;
  3793     }
  3787     }
  3916   // Threads. We do an atomic compare and exchange to ensure only
  3910   // Threads. We do an atomic compare and exchange to ensure only
  3917   // one thread can call this method at a time
  3911   // one thread can call this method at a time
  3918 
  3912 
  3919   // We use Atomic::xchg rather than Atomic::add/dec since on some platforms
  3913   // We use Atomic::xchg rather than Atomic::add/dec since on some platforms
  3920   // the add/dec implementations are dependent on whether we are running
  3914   // the add/dec implementations are dependent on whether we are running
  3921   // on a multiprocessor, and at this stage of initialization the os::is_MP
  3915   // on a multiprocessor Atomic::xchg does not have this problem.
  3922   // function used to determine this will always return false. Atomic::xchg
       
  3923   // does not have this problem.
       
  3924   if (Atomic::xchg(1, &vm_created) == 1) {
  3916   if (Atomic::xchg(1, &vm_created) == 1) {
  3925     return JNI_EEXIST;   // already created, or create attempt in progress
  3917     return JNI_EEXIST;   // already created, or create attempt in progress
  3926   }
  3918   }
  3927   if (Atomic::xchg(0, &safe_to_recreate_vm) == 0) {
  3919   if (Atomic::xchg(0, &safe_to_recreate_vm) == 0) {
  3928     return JNI_ERR;  // someone tried and failed and retry not allowed.
  3920     return JNI_ERR;  // someone tried and failed and retry not allowed.