Mercurial > hg > truffle
comparison src/share/vm/prims/nativeLookup.cpp @ 21559:be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 28 May 2015 15:36:48 +0200 |
parents | b1530a6cce8c |
children | 47bebae7454f |
comparison
equal
deleted
inserted
replaced
21558:d563baeca9df | 21559:be896a1983c0 |
---|---|
124 extern "C" { | 124 extern "C" { |
125 void JNICALL JVM_RegisterUnsafeMethods(JNIEnv *env, jclass unsafecls); | 125 void JNICALL JVM_RegisterUnsafeMethods(JNIEnv *env, jclass unsafecls); |
126 void JNICALL JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass unsafecls); | 126 void JNICALL JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass unsafecls); |
127 void JNICALL JVM_RegisterPerfMethods(JNIEnv *env, jclass perfclass); | 127 void JNICALL JVM_RegisterPerfMethods(JNIEnv *env, jclass perfclass); |
128 void JNICALL JVM_RegisterWhiteBoxMethods(JNIEnv *env, jclass wbclass); | 128 void JNICALL JVM_RegisterWhiteBoxMethods(JNIEnv *env, jclass wbclass); |
129 #ifdef GRAAL | 129 #ifdef JVMCI |
130 void JNICALL JVM_InitGraalClassLoader(JNIEnv *env, jclass c, jobject loader); | 130 void JNICALL JVM_InitJVMCIClassLoader(JNIEnv *env, jclass c, jobject loader); |
131 void JNICALL JVM_InitializeGraalNatives(JNIEnv *env, jclass compilerToVMClass); | 131 void JNICALL JVM_InitializeJVMCINatives(JNIEnv *env, jclass compilerToVMClass); |
132 jobject JNICALL JVM_GetJVMCIRuntime(JNIEnv *env, jclass c); | 132 jobject JNICALL JVM_GetJVMCIRuntime(JNIEnv *env, jclass c); |
133 jobject JNICALL JVM_GetGraalRuntime(JNIEnv *env, jclass c); | 133 jobject JNICALL JVM_GetJVMCIRuntime(JNIEnv *env, jclass c); |
134 jobject JNICALL JVM_GetGraalServiceImpls(JNIEnv *env, jclass c, jclass serviceClass); | 134 jobject JNICALL JVM_GetJVMCIServiceImpls(JNIEnv *env, jclass c, jclass serviceClass); |
135 jobject JNICALL JVM_CreateTruffleRuntime(JNIEnv *env, jclass c); | 135 jobject JNICALL JVM_CreateTruffleRuntime(JNIEnv *env, jclass c); |
136 jobject JNICALL JVM_CreateNativeFunctionInterface(JNIEnv *env, jclass c); | 136 jobject JNICALL JVM_CreateNativeFunctionInterface(JNIEnv *env, jclass c); |
137 jboolean JNICALL JVM_ParseGraalOptions(JNIEnv *env, jclass hotspotOptionsClass); | 137 jboolean JNICALL JVM_ParseJVMCIOptions(JNIEnv *env, jclass hotspotOptionsClass); |
138 #ifdef COMPILERGRAAL | 138 #ifdef COMPILERJVMCI |
139 void JNICALL JVM_PrintAndResetGraalCompRate(JNIEnv *env, jclass c); | 139 void JNICALL JVM_PrintAndResetJVMCICompRate(JNIEnv *env, jclass c); |
140 #endif | 140 #endif |
141 #endif | 141 #endif |
142 } | 142 } |
143 | 143 |
144 #define CC (char*) /* cast a literal from (const char*) */ | 144 #define CC (char*) /* cast a literal from (const char*) */ |
147 static JNINativeMethod lookup_special_native_methods[] = { | 147 static JNINativeMethod lookup_special_native_methods[] = { |
148 { CC"Java_sun_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) }, | 148 { CC"Java_sun_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) }, |
149 { CC"Java_java_lang_invoke_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) }, | 149 { CC"Java_java_lang_invoke_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) }, |
150 { CC"Java_sun_misc_Perf_registerNatives", NULL, FN_PTR(JVM_RegisterPerfMethods) }, | 150 { CC"Java_sun_misc_Perf_registerNatives", NULL, FN_PTR(JVM_RegisterPerfMethods) }, |
151 { CC"Java_sun_hotspot_WhiteBox_registerNatives", NULL, FN_PTR(JVM_RegisterWhiteBoxMethods) }, | 151 { CC"Java_sun_hotspot_WhiteBox_registerNatives", NULL, FN_PTR(JVM_RegisterWhiteBoxMethods) }, |
152 #ifdef GRAAL | 152 #ifdef JVMCI |
153 { CC"Java_com_oracle_graal_hotspot_loader_Factory_init", NULL, FN_PTR(JVM_InitGraalClassLoader) }, | 153 { CC"Java_com_oracle_jvmci_hotspot_loader_Factory_init", NULL, FN_PTR(JVM_InitJVMCIClassLoader) }, |
154 { CC"Java_com_oracle_jvmci_runtime_JVMCI_initializeRuntime", NULL, FN_PTR(JVM_GetJVMCIRuntime) }, | 154 { CC"Java_com_oracle_jvmci_runtime_JVMCI_initializeRuntime", NULL, FN_PTR(JVM_GetJVMCIRuntime) }, |
155 { CC"Java_com_oracle_jvmci_runtime_Services_getServiceImpls", NULL, FN_PTR(JVM_GetGraalServiceImpls) }, | 155 { CC"Java_com_oracle_jvmci_runtime_Services_getServiceImpls", NULL, FN_PTR(JVM_GetJVMCIServiceImpls) }, |
156 { CC"Java_com_oracle_truffle_api_Truffle_createRuntime", NULL, FN_PTR(JVM_CreateTruffleRuntime) }, | 156 { CC"Java_com_oracle_truffle_api_Truffle_createRuntime", NULL, FN_PTR(JVM_CreateTruffleRuntime) }, |
157 { CC"Java_com_oracle_nfi_NativeFunctionInterfaceRuntime_createInterface", NULL, FN_PTR(JVM_CreateNativeFunctionInterface) }, | 157 { CC"Java_com_oracle_nfi_NativeFunctionInterfaceRuntime_createInterface", NULL, FN_PTR(JVM_CreateNativeFunctionInterface) }, |
158 { CC"Java_com_oracle_jvmci_hotspot_CompilerToVMImpl_init", NULL, FN_PTR(JVM_InitializeGraalNatives) }, | 158 { CC"Java_com_oracle_jvmci_hotspot_CompilerToVMImpl_init", NULL, FN_PTR(JVM_InitializeJVMCINatives) }, |
159 { CC"Java_com_oracle_jvmci_hotspot_HotSpotOptions_parseVMOptions", NULL, FN_PTR(JVM_ParseGraalOptions) }, | 159 { CC"Java_com_oracle_jvmci_hotspot_HotSpotOptions_parseVMOptions", NULL, FN_PTR(JVM_ParseJVMCIOptions) }, |
160 #endif | 160 #endif |
161 }; | 161 }; |
162 | 162 |
163 static address lookup_special_native(char* jni_name) { | 163 static address lookup_special_native(char* jni_name) { |
164 int count = sizeof(lookup_special_native_methods) / sizeof(JNINativeMethod); | 164 int count = sizeof(lookup_special_native_methods) / sizeof(JNINativeMethod); |
185 // the native Java library. This takes care of any bootstrapping problems. | 185 // the native Java library. This takes care of any bootstrapping problems. |
186 // Note: It is critical for bootstrapping that Java_java_lang_ClassLoader_00024NativeLibrary_find | 186 // Note: It is critical for bootstrapping that Java_java_lang_ClassLoader_00024NativeLibrary_find |
187 // gets found the first time around - otherwise an infinite loop can occure. This is | 187 // gets found the first time around - otherwise an infinite loop can occure. This is |
188 // another VM/library dependency | 188 // another VM/library dependency |
189 Handle loader(THREAD, method->method_holder()->class_loader()); | 189 Handle loader(THREAD, method->method_holder()->class_loader()); |
190 if (loader.is_null() GRAAL_ONLY(|| loader() == SystemDictionary::graal_loader())) { | 190 if (loader.is_null() JVMCI_ONLY(|| loader() == SystemDictionary::jvmci_loader())) { |
191 entry = lookup_special_native(jni_name); | 191 entry = lookup_special_native(jni_name); |
192 if (entry == NULL) { | 192 if (entry == NULL) { |
193 entry = (address) os::dll_lookup(os::native_java_library(), jni_name); | 193 entry = (address) os::dll_lookup(os::native_java_library(), jni_name); |
194 } | 194 } |
195 if (entry != NULL) { | 195 if (entry != NULL) { |