8349977: JVMCIRuntime::_shared_library_javavm_id should be jlong

Reviewed-by: yzheng, never
This commit is contained in:
Doug Simon 2025-02-13 19:35:42 +00:00
parent 2eac490bd2
commit a88e2a58bf
3 changed files with 7 additions and 7 deletions

View File

@ -2724,7 +2724,7 @@ C2V_VMENTRY_PREFIX(jboolean, attachCurrentThread, (JNIEnv* env, jobject c2vm, jb
if (res == JNI_OK) {
guarantee(peerJNIEnv != nullptr, "must be");
runtime->init_JavaVM_info(javaVM_info, JVMCI_CHECK_0);
JVMCI_event_1("attached to JavaVM[%d] for JVMCI runtime %d", runtime->get_shared_library_javavm_id(), runtime->id());
JVMCI_event_1("attached to JavaVM[" JLONG_FORMAT "] for JVMCI runtime %d", runtime->get_shared_library_javavm_id(), runtime->id());
return true;
}
JVMCI_THROW_MSG_0(InternalError, err_msg("Error %d while attaching %s", res, attach_args.name));
@ -2757,7 +2757,7 @@ C2V_VMENTRY_PREFIX(jboolean, detachCurrentThread, (JNIEnv* env, jobject c2vm, jb
if (res != JNI_OK) {
JVMCI_THROW_MSG_0(InternalError, err_msg("Error %d while attaching %s", res, thread->name()));
}
JVMCI_event_1("detached from JavaVM[%d] for JVMCI runtime %d",
JVMCI_event_1("detached from JavaVM[" JLONG_FORMAT "] for JVMCI runtime %d",
runtime->get_shared_library_javavm_id(), runtime->id());
if (release) {
return runtime->detach_thread(thread, "user thread detach");

View File

@ -1569,7 +1569,7 @@ bool JVMCIRuntime::destroy_shared_library_javavm() {
guarantee(_num_attached_threads == cannot_be_attached,
"cannot destroy JavaVM for JVMCI runtime %d with %d attached threads", _id, _num_attached_threads);
JavaVM* javaVM;
int javaVM_id = _shared_library_javavm_id;
jlong javaVM_id = _shared_library_javavm_id;
{
// Exactly one thread can destroy the JavaVM
// and release the handle to it.
@ -1588,9 +1588,9 @@ bool JVMCIRuntime::destroy_shared_library_javavm() {
result = javaVM->DestroyJavaVM();
}
if (result == JNI_OK) {
JVMCI_event_1("destroyed JavaVM[%d]@" PTR_FORMAT " for JVMCI runtime %d", javaVM_id, p2i(javaVM), _id);
JVMCI_event_1("destroyed JavaVM[" JLONG_FORMAT "]@" PTR_FORMAT " for JVMCI runtime %d", javaVM_id, p2i(javaVM), _id);
} else {
warning("Non-zero result (%d) when calling JNI_DestroyJavaVM on JavaVM[%d]@" PTR_FORMAT, result, javaVM_id, p2i(javaVM));
warning("Non-zero result (%d) when calling JNI_DestroyJavaVM on JavaVM[" JLONG_FORMAT "]@" PTR_FORMAT, result, javaVM_id, p2i(javaVM));
}
return true;
}

View File

@ -183,7 +183,7 @@ class JVMCIRuntime: public CHeapObj<mtJVMCI> {
JavaVM* _shared_library_javavm;
// Id for _shared_library_javavm.
int _shared_library_javavm_id;
jlong _shared_library_javavm_id;
// Position and link in global list of JVMCI shared library runtimes.
// The HotSpot heap based runtime will have an id of -1 and the
@ -280,7 +280,7 @@ class JVMCIRuntime: public CHeapObj<mtJVMCI> {
bool has_shared_library_javavm() { return _shared_library_javavm != nullptr; }
// Gets an ID for the JVMCI shared library JavaVM associated with this runtime.
int get_shared_library_javavm_id() { return _shared_library_javavm_id; }
jlong get_shared_library_javavm_id() { return _shared_library_javavm_id; }
// Copies info about the JVMCI shared library JavaVM associated with this
// runtime into `info` as follows: