109 extern "C" { |
109 extern "C" { |
110 void JNICALL JVM_RegisterUnsafeMethods(JNIEnv *env, jclass unsafecls); |
110 void JNICALL JVM_RegisterUnsafeMethods(JNIEnv *env, jclass unsafecls); |
111 void JNICALL JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass unsafecls); |
111 void JNICALL JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass unsafecls); |
112 void JNICALL JVM_RegisterPerfMethods(JNIEnv *env, jclass perfclass); |
112 void JNICALL JVM_RegisterPerfMethods(JNIEnv *env, jclass perfclass); |
113 void JNICALL JVM_RegisterWhiteBoxMethods(JNIEnv *env, jclass wbclass); |
113 void JNICALL JVM_RegisterWhiteBoxMethods(JNIEnv *env, jclass wbclass); |
|
114 #if INCLUDE_JVMCI |
|
115 jobject JNICALL JVM_GetJVMCIRuntime(JNIEnv *env, jclass c); |
|
116 void JNICALL JVM_RegisterJVMCINatives(JNIEnv *env, jclass compilerToVMClass); |
|
117 #endif |
114 } |
118 } |
115 |
119 |
116 #define CC (char*) /* cast a literal from (const char*) */ |
120 #define CC (char*) /* cast a literal from (const char*) */ |
117 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f) |
121 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f) |
118 |
122 |
119 static JNINativeMethod lookup_special_native_methods[] = { |
123 static JNINativeMethod lookup_special_native_methods[] = { |
120 { CC"Java_sun_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) }, |
124 { CC"Java_sun_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) }, |
121 { CC"Java_java_lang_invoke_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) }, |
125 { CC"Java_java_lang_invoke_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) }, |
122 { CC"Java_sun_misc_Perf_registerNatives", NULL, FN_PTR(JVM_RegisterPerfMethods) }, |
126 { CC"Java_sun_misc_Perf_registerNatives", NULL, FN_PTR(JVM_RegisterPerfMethods) }, |
123 { CC"Java_sun_hotspot_WhiteBox_registerNatives", NULL, FN_PTR(JVM_RegisterWhiteBoxMethods) }, |
127 { CC"Java_sun_hotspot_WhiteBox_registerNatives", NULL, FN_PTR(JVM_RegisterWhiteBoxMethods) }, |
|
128 #if INCLUDE_JVMCI |
|
129 { CC"Java_jdk_vm_ci_runtime_JVMCI_initializeRuntime", NULL, FN_PTR(JVM_GetJVMCIRuntime) }, |
|
130 { CC"Java_jdk_vm_ci_hotspot_CompilerToVM_registerNatives", NULL, FN_PTR(JVM_RegisterJVMCINatives) }, |
|
131 #endif |
124 }; |
132 }; |
125 |
133 |
126 static address lookup_special_native(char* jni_name) { |
134 static address lookup_special_native(char* jni_name) { |
127 int count = sizeof(lookup_special_native_methods) / sizeof(JNINativeMethod); |
135 int count = sizeof(lookup_special_native_methods) / sizeof(JNINativeMethod); |
128 for (int i = 0; i < count; i++) { |
136 for (int i = 0; i < count; i++) { |