comparison src/share/vm/prims/nativeLookup.cpp @ 710:e5b0439ef4ae

6655638: dynamic languages need method handles Summary: initial implementation, with known omissions (x86/64, sparc, compiler optim., c-oops, C++ interp.) Reviewed-by: kvn, twisti, never
author jrose
date Wed, 08 Apr 2009 10:56:49 -0700
parents a61af66fc99e
children 4ce7240d622c
comparison
equal deleted inserted replaced
709:1d037ecd7960 710:e5b0439ef4ae
1 /* 1 /*
2 * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
76 return st.as_string(); 76 return st.as_string();
77 } 77 }
78 78
79 extern "C" { 79 extern "C" {
80 void JNICALL JVM_RegisterUnsafeMethods(JNIEnv *env, jclass unsafecls); 80 void JNICALL JVM_RegisterUnsafeMethods(JNIEnv *env, jclass unsafecls);
81 void JNICALL JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass unsafecls);
81 void JNICALL JVM_RegisterPerfMethods(JNIEnv *env, jclass perfclass); 82 void JNICALL JVM_RegisterPerfMethods(JNIEnv *env, jclass perfclass);
82 } 83 }
83 84
84 static address lookup_special_native(char* jni_name) { 85 static address lookup_special_native(char* jni_name) {
85 // NB: To ignore the jni prefix and jni postfix strstr is used matching. 86 // NB: To ignore the jni prefix and jni postfix strstr is used matching.
94 return CAST_FROM_FN_PTR(address, JVM_SetPrimitiveFieldValues); 95 return CAST_FROM_FN_PTR(address, JVM_SetPrimitiveFieldValues);
95 } 96 }
96 } 97 }
97 if (strstr(jni_name, "Java_sun_misc_Unsafe_registerNatives") != NULL) { 98 if (strstr(jni_name, "Java_sun_misc_Unsafe_registerNatives") != NULL) {
98 return CAST_FROM_FN_PTR(address, JVM_RegisterUnsafeMethods); 99 return CAST_FROM_FN_PTR(address, JVM_RegisterUnsafeMethods);
100 }
101 if (strstr(jni_name, "Java_sun_dyn_MethodHandleNatives_registerNatives") != NULL) {
102 return CAST_FROM_FN_PTR(address, JVM_RegisterMethodHandleMethods);
99 } 103 }
100 if (strstr(jni_name, "Java_sun_misc_Perf_registerNatives") != NULL) { 104 if (strstr(jni_name, "Java_sun_misc_Perf_registerNatives") != NULL) {
101 return CAST_FROM_FN_PTR(address, JVM_RegisterPerfMethods); 105 return CAST_FROM_FN_PTR(address, JVM_RegisterPerfMethods);
102 } 106 }
103 107