nativeLookup.cpp revision 0
/*
* Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
# include "incls/_precompiled.incl"
# include "incls/_nativeLookup.cpp.incl"
jchar c;
if (c <= 0x7f && isalnum(c)) {
} else {
}
}
}
}
// Prefix
// Klass name
// Method name
}
// Signature ignore the wrapping parenteses and the trailing return type
// find ')'
int end;
// skip first '('
}
extern "C" {
}
// NB: To ignore the jni prefix and jni postfix strstr is used matching.
if (!JDK_Version::is_gte_jdk14x_version()) {
// These functions only exist for compatibility with 1.3.1 and earlier
// Intercept ObjectOutputStream getPrimitiveFieldValues for faster serialization
}
// Intercept ObjectInputStream setPrimitiveFieldValues for faster serialization
}
}
}
}
return NULL;
}
address NativeLookup::lookup_style(methodHandle method, char* pure_name, const char* long_name, int args_size, bool os_style, bool& in_base_library, TRAPS) {
// Compute complete JNI name for style
// If the loader is null we have a system class, so we attempt a lookup in
// the native Java library. This takes care of any bootstrapping problems.
// Note: It is critical for bootstrapping that Java_java_lang_ClassLoader_00024NativeLibrary_find
// gets found the first time around - otherwise an infinite loop can occure. This is
}
in_base_library = true;
return entry;
}
}
// Otherwise call static method findNative in ClassLoader
// Arguments
// findNative didn't find it, if there are any agent libraries look in them
return entry;
}
}
}
return entry;
}
// Check all the formats of native implementation name to see if there is one
// for the specified method.
in_base_library = false;
// Compute pure name
// Compute argument size
// 1) Try JNI short style
// Compute long name
// 2) Try JNI long style
return entry; // NULL indicates not found
}
// Check if there are any JVM TI prefixes which have been applied to the native method name.
// If any are found, remove them before attemping the look up of the
// native implementation again.
// See SetNativeMethodPrefix in the JVM TI Spec for more details.
int prefix_count;
char* wrapper_name = in_name;
// last applied prefix will be first -- go backwards
for (int i = prefix_count-1; i >= 0; i--) {
// has this prefix remove it
}
}
if (wrapper_name != in_name) {
// we have a name for a wrapping method
if (!wrapper_symbol.is_null()) {
// we found a wrapper method, use its native entry
}
}
}
return NULL;
}
// standard native method resolution has failed. Check if there are any
// JVM TI prefixes which have been applied to the native method name.
// Native function not found, throw UnsatisfiedLinkError
}
if (!method->has_native_function()) {
// -verbose:jni printing
if (PrintJNIResolving) {
}
}
return method->native_function();
}
address NativeLookup::base_library_lookup(const char* class_name, const char* method_name, const char* signature) {
bool in_base_library = true; // SharedRuntime inits some math methods.
// Find the class
// Find method and invoke standard lookup
return result;
}