Mercurial > hg > graal-compiler
comparison src/share/vm/prims/nativeLookup.cpp @ 15603:b7fb36e57da8
made Graal initialization be driven from Java to simplify sequencing and synchronization
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 12 May 2014 23:27:07 +0200 |
parents | 4ca6dc0799b6 |
children | fe608a56e3f7 |
comparison
equal
deleted
inserted
replaced
15602:c73df62cbaee | 15603:b7fb36e57da8 |
---|---|
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 jobject JNICALL JVM_InitializeGraalRuntime(JNIEnv *env, jclass graalclass); | 127 void JNICALL JVM_InitializeGraalNatives(JNIEnv *env, jclass c, jclass compilerToVMClass); |
128 jobject JNICALL JVM_InitializeTruffleRuntime(JNIEnv *env, jclass graalclass); | 128 jobject JNICALL JVM_GetGraalRuntime(JNIEnv *env, jclass c); |
129 jobject JNICALL JVM_CreateTruffleRuntime(JNIEnv *env, jclass c); | |
130 jobject JNICALL JVM_GetGraalOptions(JNIEnv *env, jclass hotspotOptionsClass, jobject timeCompilations); | |
129 #endif | 131 #endif |
130 } | 132 } |
131 | 133 |
132 #define CC (char*) /* cast a literal from (const char*) */ | 134 #define CC (char*) /* cast a literal from (const char*) */ |
133 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f) | 135 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f) |
136 { CC"Java_sun_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) }, | 138 { CC"Java_sun_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) }, |
137 { 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) }, |
138 { CC"Java_sun_misc_Perf_registerNatives", NULL, FN_PTR(JVM_RegisterPerfMethods) }, | 140 { CC"Java_sun_misc_Perf_registerNatives", NULL, FN_PTR(JVM_RegisterPerfMethods) }, |
139 { CC"Java_sun_hotspot_WhiteBox_registerNatives", NULL, FN_PTR(JVM_RegisterWhiteBoxMethods) }, | 141 { CC"Java_sun_hotspot_WhiteBox_registerNatives", NULL, FN_PTR(JVM_RegisterWhiteBoxMethods) }, |
140 #ifdef GRAAL | 142 #ifdef GRAAL |
141 { CC"Java_com_oracle_graal_api_runtime_Graal_initializeRuntime", NULL, FN_PTR(JVM_InitializeGraalRuntime) }, | 143 { CC"Java_com_oracle_graal_api_runtime_Graal_initializeRuntime", NULL, FN_PTR(JVM_GetGraalRuntime) }, |
142 { CC"Java_com_oracle_truffle_api_Truffle_initializeRuntime", NULL, FN_PTR(JVM_InitializeTruffleRuntime) }, | 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) }, | |
146 { CC"Java_com_oracle_graal_hotspot_HotSpotOptions_getVMOptions", NULL, FN_PTR(JVM_GetGraalOptions) }, | |
143 #endif | 147 #endif |
144 }; | 148 }; |
145 | 149 |
146 static address lookup_special_native(char* jni_name) { | 150 static address lookup_special_native(char* jni_name) { |
147 int count = sizeof(lookup_special_native_methods) / sizeof(JNINativeMethod); | 151 int count = sizeof(lookup_special_native_methods) / sizeof(JNINativeMethod); |