8286176: Add JNI_VERSION_19 to jni.h and JNI spec
Reviewed-by: dcubed, iris, mchung, dholmes
This commit is contained in:
parent
c254c9d095
commit
53bf1bfdab
@ -99,7 +99,7 @@
|
||||
#include "jvmci/jvmciCompiler.hpp"
|
||||
#endif
|
||||
|
||||
static jint CurrentVersion = JNI_VERSION_10;
|
||||
static jint CurrentVersion = JNI_VERSION_19;
|
||||
|
||||
#if defined(_WIN32) && !defined(USE_VECTORED_EXCEPTION_HANDLING)
|
||||
extern LONG WINAPI topLevelExceptionFilter(_EXCEPTION_POINTERS* );
|
||||
|
@ -3549,6 +3549,7 @@ jboolean Threads::is_supported_jni_version(jint version) {
|
||||
if (version == JNI_VERSION_1_8) return JNI_TRUE;
|
||||
if (version == JNI_VERSION_9) return JNI_TRUE;
|
||||
if (version == JNI_VERSION_10) return JNI_TRUE;
|
||||
if (version == JNI_VERSION_19) return JNI_TRUE;
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
|
@ -1990,6 +1990,7 @@ JNI_OnUnload(JavaVM *vm, void *reserved);
|
||||
#define JNI_VERSION_1_8 0x00010008
|
||||
#define JNI_VERSION_9 0x00090000
|
||||
#define JNI_VERSION_10 0x000a0000
|
||||
#define JNI_VERSION_19 0x00130000
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -45,7 +45,7 @@ JNIEXPORT jint JNICALL DEF_JNI_OnLoad(JavaVM *vm, void *reserved)
|
||||
return JNI_EVERSION; /* JNI version not supported */
|
||||
}
|
||||
|
||||
return JNI_VERSION_10;
|
||||
return JNI_VERSION_19;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -39,7 +39,7 @@ JNIEXPORT jint JNICALL DEF_JNI_OnLoad(JavaVM *vm, void *reserved)
|
||||
return JNI_EVERSION; /* JNI version not supported */
|
||||
}
|
||||
|
||||
return JNI_VERSION_10;
|
||||
return JNI_VERSION_19;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -27,12 +27,12 @@
|
||||
*/
|
||||
public class JniVersion {
|
||||
|
||||
public static final int JNI_VERSION_10 = 0x000a0000;
|
||||
public static final int JNI_VERSION_19 = 0x00130000;
|
||||
|
||||
public static void main(String... args) throws Exception {
|
||||
System.loadLibrary("JniVersion");
|
||||
int res = getJniVersion();
|
||||
if (res != JNI_VERSION_10) {
|
||||
if (res != JNI_VERSION_19) {
|
||||
throw new Exception("Unexpected value returned from getJniVersion(): 0x" + Integer.toHexString(res));
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
static jint count = 0;
|
||||
static jclass test_class;
|
||||
static jint current_jni_version = JNI_VERSION_10;
|
||||
static jint current_jni_version = JNI_VERSION_19;
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
static jclass test_class;
|
||||
static jmethodID mid;
|
||||
static jint current_jni_version = JNI_VERSION_10;
|
||||
static jint current_jni_version = JNI_VERSION_19;
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -27,7 +27,7 @@
|
||||
#include "jni.h"
|
||||
|
||||
static jclass test_class;
|
||||
static jint current_jni_version = JNI_VERSION_10;
|
||||
static jint current_jni_version = JNI_VERSION_19;
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
|
@ -68,7 +68,7 @@ int java_cmp(const void *a, const void *b) {
|
||||
int v2 = *((int*)b);
|
||||
|
||||
JNIEnv* env;
|
||||
(*VM)->GetEnv(VM, (void**) &env, JNI_VERSION_10);
|
||||
(*VM)->GetEnv(VM, (void**) &env, JNI_VERSION_19);
|
||||
|
||||
jclass qsortClass = (*env)->FindClass(env, "org/openjdk/bench/java/lang/foreign/QSort");
|
||||
jmethodID methodId = (*env)->GetStaticMethodID(env, qsortClass, "jni_upcall_compar", "(II)I");
|
||||
|
Loading…
Reference in New Issue
Block a user