comparison src/share/vm/prims/nativeLookup.cpp @ 15870:fe608a56e3f7

made HotSpotOptions processing faster by removing use of service loader in VM startup and only doing work for options specified on the command line
author Doug Simon <doug.simon@oracle.com>
date Fri, 23 May 2014 19:36:34 +0200
parents b7fb36e57da8
children 6aa352b260f4
comparison
equal deleted inserted replaced
15869:387b15da0f68 15870:fe608a56e3f7
122 void JNICALL JVM_RegisterUnsafeMethods(JNIEnv *env, jclass unsafecls); 122 void JNICALL JVM_RegisterUnsafeMethods(JNIEnv *env, jclass unsafecls);
123 void JNICALL JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass unsafecls); 123 void JNICALL JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass unsafecls);
124 void JNICALL JVM_RegisterPerfMethods(JNIEnv *env, jclass perfclass); 124 void JNICALL JVM_RegisterPerfMethods(JNIEnv *env, jclass perfclass);
125 void JNICALL JVM_RegisterWhiteBoxMethods(JNIEnv *env, jclass wbclass); 125 void JNICALL JVM_RegisterWhiteBoxMethods(JNIEnv *env, jclass wbclass);
126 #ifdef GRAAL 126 #ifdef GRAAL
127 void JNICALL JVM_InitializeGraalNatives(JNIEnv *env, jclass c, jclass compilerToVMClass); 127 void JNICALL JVM_InitializeGraalNatives(JNIEnv *env, jclass c, jclass compilerToVMClass);
128 jobject JNICALL JVM_GetGraalRuntime(JNIEnv *env, jclass c); 128 jobject JNICALL JVM_GetGraalRuntime(JNIEnv *env, jclass c);
129 jobject JNICALL JVM_CreateTruffleRuntime(JNIEnv *env, jclass c); 129 jobject JNICALL JVM_CreateTruffleRuntime(JNIEnv *env, jclass c);
130 jobject JNICALL JVM_GetGraalOptions(JNIEnv *env, jclass hotspotOptionsClass, jobject timeCompilations); 130 jboolean JNICALL JVM_ParseGraalOptions(JNIEnv *env, jclass hotspotOptionsClass);
131 #endif 131 #endif
132 } 132 }
133 133
134 #define CC (char*) /* cast a literal from (const char*) */ 134 #define CC (char*) /* cast a literal from (const char*) */
135 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f) 135 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f)
138 { CC"Java_sun_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) }, 138 { CC"Java_sun_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) },
139 { CC"Java_java_lang_invoke_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) }, 139 { CC"Java_java_lang_invoke_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) },
140 { CC"Java_sun_misc_Perf_registerNatives", NULL, FN_PTR(JVM_RegisterPerfMethods) }, 140 { CC"Java_sun_misc_Perf_registerNatives", NULL, FN_PTR(JVM_RegisterPerfMethods) },
141 { CC"Java_sun_hotspot_WhiteBox_registerNatives", NULL, FN_PTR(JVM_RegisterWhiteBoxMethods) }, 141 { CC"Java_sun_hotspot_WhiteBox_registerNatives", NULL, FN_PTR(JVM_RegisterWhiteBoxMethods) },
142 #ifdef GRAAL 142 #ifdef GRAAL
143 { CC"Java_com_oracle_graal_api_runtime_Graal_initializeRuntime", NULL, FN_PTR(JVM_GetGraalRuntime) }, 143 { CC"Java_com_oracle_graal_api_runtime_Graal_initializeRuntime", NULL, FN_PTR(JVM_GetGraalRuntime) },
144 { CC"Java_com_oracle_truffle_api_Truffle_createRuntime", NULL, FN_PTR(JVM_CreateTruffleRuntime) }, 144 { CC"Java_com_oracle_truffle_api_Truffle_createRuntime", NULL, FN_PTR(JVM_CreateTruffleRuntime) },
145 { CC"Java_com_oracle_graal_hotspot_HotSpotGraalRuntime_init", NULL, FN_PTR(JVM_InitializeGraalNatives) }, 145 { CC"Java_com_oracle_graal_hotspot_HotSpotGraalRuntime_init", NULL, FN_PTR(JVM_InitializeGraalNatives) },
146 { CC"Java_com_oracle_graal_hotspot_HotSpotOptions_getVMOptions", NULL, FN_PTR(JVM_GetGraalOptions) }, 146 { CC"Java_com_oracle_graal_hotspot_HotSpotOptions_parseVMOptions", NULL, FN_PTR(JVM_ParseGraalOptions) },
147 #endif 147 #endif
148 }; 148 };
149 149
150 static address lookup_special_native(char* jni_name) { 150 static address lookup_special_native(char* jni_name) {
151 int count = sizeof(lookup_special_native_methods) / sizeof(JNINativeMethod); 151 int count = sizeof(lookup_special_native_methods) / sizeof(JNINativeMethod);