src/hotspot/share/prims/jni.cpp
changeset 54495 941db9c0b5b5
parent 54432 532e88de77eb
child 54669 ad45b3802d4e
equal deleted inserted replaced
54494:1bbce3048d20 54495:941db9c0b5b5
  3969     // functions in order to properly handle error conditions.
  3969     // functions in order to properly handle error conditions.
  3970     VMError::test_error_handler();
  3970     VMError::test_error_handler();
  3971 #endif
  3971 #endif
  3972 
  3972 
  3973     // Since this is not a JVM_ENTRY we have to set the thread state manually before leaving.
  3973     // Since this is not a JVM_ENTRY we have to set the thread state manually before leaving.
  3974     ThreadStateTransition::transition_and_fence(thread, _thread_in_vm, _thread_in_native);
  3974     ThreadStateTransition::transition(thread, _thread_in_vm, _thread_in_native);
  3975   } else {
  3975   } else {
  3976     // If create_vm exits because of a pending exception, exit with that
  3976     // If create_vm exits because of a pending exception, exit with that
  3977     // exception.  In the future when we figure out how to reclaim memory,
  3977     // exception.  In the future when we figure out how to reclaim memory,
  3978     // we may be able to exit with JNI_ERR and allow the calling application
  3978     // we may be able to exit with JNI_ERR and allow the calling application
  3979     // to continue.
  3979     // to continue.
  4071     // Should not change thread state, VM is gone
  4071     // Should not change thread state, VM is gone
  4072     vm_created = 0;
  4072     vm_created = 0;
  4073     res = JNI_OK;
  4073     res = JNI_OK;
  4074     return res;
  4074     return res;
  4075   } else {
  4075   } else {
  4076     ThreadStateTransition::transition_and_fence(thread, _thread_in_vm, _thread_in_native);
  4076     ThreadStateTransition::transition(thread, _thread_in_vm, _thread_in_native);
  4077     res = JNI_ERR;
  4077     res = JNI_ERR;
  4078     return res;
  4078     return res;
  4079   }
  4079   }
  4080 }
  4080 }
  4081 
  4081 
  4193   // Now leaving the VM, so change thread_state. This is normally automatically taken care
  4193   // Now leaving the VM, so change thread_state. This is normally automatically taken care
  4194   // of in the JVM_ENTRY. But in this situation we have to do it manually. Notice, that by
  4194   // of in the JVM_ENTRY. But in this situation we have to do it manually. Notice, that by
  4195   // using ThreadStateTransition::transition, we do a callback to the safepoint code if
  4195   // using ThreadStateTransition::transition, we do a callback to the safepoint code if
  4196   // needed.
  4196   // needed.
  4197 
  4197 
  4198   ThreadStateTransition::transition_and_fence(thread, _thread_in_vm, _thread_in_native);
  4198   ThreadStateTransition::transition(thread, _thread_in_vm, _thread_in_native);
  4199 
  4199 
  4200   // Perform any platform dependent FPU setup
  4200   // Perform any platform dependent FPU setup
  4201   os::setup_fpu();
  4201   os::setup_fpu();
  4202 
  4202 
  4203   return JNI_OK;
  4203   return JNI_OK;