Mercurial > hg > graal-jvmci-8
comparison src/share/vm/prims/nativeLookup.cpp @ 5915:2d503de963b3
7148152: Add whitebox testing API to HotSpot
Summary: Add an internal testing API to HotSpot to enable more targeted testing of vm functionality
Reviewed-by: phh, dholmes
author | mgerdin |
---|---|
date | Thu, 23 Feb 2012 14:58:35 +0100 |
parents | 0382d2b469b2 |
children | 93c71eb28866 |
comparison
equal
deleted
inserted
replaced
4956:4ab89de75552 | 5915:2d503de963b3 |
---|---|
119 | 119 |
120 extern "C" { | 120 extern "C" { |
121 void JNICALL JVM_RegisterUnsafeMethods(JNIEnv *env, jclass unsafecls); | 121 void JNICALL JVM_RegisterUnsafeMethods(JNIEnv *env, jclass unsafecls); |
122 void JNICALL JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass unsafecls); | 122 void JNICALL JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass unsafecls); |
123 void JNICALL JVM_RegisterPerfMethods(JNIEnv *env, jclass perfclass); | 123 void JNICALL JVM_RegisterPerfMethods(JNIEnv *env, jclass perfclass); |
124 void JNICALL JVM_RegisterWhiteBoxMethods(JNIEnv *env, jclass wbclass); | |
124 } | 125 } |
125 | 126 |
126 #define CC (char*) /* cast a literal from (const char*) */ | 127 #define CC (char*) /* cast a literal from (const char*) */ |
127 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f) | 128 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f) |
128 | 129 |
131 { CC"Java_java_io_ObjectOutputStream_getPrimitiveFieldValues", NULL, FN_PTR(JVM_GetPrimitiveFieldValues) }, // intercept ObjectOutputStream getPrimitiveFieldValues for faster serialization | 132 { CC"Java_java_io_ObjectOutputStream_getPrimitiveFieldValues", NULL, FN_PTR(JVM_GetPrimitiveFieldValues) }, // intercept ObjectOutputStream getPrimitiveFieldValues for faster serialization |
132 { CC"Java_java_io_ObjectInputStream_setPrimitiveFieldValues", NULL, FN_PTR(JVM_SetPrimitiveFieldValues) }, // intercept ObjectInputStream setPrimitiveFieldValues for faster serialization | 133 { CC"Java_java_io_ObjectInputStream_setPrimitiveFieldValues", NULL, FN_PTR(JVM_SetPrimitiveFieldValues) }, // intercept ObjectInputStream setPrimitiveFieldValues for faster serialization |
133 | 134 |
134 { CC"Java_sun_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) }, | 135 { CC"Java_sun_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) }, |
135 { CC"Java_java_lang_invoke_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) }, | 136 { CC"Java_java_lang_invoke_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) }, |
136 { CC"Java_sun_misc_Perf_registerNatives", NULL, FN_PTR(JVM_RegisterPerfMethods) } | 137 { CC"Java_sun_misc_Perf_registerNatives", NULL, FN_PTR(JVM_RegisterPerfMethods) }, |
138 { CC"Java_sun_hotspot_WhiteBox_registerNatives", NULL, FN_PTR(JVM_RegisterWhiteBoxMethods) }, | |
137 }; | 139 }; |
138 | 140 |
139 static address lookup_special_native(char* jni_name) { | 141 static address lookup_special_native(char* jni_name) { |
140 int i = !JDK_Version::is_gte_jdk14x_version() ? 0 : 2; // see comment in lookup_special_native_methods | 142 int i = !JDK_Version::is_gte_jdk14x_version() ? 0 : 2; // see comment in lookup_special_native_methods |
141 int count = sizeof(lookup_special_native_methods) / sizeof(JNINativeMethod); | 143 int count = sizeof(lookup_special_native_methods) / sizeof(JNINativeMethod); |