Scary file... Is that the original version? If it's the original, please apply. If not, please apply the original and then adjust it. This makes tracking merges easier.<div><br></div><div>Two small things before you commit:</div>
<div>- Put the file in include/j3/openjdk/jvm.h, as this will be very specific to OpenJDK</div><div>- Add the file in the third party software list of LICENSE.txt file, like this: just after JNI write:</div><div>    OpenJDK vmkit/include/openjdk/</div>
<div><br></div><div>Thanks!</div><div>Nicolas<br><br><div class="gmail_quote">On Mon, Oct 24, 2011 at 10:45 PM, Will Dietz <span dir="ltr"><<a href="mailto:wdietz2@illinois.edu">wdietz2@illinois.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Small step, just grab jvm.h from OpenJDK.  This is done to mostly to<br>
provide the types and function declarations that will be added later.<br>
<br>
(Similar to existing jni.h, I suppose)<br>
<br>
Inlined below:<br>
 include/j3/jvm.h | 1514 ++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>
 1 files changed, 1514 insertions(+), 0 deletions(-)<br>
 create mode 100644 include/j3/jvm.h<br>
<br>
diff --git a/include/j3/jvm.h b/include/j3/jvm.h<br>
new file mode 100644<br>
index 0000000..cb7cbd5<br>
--- /dev/null<br>
+++ b/include/j3/jvm.h<br>
@@ -0,0 +1,1514 @@<br>
+/*<br>
+ * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.<br>
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.<br>
+ *<br>
+ * This code is free software; you can redistribute it and/or modify it<br>
+ * under the terms of the GNU General Public License version 2 only, as<br>
+ * published by the Free Software Foundation.  Oracle designates this<br>
+ * particular file as subject to the "Classpath" exception as provided<br>
+ * by Oracle in the LICENSE file that accompanied this code.<br>
+ *<br>
+ * This code is distributed in the hope that it will be useful, but WITHOUT<br>
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or<br>
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License<br>
+ * version 2 for more details (a copy is included in the LICENSE file that<br>
+ * accompanied this code).<br>
+ *<br>
+ * You should have received a copy of the GNU General Public License version<br>
+ * 2 along with this work; if not, write to the Free Software Foundation,<br>
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.<br>
+ *<br>
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA<br>
+ * or visit <a href="http://www.oracle.com" target="_blank">www.oracle.com</a> if you need additional information or have any<br>
+ * questions.<br>
+ */<br>
+<br>
+#ifndef _JAVASOFT_JVM_H_<br>
+#define _JAVASOFT_JVM_H_<br>
+<br>
+#include <sys/stat.h><br>
+<br>
+#include "jni.h"<br>
+//#include "jvm_md.h"<br>
+<br>
+#ifdef __cplusplus<br>
+extern "C" {<br>
+#endif<br>
+<br>
+/*<br>
+ * This file contains additional functions exported from the VM.<br>
+ * These functions are complementary to the standard JNI support.<br>
+ * There are three parts to this file:<br>
+ *<br>
+ * First, this file contains the VM-related functions needed by native<br>
+ * libraries in the standard Java API. For example, the java.lang.Object<br>
+ * class needs VM-level functions that wait for and notify monitors.<br>
+ *<br>
+ * Second, this file contains the functions and constant definitions<br>
+ * needed by the byte code verifier and class file format checker.<br>
+ * These functions allow the verifier and format checker to be written<br>
+ * in a VM-independent way.<br>
+ *<br>
+ * Third, this file contains various I/O and nerwork operations needed<br>
+ * by the standard Java I/O and network APIs.<br>
+ */<br>
+<br>
+/*<br>
+ * Bump the version number when either of the following happens:<br>
+ *<br>
+ * 1. There is a change in JVM_* functions.<br>
+ *<br>
+ * 2. There is a change in the contract between VM and Java classes.<br>
+ *    For example, if the VM relies on a new private field in Thread<br>
+ *    class.<br>
+ */<br>
+<br>
+#define JVM_INTERFACE_VERSION 4<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetInterfaceVersion(void);<br>
+<br>
+/*************************************************************************<br>
+ PART 1: Functions for Native Libraries<br>
+ ************************************************************************/<br>
+/*<br>
+ * java.lang.Object<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_IHashCode(JNIEnv *env, jobject obj);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_MonitorWait(JNIEnv *env, jobject obj, jlong ms);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_MonitorNotify(JNIEnv *env, jobject obj);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_MonitorNotifyAll(JNIEnv *env, jobject obj);<br>
+<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_Clone(JNIEnv *env, jobject obj);<br>
+<br>
+/*<br>
+ * java.lang.String<br>
+ */<br>
+JNIEXPORT jstring JNICALL<br>
+JVM_InternString(JNIEnv *env, jstring str);<br>
+<br>
+/*<br>
+ * java.lang.System<br>
+ */<br>
+JNIEXPORT jlong JNICALL<br>
+JVM_CurrentTimeMillis(JNIEnv *env, jclass ignored);<br>
+<br>
+JNIEXPORT jlong JNICALL<br>
+JVM_NanoTime(JNIEnv *env, jclass ignored);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_ArrayCopy(JNIEnv *env, jclass ignored, jobject src, jint src_pos,<br>
+              jobject dst, jint dst_pos, jint length);<br>
+<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_InitProperties(JNIEnv *env, jobject p);<br>
+<br>
+/*<br>
+ * java.io.File<br>
+ */<br>
+JNIEXPORT void JNICALL<br>
+JVM_OnExit(void (*func)(void));<br>
+<br>
+/*<br>
+ * java.lang.Runtime<br>
+ */<br>
+JNIEXPORT void JNICALL<br>
+JVM_Exit(jint code);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_Halt(jint code);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_GC(void);<br>
+<br>
+/* Returns the number of real-time milliseconds that have elapsed since the<br>
+ * least-recently-inspected heap object was last inspected by the garbage<br>
+ * collector.<br>
+ *<br>
+ * For simple stop-the-world collectors this value is just the time<br>
+ * since the most recent collection.  For generational collectors it is the<br>
+ * time since the oldest generation was most recently collected.  Other<br>
+ * collectors are free to return a pessimistic estimate of the elapsed time, or<br>
+ * simply the time since the last full collection was performed.<br>
+ *<br>
+ * Note that in the presence of reference objects, a given object that is no<br>
+ * longer strongly reachable may have to be inspected multiple times before it<br>
+ * can be reclaimed.<br>
+ */<br>
+JNIEXPORT jlong JNICALL<br>
+JVM_MaxObjectInspectionAge(void);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_TraceInstructions(jboolean on);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_TraceMethodCalls(jboolean on);<br>
+<br>
+JNIEXPORT jlong JNICALL<br>
+JVM_TotalMemory(void);<br>
+<br>
+JNIEXPORT jlong JNICALL<br>
+JVM_FreeMemory(void);<br>
+<br>
+JNIEXPORT jlong JNICALL<br>
+JVM_MaxMemory(void);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_ActiveProcessorCount(void);<br>
+<br>
+JNIEXPORT void * JNICALL<br>
+JVM_LoadLibrary(const char *name);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_UnloadLibrary(void * handle);<br>
+<br>
+JNIEXPORT void * JNICALL<br>
+JVM_FindLibraryEntry(void *handle, const char *name);<br>
+<br>
+JNIEXPORT jboolean JNICALL<br>
+JVM_IsSupportedJNIVersion(jint version);<br>
+<br>
+/*<br>
+ * java.lang.Float and java.lang.Double<br>
+ */<br>
+JNIEXPORT jboolean JNICALL<br>
+JVM_IsNaN(jdouble d);<br>
+<br>
+/*<br>
+ * java.lang.Throwable<br>
+ */<br>
+JNIEXPORT void JNICALL<br>
+JVM_FillInStackTrace(JNIEnv *env, jobject throwable);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_PrintStackTrace(JNIEnv *env, jobject throwable, jobject printable);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetStackTraceDepth(JNIEnv *env, jobject throwable);<br>
+<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_GetStackTraceElement(JNIEnv *env, jobject throwable, jint index);<br>
+<br>
+/*<br>
+ * java.lang.Compiler<br>
+ */<br>
+JNIEXPORT void JNICALL<br>
+JVM_InitializeCompiler (JNIEnv *env, jclass compCls);<br>
+<br>
+JNIEXPORT jboolean JNICALL<br>
+JVM_IsSilentCompiler(JNIEnv *env, jclass compCls);<br>
+<br>
+JNIEXPORT jboolean JNICALL<br>
+JVM_CompileClass(JNIEnv *env, jclass compCls, jclass cls);<br>
+<br>
+JNIEXPORT jboolean JNICALL<br>
+JVM_CompileClasses(JNIEnv *env, jclass cls, jstring jname);<br>
+<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_CompilerCommand(JNIEnv *env, jclass compCls, jobject arg);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_EnableCompiler(JNIEnv *env, jclass compCls);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_DisableCompiler(JNIEnv *env, jclass compCls);<br>
+<br>
+/*<br>
+ * java.lang.Thread<br>
+ */<br>
+JNIEXPORT void JNICALL<br>
+JVM_StartThread(JNIEnv *env, jobject thread);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_StopThread(JNIEnv *env, jobject thread, jobject exception);<br>
+<br>
+JNIEXPORT jboolean JNICALL<br>
+JVM_IsThreadAlive(JNIEnv *env, jobject thread);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_SuspendThread(JNIEnv *env, jobject thread);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_ResumeThread(JNIEnv *env, jobject thread);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_SetThreadPriority(JNIEnv *env, jobject thread, jint prio);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_Yield(JNIEnv *env, jclass threadClass);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_Sleep(JNIEnv *env, jclass threadClass, jlong millis);<br>
+<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_CurrentThread(JNIEnv *env, jclass threadClass);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_CountStackFrames(JNIEnv *env, jobject thread);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_Interrupt(JNIEnv *env, jobject thread);<br>
+<br>
+JNIEXPORT jboolean JNICALL<br>
+JVM_IsInterrupted(JNIEnv *env, jobject thread, jboolean clearInterrupted);<br>
+<br>
+JNIEXPORT jboolean JNICALL<br>
+JVM_HoldsLock(JNIEnv *env, jclass threadClass, jobject obj);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_DumpAllStacks(JNIEnv *env, jclass unused);<br>
+<br>
+JNIEXPORT jobjectArray JNICALL<br>
+JVM_GetAllThreads(JNIEnv *env, jclass dummy);<br>
+<br>
+/* getStackTrace() and getAllStackTraces() method */<br>
+JNIEXPORT jobjectArray JNICALL<br>
+JVM_DumpThreads(JNIEnv *env, jclass threadClass, jobjectArray threads);<br>
+<br>
+/*<br>
+ * java.lang.SecurityManager<br>
+ */<br>
+JNIEXPORT jclass JNICALL<br>
+JVM_CurrentLoadedClass(JNIEnv *env);<br>
+<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_CurrentClassLoader(JNIEnv *env);<br>
+<br>
+JNIEXPORT jobjectArray JNICALL<br>
+JVM_GetClassContext(JNIEnv *env);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_ClassDepth(JNIEnv *env, jstring name);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_ClassLoaderDepth(JNIEnv *env);<br>
+<br>
+/*<br>
+ * java.lang.Package<br>
+ */<br>
+JNIEXPORT jstring JNICALL<br>
+JVM_GetSystemPackage(JNIEnv *env, jstring name);<br>
+<br>
+JNIEXPORT jobjectArray JNICALL<br>
+JVM_GetSystemPackages(JNIEnv *env);<br>
+<br>
+/*<br>
+ * java.io.ObjectInputStream<br>
+ */<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_AllocateNewObject(JNIEnv *env, jobject obj, jclass currClass,<br>
+                      jclass initClass);<br>
+<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_AllocateNewArray(JNIEnv *env, jobject obj, jclass currClass,<br>
+                     jint length);<br>
+<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_LatestUserDefinedLoader(JNIEnv *env);<br>
+<br>
+/*<br>
+ * This function has been deprecated and should not be considered<br>
+ * part of the specified JVM interface.<br>
+ */<br>
+JNIEXPORT jclass JNICALL<br>
+JVM_LoadClass0(JNIEnv *env, jobject obj, jclass currClass,<br>
+               jstring currClassName);<br>
+<br>
+/*<br>
+ * java.lang.reflect.Array<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetArrayLength(JNIEnv *env, jobject arr);<br>
+<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_GetArrayElement(JNIEnv *env, jobject arr, jint index);<br>
+<br>
+JNIEXPORT jvalue JNICALL<br>
+JVM_GetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jint wCode);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_SetArrayElement(JNIEnv *env, jobject arr, jint index, jobject val);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_SetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jvalue v,<br>
+                             unsigned char vCode);<br>
+<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_NewArray(JNIEnv *env, jclass eltClass, jint length);<br>
+<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_NewMultiArray(JNIEnv *env, jclass eltClass, jintArray dim);<br>
+<br>
+/*<br>
+ * java.lang.Class and java.lang.ClassLoader<br>
+ */<br>
+/*<br>
+ * Returns the class in which the code invoking the native method<br>
+ * belongs.<br>
+ *<br>
+ * Note that in JDK 1.1, native methods did not create a frame.<br>
+ * In 1.2, they do. Therefore native methods like Class.forName<br>
+ * can no longer look at the current frame for the caller class.<br>
+ */<br>
+JNIEXPORT jclass JNICALL<br>
+JVM_GetCallerClass(JNIEnv *env, int n);<br>
+<br>
+/*<br>
+ * Find primitive classes<br>
+ * utf: class name<br>
+ */<br>
+JNIEXPORT jclass JNICALL<br>
+JVM_FindPrimitiveClass(JNIEnv *env, const char *utf);<br>
+<br>
+/*<br>
+ * Link the class<br>
+ */<br>
+JNIEXPORT void JNICALL<br>
+JVM_ResolveClass(JNIEnv *env, jclass cls);<br>
+<br>
+/*<br>
+ * Find a class from a given class loader. Throw ClassNotFoundException<br>
+ * or NoClassDefFoundError depending on the value of the last<br>
+ * argument.<br>
+ */<br>
+JNIEXPORT jclass JNICALL<br>
+JVM_FindClassFromClassLoader(JNIEnv *env, const char *name, jboolean init,<br>
+                             jobject loader, jboolean throwError);<br>
+<br>
+/*<br>
+ * Find a class from a given class.<br>
+ */<br>
+JNIEXPORT jclass JNICALL<br>
+JVM_FindClassFromClass(JNIEnv *env, const char *name, jboolean init,<br>
+                             jclass from);<br>
+<br>
+/* Find a loaded class cached by the VM */<br>
+JNIEXPORT jclass JNICALL<br>
+JVM_FindLoadedClass(JNIEnv *env, jobject loader, jstring name);<br>
+<br>
+/* Define a class */<br>
+JNIEXPORT jclass JNICALL<br>
+JVM_DefineClass(JNIEnv *env, const char *name, jobject loader, const<br>
jbyte *buf,<br>
+                jsize len, jobject pd);<br>
+<br>
+/* Define a class with a source (added in JDK1.5) */<br>
+JNIEXPORT jclass JNICALL<br>
+JVM_DefineClassWithSource(JNIEnv *env, const char *name, jobject loader,<br>
+                          const jbyte *buf, jsize len, jobject pd,<br>
+                          const char *source);<br>
+<br>
+/* Define a class with a source with conditional verification (added HSX 14)<br>
+ * -Xverify:all will verify anyway, -Xverify:none will not verify,<br>
+ * -Xverify:remote (default) will obey this conditional<br>
+ * i.e. true = should_verify_class<br>
+ */<br>
+JNIEXPORT jclass JNICALL<br>
+JVM_DefineClassWithSourceCond(JNIEnv *env, const char *name, jobject loader,<br>
+                              const jbyte *buf, jsize len, jobject pd,<br>
+                              const char *source, jboolean verify);<br>
+<br>
+/*<br>
+ * Reflection support functions<br>
+ */<br>
+<br>
+JNIEXPORT jstring JNICALL<br>
+JVM_GetClassName(JNIEnv *env, jclass cls);<br>
+<br>
+JNIEXPORT jobjectArray JNICALL<br>
+JVM_GetClassInterfaces(JNIEnv *env, jclass cls);<br>
+<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_GetClassLoader(JNIEnv *env, jclass cls);<br>
+<br>
+JNIEXPORT jboolean JNICALL<br>
+JVM_IsInterface(JNIEnv *env, jclass cls);<br>
+<br>
+JNIEXPORT jobjectArray JNICALL<br>
+JVM_GetClassSigners(JNIEnv *env, jclass cls);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_SetClassSigners(JNIEnv *env, jclass cls, jobjectArray signers);<br>
+<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_GetProtectionDomain(JNIEnv *env, jclass cls);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_SetProtectionDomain(JNIEnv *env, jclass cls, jobject protection_domain);<br>
+<br>
+JNIEXPORT jboolean JNICALL<br>
+JVM_IsArrayClass(JNIEnv *env, jclass cls);<br>
+<br>
+JNIEXPORT jboolean JNICALL<br>
+JVM_IsPrimitiveClass(JNIEnv *env, jclass cls);<br>
+<br>
+JNIEXPORT jclass JNICALL<br>
+JVM_GetComponentType(JNIEnv *env, jclass cls);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetClassModifiers(JNIEnv *env, jclass cls);<br>
+<br>
+JNIEXPORT jobjectArray JNICALL<br>
+JVM_GetDeclaredClasses(JNIEnv *env, jclass ofClass);<br>
+<br>
+JNIEXPORT jclass JNICALL<br>
+JVM_GetDeclaringClass(JNIEnv *env, jclass ofClass);<br>
+<br>
+/* Generics support (JDK 1.5) */<br>
+JNIEXPORT jstring JNICALL<br>
+JVM_GetClassSignature(JNIEnv *env, jclass cls);<br>
+<br>
+/* Annotations support (JDK 1.5) */<br>
+JNIEXPORT jbyteArray JNICALL<br>
+JVM_GetClassAnnotations(JNIEnv *env, jclass cls);<br>
+<br>
+/*<br>
+ * New (JDK 1.4) reflection implementation<br>
+ */<br>
+<br>
+JNIEXPORT jobjectArray JNICALL<br>
+JVM_GetClassDeclaredMethods(JNIEnv *env, jclass ofClass, jboolean publicOnly);<br>
+<br>
+JNIEXPORT jobjectArray JNICALL<br>
+JVM_GetClassDeclaredFields(JNIEnv *env, jclass ofClass, jboolean publicOnly);<br>
+<br>
+JNIEXPORT jobjectArray JNICALL<br>
+JVM_GetClassDeclaredConstructors(JNIEnv *env, jclass ofClass,<br>
jboolean publicOnly);<br>
+<br>
+/* Differs from JVM_GetClassModifiers in treatment of inner classes.<br>
+   This returns the access flags for the class as specified in the<br>
+   class file rather than searching the InnerClasses attribute (if<br>
+   present) to find the source-level access flags. Only the values of<br>
+   the low 13 bits (i.e., a mask of 0x1FFF) are guaranteed to be<br>
+   valid. */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetClassAccessFlags(JNIEnv *env, jclass cls);<br>
+<br>
+/* The following two reflection routines are still needed due to<br>
startup time issues */<br>
+/*<br>
+ * java.lang.reflect.Method<br>
+ */<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_InvokeMethod(JNIEnv *env, jobject method, jobject obj, jobjectArray args0);<br>
+<br>
+/*<br>
+ * java.lang.reflect.Constructor<br>
+ */<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_NewInstanceFromConstructor(JNIEnv *env, jobject c, jobjectArray args0);<br>
+<br>
+/*<br>
+ * Constant pool access; currently used to implement reflective<br>
access to annotations (JDK 1.5)<br>
+ */<br>
+<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_GetClassConstantPool(JNIEnv *env, jclass cls);<br>
+<br>
+JNIEXPORT jint JNICALL JVM_ConstantPoolGetSize<br>
+(JNIEnv *env, jobject unused, jobject jcpool);<br>
+<br>
+JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAt<br>
+(JNIEnv *env, jobject unused, jobject jcpool, jint index);<br>
+<br>
+JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAtIfLoaded<br>
+(JNIEnv *env, jobject unused, jobject jcpool, jint index);<br>
+<br>
+JNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAt<br>
+(JNIEnv *env, jobject unused, jobject jcpool, jint index);<br>
+<br>
+JNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAtIfLoaded<br>
+(JNIEnv *env, jobject unused, jobject jcpool, jint index);<br>
+<br>
+JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAt<br>
+(JNIEnv *env, jobject unused, jobject jcpool, jint index);<br>
+<br>
+JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAtIfLoaded<br>
+(JNIEnv *env, jobject unused, jobject jcpool, jint index);<br>
+<br>
+JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetMemberRefInfoAt<br>
+(JNIEnv *env, jobject unused, jobject jcpool, jint index);<br>
+<br>
+JNIEXPORT jint JNICALL JVM_ConstantPoolGetIntAt<br>
+(JNIEnv *env, jobject unused, jobject jcpool, jint index);<br>
+<br>
+JNIEXPORT jlong JNICALL JVM_ConstantPoolGetLongAt<br>
+(JNIEnv *env, jobject unused, jobject jcpool, jint index);<br>
+<br>
+JNIEXPORT jfloat JNICALL JVM_ConstantPoolGetFloatAt<br>
+(JNIEnv *env, jobject unused, jobject jcpool, jint index);<br>
+<br>
+JNIEXPORT jdouble JNICALL JVM_ConstantPoolGetDoubleAt<br>
+(JNIEnv *env, jobject unused, jobject jcpool, jint index);<br>
+<br>
+JNIEXPORT jstring JNICALL JVM_ConstantPoolGetStringAt<br>
+(JNIEnv *env, jobject unused, jobject jcpool, jint index);<br>
+<br>
+JNIEXPORT jstring JNICALL JVM_ConstantPoolGetUTF8At<br>
+(JNIEnv *env, jobject unused, jobject jcpool, jint index);<br>
+<br>
+/*<br>
+ * java.security.*<br>
+ */<br>
+<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_DoPrivileged(JNIEnv *env, jclass cls,<br>
+                 jobject action, jobject context, jboolean wrapException);<br>
+<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_GetInheritedAccessControlContext(JNIEnv *env, jclass cls);<br>
+<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_GetStackAccessControlContext(JNIEnv *env, jclass cls);<br>
+<br>
+/*<br>
+ * Signal support, used to implement the shutdown sequence.  Every VM must<br>
+ * support JVM_SIGINT and JVM_SIGTERM, raising the former for user interrupts<br>
+ * (^C) and the latter for external termination (kill, system shutdown, etc.).<br>
+ * Other platform-dependent signal values may also be supported.<br>
+ */<br>
+<br>
+JNIEXPORT void * JNICALL<br>
+JVM_RegisterSignal(jint sig, void *handler);<br>
+<br>
+JNIEXPORT jboolean JNICALL<br>
+JVM_RaiseSignal(jint sig);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_FindSignal(const char *name);<br>
+<br>
+/*<br>
+ * Retrieve the assertion directives for the specified class.<br>
+ */<br>
+JNIEXPORT jboolean JNICALL<br>
+JVM_DesiredAssertionStatus(JNIEnv *env, jclass unused, jclass cls);<br>
+<br>
+/*<br>
+ * Retrieve the assertion directives from the VM.<br>
+ */<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_AssertionStatusDirectives(JNIEnv *env, jclass unused);<br>
+<br>
+/*<br>
+ * java.util.concurrent.AtomicLong<br>
+ */<br>
+JNIEXPORT jboolean JNICALL<br>
+JVM_SupportsCX8(void);<br>
+<br>
+/*************************************************************************<br>
+ PART 2: Support for the Verifier and Class File Format Checker<br>
+ ************************************************************************/<br>
+/*<br>
+ * Return the class name in UTF format. The result is valid<br>
+ * until JVM_ReleaseUTf is called.<br>
+ *<br>
+ * The caller must treat the string as a constant and not modify it<br>
+ * in any way.<br>
+ */<br>
+JNIEXPORT const char * JNICALL<br>
+JVM_GetClassNameUTF(JNIEnv *env, jclass cb);<br>
+<br>
+/*<br>
+ * Returns the constant pool types in the buffer provided by "types."<br>
+ */<br>
+JNIEXPORT void JNICALL<br>
+JVM_GetClassCPTypes(JNIEnv *env, jclass cb, unsigned char *types);<br>
+<br>
+/*<br>
+ * Returns the number of Constant Pool entries.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetClassCPEntriesCount(JNIEnv *env, jclass cb);<br>
+<br>
+/*<br>
+ * Returns the number of *declared* fields or methods.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetClassFieldsCount(JNIEnv *env, jclass cb);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetClassMethodsCount(JNIEnv *env, jclass cb);<br>
+<br>
+/*<br>
+ * Returns the CP indexes of exceptions raised by a given method.<br>
+ * Places the result in the given buffer.<br>
+ *<br>
+ * The method is identified by method_index.<br>
+ */<br>
+JNIEXPORT void JNICALL<br>
+JVM_GetMethodIxExceptionIndexes(JNIEnv *env, jclass cb, jint method_index,<br>
+                                unsigned short *exceptions);<br>
+/*<br>
+ * Returns the number of exceptions raised by a given method.<br>
+ * The method is identified by method_index.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetMethodIxExceptionsCount(JNIEnv *env, jclass cb, jint method_index);<br>
+<br>
+/*<br>
+ * Returns the byte code sequence of a given method.<br>
+ * Places the result in the given buffer.<br>
+ *<br>
+ * The method is identified by method_index.<br>
+ */<br>
+JNIEXPORT void JNICALL<br>
+JVM_GetMethodIxByteCode(JNIEnv *env, jclass cb, jint method_index,<br>
+                        unsigned char *code);<br>
+<br>
+/*<br>
+ * Returns the length of the byte code sequence of a given method.<br>
+ * The method is identified by method_index.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetMethodIxByteCodeLength(JNIEnv *env, jclass cb, jint method_index);<br>
+<br>
+/*<br>
+ * A structure used to a capture exception table entry in a Java method.<br>
+ */<br>
+typedef struct {<br>
+    jint start_pc;<br>
+    jint end_pc;<br>
+    jint handler_pc;<br>
+    jint catchType;<br>
+} JVM_ExceptionTableEntryType;<br>
+<br>
+/*<br>
+ * Returns the exception table entry at entry_index of a given method.<br>
+ * Places the result in the given buffer.<br>
+ *<br>
+ * The method is identified by method_index.<br>
+ */<br>
+JNIEXPORT void JNICALL<br>
+JVM_GetMethodIxExceptionTableEntry(JNIEnv *env, jclass cb, jint method_index,<br>
+                                   jint entry_index,<br>
+                                   JVM_ExceptionTableEntryType *entry);<br>
+<br>
+/*<br>
+ * Returns the length of the exception table of a given method.<br>
+ * The method is identified by method_index.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetMethodIxExceptionTableLength(JNIEnv *env, jclass cb, int index);<br>
+<br>
+/*<br>
+ * Returns the modifiers of a given field.<br>
+ * The field is identified by field_index.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetFieldIxModifiers(JNIEnv *env, jclass cb, int index);<br>
+<br>
+/*<br>
+ * Returns the modifiers of a given method.<br>
+ * The method is identified by method_index.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetMethodIxModifiers(JNIEnv *env, jclass cb, int index);<br>
+<br>
+/*<br>
+ * Returns the number of local variables of a given method.<br>
+ * The method is identified by method_index.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetMethodIxLocalsCount(JNIEnv *env, jclass cb, int index);<br>
+<br>
+/*<br>
+ * Returns the number of arguments (including this pointer) of a given method.<br>
+ * The method is identified by method_index.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetMethodIxArgsSize(JNIEnv *env, jclass cb, int index);<br>
+<br>
+/*<br>
+ * Returns the maximum amount of stack (in words) used by a given method.<br>
+ * The method is identified by method_index.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetMethodIxMaxStack(JNIEnv *env, jclass cb, int index);<br>
+<br>
+/*<br>
+ * Is a given method a constructor.<br>
+ * The method is identified by method_index.<br>
+ */<br>
+JNIEXPORT jboolean JNICALL<br>
+JVM_IsConstructorIx(JNIEnv *env, jclass cb, int index);<br>
+<br>
+/*<br>
+ * Returns the name of a given method in UTF format.<br>
+ * The result remains valid until JVM_ReleaseUTF is called.<br>
+ *<br>
+ * The caller must treat the string as a constant and not modify it<br>
+ * in any way.<br>
+ */<br>
+JNIEXPORT const char * JNICALL<br>
+JVM_GetMethodIxNameUTF(JNIEnv *env, jclass cb, jint index);<br>
+<br>
+/*<br>
+ * Returns the signature of a given method in UTF format.<br>
+ * The result remains valid until JVM_ReleaseUTF is called.<br>
+ *<br>
+ * The caller must treat the string as a constant and not modify it<br>
+ * in any way.<br>
+ */<br>
+JNIEXPORT const char * JNICALL<br>
+JVM_GetMethodIxSignatureUTF(JNIEnv *env, jclass cb, jint index);<br>
+<br>
+/*<br>
+ * Returns the name of the field refered to at a given constant pool<br>
+ * index.<br>
+ *<br>
+ * The result is in UTF format and remains valid until JVM_ReleaseUTF<br>
+ * is called.<br>
+ *<br>
+ * The caller must treat the string as a constant and not modify it<br>
+ * in any way.<br>
+ */<br>
+JNIEXPORT const char * JNICALL<br>
+JVM_GetCPFieldNameUTF(JNIEnv *env, jclass cb, jint index);<br>
+<br>
+/*<br>
+ * Returns the name of the method refered to at a given constant pool<br>
+ * index.<br>
+ *<br>
+ * The result is in UTF format and remains valid until JVM_ReleaseUTF<br>
+ * is called.<br>
+ *<br>
+ * The caller must treat the string as a constant and not modify it<br>
+ * in any way.<br>
+ */<br>
+JNIEXPORT const char * JNICALL<br>
+JVM_GetCPMethodNameUTF(JNIEnv *env, jclass cb, jint index);<br>
+<br>
+/*<br>
+ * Returns the signature of the method refered to at a given constant pool<br>
+ * index.<br>
+ *<br>
+ * The result is in UTF format and remains valid until JVM_ReleaseUTF<br>
+ * is called.<br>
+ *<br>
+ * The caller must treat the string as a constant and not modify it<br>
+ * in any way.<br>
+ */<br>
+JNIEXPORT const char * JNICALL<br>
+JVM_GetCPMethodSignatureUTF(JNIEnv *env, jclass cb, jint index);<br>
+<br>
+/*<br>
+ * Returns the signature of the field refered to at a given constant pool<br>
+ * index.<br>
+ *<br>
+ * The result is in UTF format and remains valid until JVM_ReleaseUTF<br>
+ * is called.<br>
+ *<br>
+ * The caller must treat the string as a constant and not modify it<br>
+ * in any way.<br>
+ */<br>
+JNIEXPORT const char * JNICALL<br>
+JVM_GetCPFieldSignatureUTF(JNIEnv *env, jclass cb, jint index);<br>
+<br>
+/*<br>
+ * Returns the class name refered to at a given constant pool index.<br>
+ *<br>
+ * The result is in UTF format and remains valid until JVM_ReleaseUTF<br>
+ * is called.<br>
+ *<br>
+ * The caller must treat the string as a constant and not modify it<br>
+ * in any way.<br>
+ */<br>
+JNIEXPORT const char * JNICALL<br>
+JVM_GetCPClassNameUTF(JNIEnv *env, jclass cb, jint index);<br>
+<br>
+/*<br>
+ * Returns the class name refered to at a given constant pool index.<br>
+ *<br>
+ * The constant pool entry must refer to a CONSTANT_Fieldref.<br>
+ *<br>
+ * The result is in UTF format and remains valid until JVM_ReleaseUTF<br>
+ * is called.<br>
+ *<br>
+ * The caller must treat the string as a constant and not modify it<br>
+ * in any way.<br>
+ */<br>
+JNIEXPORT const char * JNICALL<br>
+JVM_GetCPFieldClassNameUTF(JNIEnv *env, jclass cb, jint index);<br>
+<br>
+/*<br>
+ * Returns the class name refered to at a given constant pool index.<br>
+ *<br>
+ * The constant pool entry must refer to CONSTANT_Methodref or<br>
+ * CONSTANT_InterfaceMethodref.<br>
+ *<br>
+ * The result is in UTF format and remains valid until JVM_ReleaseUTF<br>
+ * is called.<br>
+ *<br>
+ * The caller must treat the string as a constant and not modify it<br>
+ * in any way.<br>
+ */<br>
+JNIEXPORT const char * JNICALL<br>
+JVM_GetCPMethodClassNameUTF(JNIEnv *env, jclass cb, jint index);<br>
+<br>
+/*<br>
+ * Returns the modifiers of a field in calledClass. The field is<br>
+ * referred to in class cb at constant pool entry index.<br>
+ *<br>
+ * The caller must treat the string as a constant and not modify it<br>
+ * in any way.<br>
+ *<br>
+ * Returns -1 if the field does not exist in calledClass.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetCPFieldModifiers(JNIEnv *env, jclass cb, int index, jclass calledClass);<br>
+<br>
+/*<br>
+ * Returns the modifiers of a method in calledClass. The method is<br>
+ * referred to in class cb at constant pool entry index.<br>
+ *<br>
+ * Returns -1 if the method does not exist in calledClass.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetCPMethodModifiers(JNIEnv *env, jclass cb, int index, jclass<br>
calledClass);<br>
+<br>
+/*<br>
+ * Releases the UTF string obtained from the VM.<br>
+ */<br>
+JNIEXPORT void JNICALL<br>
+JVM_ReleaseUTF(const char *utf);<br>
+<br>
+/*<br>
+ * Compare if two classes are in the same package.<br>
+ */<br>
+JNIEXPORT jboolean JNICALL<br>
+JVM_IsSameClassPackage(JNIEnv *env, jclass class1, jclass class2);<br>
+<br>
+/* Constants in class files */<br>
+<br>
+#define JVM_ACC_PUBLIC        0x0001  /* visible to everyone */<br>
+#define JVM_ACC_PRIVATE       0x0002  /* visible only to the defining class */<br>
+#define JVM_ACC_PROTECTED     0x0004  /* visible to subclasses */<br>
+#define JVM_ACC_STATIC        0x0008  /* instance variable is static */<br>
+#define JVM_ACC_FINAL         0x0010  /* no further subclassing, overriding */<br>
+#define JVM_ACC_SYNCHRONIZED  0x0020  /* wrap method call in monitor lock */<br>
+#define JVM_ACC_SUPER         0x0020  /* funky handling of invokespecial */<br>
+#define JVM_ACC_VOLATILE      0x0040  /* can not cache in registers */<br>
+#define JVM_ACC_BRIDGE        0x0040  /* bridge method generated by compiler */<br>
+#define JVM_ACC_TRANSIENT     0x0080  /* not persistant */<br>
+#define JVM_ACC_VARARGS       0x0080  /* method declared with<br>
variable number of args */<br>
+#define JVM_ACC_NATIVE        0x0100  /* implemented in C */<br>
+#define JVM_ACC_INTERFACE     0x0200  /* class is an interface */<br>
+#define JVM_ACC_ABSTRACT      0x0400  /* no definition provided */<br>
+#define JVM_ACC_STRICT        0x0800  /* strict floating point */<br>
+#define JVM_ACC_SYNTHETIC     0x1000  /* compiler-generated class,<br>
method or field */<br>
+<br>
+#define JVM_ACC_ANNOTATION    0x2000  /* annotation type */<br>
+#define JVM_ACC_ENUM          0x4000  /* field is declared as element<br>
of enum */<br>
+<br>
+#define JVM_ACC_PUBLIC_BIT        0<br>
+#define JVM_ACC_PRIVATE_BIT       1<br>
+#define JVM_ACC_PROTECTED_BIT     2<br>
+#define JVM_ACC_STATIC_BIT        3<br>
+#define JVM_ACC_FINAL_BIT         4<br>
+#define JVM_ACC_SYNCHRONIZED_BIT  5<br>
+#define JVM_ACC_SUPER_BIT         5<br>
+#define JVM_ACC_VOLATILE_BIT      6<br>
+#define JVM_ACC_BRIDGE_BIT        6<br>
+#define JVM_ACC_TRANSIENT_BIT     7<br>
+#define JVM_ACC_VARARGS_BIT       7<br>
+#define JVM_ACC_NATIVE_BIT        8<br>
+#define JVM_ACC_INTERFACE_BIT     9<br>
+#define JVM_ACC_ABSTRACT_BIT      10<br>
+#define JVM_ACC_STRICT_BIT        11<br>
+#define JVM_ACC_SYNTHETIC_BIT     12<br>
+#define JVM_ACC_ANNOTATION_BIT    13<br>
+#define JVM_ACC_ENUM_BIT          14<br>
+<br>
+enum {<br>
+    JVM_CONSTANT_Utf8 = 1,<br>
+    JVM_CONSTANT_Unicode,               /* unused */<br>
+    JVM_CONSTANT_Integer,<br>
+    JVM_CONSTANT_Float,<br>
+    JVM_CONSTANT_Long,<br>
+    JVM_CONSTANT_Double,<br>
+    JVM_CONSTANT_Class,<br>
+    JVM_CONSTANT_String,<br>
+    JVM_CONSTANT_Fieldref,<br>
+    JVM_CONSTANT_Methodref,<br>
+    JVM_CONSTANT_InterfaceMethodref,<br>
+    JVM_CONSTANT_NameAndType<br>
+};<br>
+<br>
+/* Used in the newarray instruction. */<br>
+<br>
+#define JVM_T_BOOLEAN 4<br>
+#define JVM_T_CHAR    5<br>
+#define JVM_T_FLOAT   6<br>
+#define JVM_T_DOUBLE  7<br>
+#define JVM_T_BYTE    8<br>
+#define JVM_T_SHORT   9<br>
+#define JVM_T_INT    10<br>
+#define JVM_T_LONG   11<br>
+<br>
+/* JVM method signatures */<br>
+<br>
+#define JVM_SIGNATURE_ARRAY             '['<br>
+#define JVM_SIGNATURE_BYTE              'B'<br>
+#define JVM_SIGNATURE_CHAR              'C'<br>
+#define JVM_SIGNATURE_CLASS             'L'<br>
+#define JVM_SIGNATURE_ENDCLASS          ';'<br>
+#define JVM_SIGNATURE_ENUM              'E'<br>
+#define JVM_SIGNATURE_FLOAT             'F'<br>
+#define JVM_SIGNATURE_DOUBLE            'D'<br>
+#define JVM_SIGNATURE_FUNC              '('<br>
+#define JVM_SIGNATURE_ENDFUNC           ')'<br>
+#define JVM_SIGNATURE_INT               'I'<br>
+#define JVM_SIGNATURE_LONG              'J'<br>
+#define JVM_SIGNATURE_SHORT             'S'<br>
+#define JVM_SIGNATURE_VOID              'V'<br>
+#define JVM_SIGNATURE_BOOLEAN           'Z'<br>
+<br>
+/*<br>
+ * A function defined by the byte-code verifier and called by the VM.<br>
+ * This is not a function implemented in the VM.<br>
+ *<br>
+ * Returns JNI_FALSE if verification fails. A detailed error message<br>
+ * will be places in msg_buf, whose length is specified by buf_len.<br>
+ */<br>
+typedef jboolean (*verifier_fn_t)(JNIEnv *env,<br>
+                                  jclass cb,<br>
+                                  char * msg_buf,<br>
+                                  jint buf_len);<br>
+<br>
+<br>
+/*<br>
+ * Support for a VM-independent class format checker.<br>
+ */<br>
+typedef struct {<br>
+    unsigned long code;    /* byte code */<br>
+    unsigned long excs;    /* exceptions */<br>
+    unsigned long etab;    /* catch table */<br>
+    unsigned long lnum;    /* line number */<br>
+    unsigned long lvar;    /* local vars */<br>
+} method_size_info;<br>
+<br>
+typedef struct {<br>
+    unsigned int constants;    /* constant pool */<br>
+    unsigned int fields;<br>
+    unsigned int methods;<br>
+    unsigned int interfaces;<br>
+    unsigned int fields2;      /* number of static 2-word fields */<br>
+    unsigned int innerclasses; /* # of records in InnerClasses attr */<br>
+<br>
+    method_size_info clinit;   /* memory used in clinit */<br>
+    method_size_info main;     /* used everywhere else */<br>
+} class_size_info;<br>
+<br>
+/*<br>
+ * Functions defined in libjava.so to perform string conversions.<br>
+ *<br>
+ */<br>
+<br>
+typedef jstring (*to_java_string_fn_t)(JNIEnv *env, char *str);<br>
+<br>
+typedef char *(*to_c_string_fn_t)(JNIEnv *env, jstring s, jboolean *b);<br>
+<br>
+/* This is the function defined in libjava.so that performs class<br>
+ * format checks. This functions fills in size information about<br>
+ * the class file and returns:<br>
+ *<br>
+ *   0: good<br>
+ *  -1: out of memory<br>
+ *  -2: bad format<br>
+ *  -3: unsupported version<br>
+ *  -4: bad class name<br>
+ */<br>
+<br>
+typedef jint (*check_format_fn_t)(char *class_name,<br>
+                                  unsigned char *data,<br>
+                                  unsigned int data_size,<br>
+                                  class_size_info *class_size,<br>
+                                  char *message_buffer,<br>
+                                  jint buffer_length,<br>
+                                  jboolean measure_only,<br>
+                                  jboolean check_relaxed);<br>
+<br>
+#define JVM_RECOGNIZED_CLASS_MODIFIERS (JVM_ACC_PUBLIC | \<br>
+                                        JVM_ACC_FINAL | \<br>
+                                        JVM_ACC_SUPER | \<br>
+                                        JVM_ACC_INTERFACE | \<br>
+                                        JVM_ACC_ABSTRACT | \<br>
+                                        JVM_ACC_ANNOTATION | \<br>
+                                        JVM_ACC_ENUM | \<br>
+                                        JVM_ACC_SYNTHETIC)<br>
+<br>
+#define JVM_RECOGNIZED_FIELD_MODIFIERS (JVM_ACC_PUBLIC | \<br>
+                                        JVM_ACC_PRIVATE | \<br>
+                                        JVM_ACC_PROTECTED | \<br>
+                                        JVM_ACC_STATIC | \<br>
+                                        JVM_ACC_FINAL | \<br>
+                                        JVM_ACC_VOLATILE | \<br>
+                                        JVM_ACC_TRANSIENT | \<br>
+                                        JVM_ACC_ENUM | \<br>
+                                        JVM_ACC_SYNTHETIC)<br>
+<br>
+#define JVM_RECOGNIZED_METHOD_MODIFIERS (JVM_ACC_PUBLIC | \<br>
+                                         JVM_ACC_PRIVATE | \<br>
+                                         JVM_ACC_PROTECTED | \<br>
+                                         JVM_ACC_STATIC | \<br>
+                                         JVM_ACC_FINAL | \<br>
+                                         JVM_ACC_SYNCHRONIZED | \<br>
+                                         JVM_ACC_BRIDGE | \<br>
+                                         JVM_ACC_VARARGS | \<br>
+                                         JVM_ACC_NATIVE | \<br>
+                                         JVM_ACC_ABSTRACT | \<br>
+                                         JVM_ACC_STRICT | \<br>
+                                         JVM_ACC_SYNTHETIC)<br>
+<br>
+/*<br>
+ * This is the function defined in libjava.so to perform path<br>
+ * canonicalization. VM call this function before opening jar files<br>
+ * to load system classes.<br>
+ *<br>
+ */<br>
+<br>
+typedef int (*canonicalize_fn_t)(JNIEnv *env, char *orig, char *out, int len);<br>
+<br>
+/*************************************************************************<br>
+ PART 3: I/O and Network Support<br>
+ ************************************************************************/<br>
+<br>
+/* Note that the JVM IO functions are expected to return JVM_IO_ERR<br>
+ * when there is any kind of error. The caller can then use the<br>
+ * platform specific support (e.g., errno) to get the detailed<br>
+ * error info.  The JVM_GetLastErrorString procedure may also be used<br>
+ * to obtain a descriptive error string.<br>
+ */<br>
+#define JVM_IO_ERR  (-1)<br>
+<br>
+/* For interruptible IO. Returning JVM_IO_INTR indicates that an IO<br>
+ * operation has been disrupted by Thread.interrupt. There are a<br>
+ * number of technical difficulties related to interruptible IO that<br>
+ * need to be solved. For example, most existing programs do not handle<br>
+ * InterruptedIOExceptions specially, they simply treat those as any<br>
+ * IOExceptions, which typically indicate fatal errors.<br>
+ *<br>
+ * There are also two modes of operation for interruptible IO. In the<br>
+ * resumption mode, an interrupted IO operation is guaranteed not to<br>
+ * have any side-effects, and can be restarted. In the termination mode,<br>
+ * an interrupted IO operation corrupts the underlying IO stream, so<br>
+ * that the only reasonable operation on an interrupted stream is to<br>
+ * close that stream. The resumption mode seems to be impossible to<br>
+ * implement on Win32 and Solaris. Implementing the termination mode is<br>
+ * easier, but it's not clear that's the right semantics.<br>
+ *<br>
+ * Interruptible IO is not supported on Win32.It can be enabled/disabled<br>
+ * using a compile-time flag on Solaris. Third-party JVM ports do not<br>
+ * need to implement interruptible IO.<br>
+ */<br>
+#define JVM_IO_INTR (-2)<br>
+<br>
+/* Write a string into the given buffer, in the platform's local encoding,<br>
+ * that describes the most recent system-level error to occur in this thread.<br>
+ * Return the length of the string or zero if no error occurred.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetLastErrorString(char *buf, int len);<br>
+<br>
+/*<br>
+ * Convert a pathname into native format.  This function does syntactic<br>
+ * cleanup, such as removing redundant separator characters.  It modifies<br>
+ * the given pathname string in place.<br>
+ */<br>
+JNIEXPORT char * JNICALL<br>
+JVM_NativePath(char *);<br>
+<br>
+/*<br>
+ * JVM I/O error codes<br>
+ */<br>
+#define JVM_EEXIST       -100<br>
+<br>
+/*<br>
+ * Open a file descriptor. This function returns a negative error code<br>
+ * on error, and a non-negative integer that is the file descriptor on<br>
+ * success.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_Open(const char *fname, jint flags, jint mode);<br>
+<br>
+/*<br>
+ * Close a file descriptor. This function returns -1 on error, and 0<br>
+ * on success.<br>
+ *<br>
+ * fd        the file descriptor to close.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_Close(jint fd);<br>
+<br>
+/*<br>
+ * Read data from a file decriptor into a char array.<br>
+ *<br>
+ * fd        the file descriptor to read from.<br>
+ * buf       the buffer where to put the read data.<br>
+ * nbytes    the number of bytes to read.<br>
+ *<br>
+ * This function returns -1 on error, and 0 on success.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_Read(jint fd, char *buf, jint nbytes);<br>
+<br>
+/*<br>
+ * Write data from a char array to a file decriptor.<br>
+ *<br>
+ * fd        the file descriptor to read from.<br>
+ * buf       the buffer from which to fetch the data.<br>
+ * nbytes    the number of bytes to write.<br>
+ *<br>
+ * This function returns -1 on error, and 0 on success.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_Write(jint fd, char *buf, jint nbytes);<br>
+<br>
+/*<br>
+ * Returns the number of bytes available for reading from a given file<br>
+ * descriptor<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_Available(jint fd, jlong *pbytes);<br>
+<br>
+/*<br>
+ * Move the file descriptor pointer from whence by offset.<br>
+ *<br>
+ * fd        the file descriptor to move.<br>
+ * offset    the number of bytes to move it by.<br>
+ * whence    the start from where to move it.<br>
+ *<br>
+ * This function returns the resulting pointer location.<br>
+ */<br>
+JNIEXPORT jlong JNICALL<br>
+JVM_Lseek(jint fd, jlong offset, jint whence);<br>
+<br>
+/*<br>
+ * Set the length of the file associated with the given descriptor to the given<br>
+ * length.  If the new length is longer than the current length then the file<br>
+ * is extended; the contents of the extended portion are not defined.  The<br>
+ * value of the file pointer is undefined after this procedure returns.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_SetLength(jint fd, jlong length);<br>
+<br>
+/*<br>
+ * Synchronize the file descriptor's in memory state with that of the<br>
+ * physical device.  Return of -1 is an error, 0 is OK.<br>
+ */<br>
+JNIEXPORT jint JNICALL<br>
+JVM_Sync(jint fd);<br>
+<br>
+/*<br>
+ * Networking library support<br>
+ */<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_InitializeSocketLibrary(void);<br>
+<br>
+struct sockaddr;<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_Socket(jint domain, jint type, jint protocol);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_SocketClose(jint fd);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_SocketShutdown(jint fd, jint howto);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_Recv(jint fd, char *buf, jint nBytes, jint flags);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_Send(jint fd, char *buf, jint nBytes, jint flags);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_Timeout(int fd, long timeout);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_Listen(jint fd, jint count);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_Connect(jint fd, struct sockaddr *him, jint len);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_Bind(jint fd, struct sockaddr *him, jint len);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_Accept(jint fd, struct sockaddr *him, jint *len);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_RecvFrom(jint fd, char *buf, int nBytes,<br>
+                  int flags, struct sockaddr *from, int *fromlen);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_SendTo(jint fd, char *buf, int len,<br>
+                int flags, struct sockaddr *to, int tolen);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_SocketAvailable(jint fd, jint *result);<br>
+<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetSockName(jint fd, struct sockaddr *him, int *len);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_GetSockOpt(jint fd, int level, int optname, char *optval, int *optlen);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_SetSockOpt(jint fd, int level, int optname, const char *optval,<br>
int optlen);<br>
+<br>
+/*<br>
+ * These routines are only reentrant on Windows<br>
+ */<br>
+<br>
+#ifdef WIN32<br>
+<br>
+JNIEXPORT struct protoent * JNICALL<br>
+JVM_GetProtoByName(char* name);<br>
+<br>
+JNIEXPORT struct hostent* JNICALL<br>
+JVM_GetHostByAddr(const char* name, int len, int type);<br>
+<br>
+JNIEXPORT struct hostent* JNICALL<br>
+JVM_GetHostByName(char* name);<br>
+<br>
+#endif /* _WINDOWS */<br>
+<br>
+JNIEXPORT int JNICALL<br>
+JVM_GetHostName(char* name, int namelen);<br>
+<br>
+/*<br>
+ * The standard printing functions supported by the Java VM. (Should they<br>
+ * be renamed to JVM_* in the future?<br>
+ */<br>
+<br>
+/*<br>
+ * BE CAREFUL! The following functions do not implement the<br>
+ * full feature set of standard C printf formats.<br>
+ */<br>
+int<br>
+jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args);<br>
+<br>
+int<br>
+jio_snprintf(char *str, size_t count, const char *fmt, ...);<br>
+<br>
+int<br>
+jio_fprintf(FILE *, const char *fmt, ...);<br>
+<br>
+int<br>
+jio_vfprintf(FILE *, const char *fmt, va_list args);<br>
+<br>
+<br>
+JNIEXPORT void * JNICALL<br>
+JVM_RawMonitorCreate(void);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_RawMonitorDestroy(void *mon);<br>
+<br>
+JNIEXPORT jint JNICALL<br>
+JVM_RawMonitorEnter(void *mon);<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_RawMonitorExit(void *mon);<br>
+<br>
+/*<br>
+ * java.lang.management support<br>
+ */<br>
+JNIEXPORT void* JNICALL<br>
+JVM_GetManagement(jint version);<br>
+<br>
+/*<br>
+ * com.sun.tools.attach.VirtualMachine support<br>
+ *<br>
+ * Initialize the agent properties with the properties maintained in the VM.<br>
+ */<br>
+JNIEXPORT jobject JNICALL<br>
+JVM_InitAgentProperties(JNIEnv *env, jobject agent_props);<br>
+<br>
+/* Generics reflection support.<br>
+ *<br>
+ * Returns information about the given class's EnclosingMethod<br>
+ * attribute, if present, or null if the class had no enclosing<br>
+ * method.<br>
+ *<br>
+ * If non-null, the returned array contains three elements. Element 0<br>
+ * is the java.lang.Class of which the enclosing method is a member,<br>
+ * and elements 1 and 2 are the java.lang.Strings for the enclosing<br>
+ * method's name and descriptor, respectively.<br>
+ */<br>
+JNIEXPORT jobjectArray JNICALL<br>
+JVM_GetEnclosingMethodInfo(JNIEnv* env, jclass ofClass);<br>
+<br>
+/*<br>
+ * Java thread state support<br>
+ */<br>
+enum {<br>
+    JAVA_THREAD_STATE_NEW           = 0,<br>
+    JAVA_THREAD_STATE_RUNNABLE      = 1,<br>
+    JAVA_THREAD_STATE_BLOCKED       = 2,<br>
+    JAVA_THREAD_STATE_WAITING       = 3,<br>
+    JAVA_THREAD_STATE_TIMED_WAITING = 4,<br>
+    JAVA_THREAD_STATE_TERMINATED    = 5,<br>
+    JAVA_THREAD_STATE_COUNT         = 6<br>
+};<br>
+<br>
+/*<br>
+ * Returns an array of the threadStatus values representing the<br>
+ * given Java thread state.  Returns NULL if the VM version is<br>
+ * incompatible with the JDK or doesn't support the given<br>
+ * Java thread state.<br>
+ */<br>
+JNIEXPORT jintArray JNICALL<br>
+JVM_GetThreadStateValues(JNIEnv* env, jint javaThreadState);<br>
+<br>
+/*<br>
+ * Returns an array of the substate names representing the<br>
+ * given Java thread state.  Returns NULL if the VM version is<br>
+ * incompatible with the JDK or the VM doesn't support<br>
+ * the given Java thread state.<br>
+ * values must be the jintArray returned from JVM_GetThreadStateValues<br>
+ * and javaThreadState.<br>
+ */<br>
+JNIEXPORT jobjectArray JNICALL<br>
+JVM_GetThreadStateNames(JNIEnv* env, jint javaThreadState, jintArray values);<br>
+<br>
+/* =========================================================================<br>
+ * The following defines a private JVM interface that the JDK can query<br>
+ * for the JVM version and capabilities.  sun.misc.Version defines<br>
+ * the methods for getting the VM version and its capabilities.<br>
+ *<br>
+ * When a new bit is added, the following should be updated to provide<br>
+ * access to the new capability:<br>
+ *    HS:   JVM_GetVersionInfo and Abstract_VM_Version class<br>
+ *    SDK:  Version class<br>
+ *<br>
+ * Similary, a private JDK interface JDK_GetVersionInfo0 is defined for<br>
+ * JVM to query for the JDK version and capabilities.<br>
+ *<br>
+ * When a new bit is added, the following should be updated to provide<br>
+ * access to the new capability:<br>
+ *    HS:   JDK_Version class<br>
+ *    SDK:  JDK_GetVersionInfo0<br>
+ *<br>
+ * ==========================================================================<br>
+ */<br>
+typedef struct {<br>
+    /* Naming convention of RE build version string:<br>
n.n.n[_uu[c]][-<identifier>]-bxx */<br>
+    unsigned int jvm_version;   /* Consists of major, minor, micro (n.n.n) */<br>
+                                /* and build number (xx) */<br>
+    unsigned int update_version : 8;         /* Update release version (uu) */<br>
+    unsigned int special_update_version : 8; /* Special update<br>
release version (c)*/<br>
+    unsigned int reserved1 : 16;<br>
+    unsigned int reserved2;<br>
+<br>
+    /* The following bits represents JVM supports that JDK has dependency on.<br>
+     * JDK can use these bits to determine which JVM version<br>
+     * and support it has to maintain runtime compatibility.<br>
+     *<br>
+     * When a new bit is added in a minor or update release, make sure<br>
+     * the new bit is also added in the main/baseline.<br>
+     */<br>
+    unsigned int is_attach_supported : 1;<br>
+    unsigned int is_kernel_jvm : 1;<br>
+    unsigned int : 30;<br>
+    unsigned int : 32;<br>
+    unsigned int : 32;<br>
+} jvm_version_info;<br>
+<br>
+#define JVM_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24)<br>
+#define JVM_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16)<br>
+#define JVM_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8)<br>
+<br>
+/* Build number is available only for RE builds.<br>
+ * It will be zero for internal builds.<br>
+ */<br>
+#define JVM_VERSION_BUILD(version) ((version & 0x000000FF))<br>
+<br>
+JNIEXPORT void JNICALL<br>
+JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t info_size);<br>
+<br>
+typedef struct {<br>
+    // Naming convention of RE build version string:<br>
n.n.n[_uu[c]][-<identifier>]-bxx<br>
+    unsigned int jdk_version;   /* Consists of major, minor, micro (n.n.n) */<br>
+                                /* and build number (xx) */<br>
+    unsigned int update_version : 8;         /* Update release version (uu) */<br>
+    unsigned int special_update_version : 8; /* Special update<br>
release version (c)*/<br>
+    unsigned int reserved1 : 16;<br>
+    unsigned int reserved2;<br>
+<br>
+    /* The following bits represents new JDK supports that VM has<br>
dependency on.<br>
+     * VM implementation can use these bits to determine which JDK version<br>
+     * and support it has to maintain runtime compatibility.<br>
+     *<br>
+     * When a new bit is added in a minor or update release, make sure<br>
+     * the new bit is also added in the main/baseline.<br>
+     */<br>
+    unsigned int thread_park_blocker : 1;<br>
+    unsigned int : 31;<br>
+    unsigned int : 32;<br>
+    unsigned int : 32;<br>
+} jdk_version_info;<br>
+<br>
+#define JDK_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24)<br>
+#define JDK_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16)<br>
+#define JDK_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8)<br>
+<br>
+/* Build number is available only for RE build (i.e. JDK_BUILD_NUMBER<br>
is set to bNN)<br>
+ * It will be zero for internal builds.<br>
+ */<br>
+#define JDK_VERSION_BUILD(version) ((version & 0x000000FF))<br>
+<br>
+/*<br>
+ * This is the function JDK_GetVersionInfo0 defined in libjava.so<br>
+ * that is dynamically looked up by JVM.<br>
+ */<br>
+typedef void (*jdk_version_info_fn_t)(jdk_version_info* info, size_t<br>
info_size);<br>
+<br>
+/*<br>
+ * This structure is used by the launcher to get the default thread<br>
+ * stack size from the VM using JNI_GetDefaultJavaVMInitArgs() with a<br>
+ * version of 1.1.  As it is not supported otherwise, it has been removed<br>
+ * from jni.h<br>
+ */<br>
+typedef struct JDK1_1InitArgs {<br>
+    jint version;<br>
+<br>
+    char **properties;<br>
+    jint checkSource;<br>
+    jint nativeStackSize;<br>
+    jint javaStackSize;<br>
+    jint minHeapSize;<br>
+    jint maxHeapSize;<br>
+    jint verifyMode;<br>
+    char *classpath;<br>
+<br>
+    jint (JNICALL *vfprintf)(FILE *fp, const char *format, va_list args);<br>
+    void (JNICALL *exit)(jint code);<br>
+    void (JNICALL *abort)(void);<br>
+<br>
+    jint enableClassGC;<br>
+    jint enableVerboseGC;<br>
+    jint disableAsyncGC;<br>
+    jint verbose;<br>
+    jboolean debugging;<br>
+    jint debugPort;<br>
+} JDK1_1InitArgs;<br>
+<br>
+// Internal JVM_* calls<br>
+JNIEXPORT jclass JNICALL<br>
+JVM_FindClassFromBootLoader(JNIEnv *env, const char *name);<br>
+<br>
+#ifdef __cplusplus<br>
+} /* extern "C" */<br>
+<br>
+#endif /* __cplusplus */<br>
+<br>
+#endif /* !_JAVASOFT_JVM_H_ */<br>
<font color="#888888">--<br>
1.7.5.1<br>
_______________________________________________<br>
vmkit-commits mailing list<br>
<a href="mailto:vmkit-commits@cs.uiuc.edu">vmkit-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits</a><br>
</font></blockquote></div><br></div>