Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/javavm/export/jvm.h
38813 views
/*1* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#ifndef _JAVASOFT_JVM_H_26#define _JAVASOFT_JVM_H_2728#include <sys/stat.h>2930#include "jni.h"31#include "jvm_md.h"3233#ifdef __cplusplus34extern "C" {35#endif3637/*38* This file contains additional functions exported from the VM.39* These functions are complementary to the standard JNI support.40* There are three parts to this file:41*42* First, this file contains the VM-related functions needed by native43* libraries in the standard Java API. For example, the java.lang.Object44* class needs VM-level functions that wait for and notify monitors.45*46* Second, this file contains the functions and constant definitions47* needed by the byte code verifier and class file format checker.48* These functions allow the verifier and format checker to be written49* in a VM-independent way.50*51* Third, this file contains various I/O and nerwork operations needed52* by the standard Java I/O and network APIs.53*/5455/*56* Bump the version number when either of the following happens:57*58* 1. There is a change in JVM_* functions.59*60* 2. There is a change in the contract between VM and Java classes.61* For example, if the VM relies on a new private field in Thread62* class.63*/6465#define JVM_INTERFACE_VERSION 46667JNIEXPORT jint JNICALL68JVM_GetInterfaceVersion(void);6970/*************************************************************************71PART 1: Functions for Native Libraries72************************************************************************/73/*74* java.lang.Object75*/76JNIEXPORT jint JNICALL77JVM_IHashCode(JNIEnv *env, jobject obj);7879JNIEXPORT void JNICALL80JVM_MonitorWait(JNIEnv *env, jobject obj, jlong ms);8182JNIEXPORT void JNICALL83JVM_MonitorNotify(JNIEnv *env, jobject obj);8485JNIEXPORT void JNICALL86JVM_MonitorNotifyAll(JNIEnv *env, jobject obj);8788JNIEXPORT jobject JNICALL89JVM_Clone(JNIEnv *env, jobject obj);9091/*92* java.lang.String93*/94JNIEXPORT jstring JNICALL95JVM_InternString(JNIEnv *env, jstring str);9697/*98* java.lang.System99*/100JNIEXPORT jlong JNICALL101JVM_CurrentTimeMillis(JNIEnv *env, jclass ignored);102103JNIEXPORT jlong JNICALL104JVM_NanoTime(JNIEnv *env, jclass ignored);105106JNIEXPORT void JNICALL107JVM_ArrayCopy(JNIEnv *env, jclass ignored, jobject src, jint src_pos,108jobject dst, jint dst_pos, jint length);109110JNIEXPORT jobject JNICALL111JVM_InitProperties(JNIEnv *env, jobject p);112113/*114* java.io.File115*/116JNIEXPORT void JNICALL117JVM_OnExit(void (*func)(void));118119/*120* java.nio.Bits121*/122JNIEXPORT void JNICALL123JVM_CopySwapMemory(JNIEnv *env, jobject srcObj, jlong srcOffset,124jobject dstObj, jlong dstOffset, jlong size,125jlong elemSize);126127/*128* java.lang.Runtime129*/130JNIEXPORT void JNICALL131JVM_Exit(jint code);132133JNIEXPORT void JNICALL134JVM_BeforeHalt();135136JNIEXPORT void JNICALL137JVM_Halt(jint code);138139JNIEXPORT void JNICALL140JVM_GC(void);141142/* Returns the number of real-time milliseconds that have elapsed since the143* least-recently-inspected heap object was last inspected by the garbage144* collector.145*146* For simple stop-the-world collectors this value is just the time147* since the most recent collection. For generational collectors it is the148* time since the oldest generation was most recently collected. Other149* collectors are free to return a pessimistic estimate of the elapsed time, or150* simply the time since the last full collection was performed.151*152* Note that in the presence of reference objects, a given object that is no153* longer strongly reachable may have to be inspected multiple times before it154* can be reclaimed.155*/156JNIEXPORT jlong JNICALL157JVM_MaxObjectInspectionAge(void);158159JNIEXPORT void JNICALL160JVM_TraceInstructions(jboolean on);161162JNIEXPORT void JNICALL163JVM_TraceMethodCalls(jboolean on);164165JNIEXPORT jlong JNICALL166JVM_TotalMemory(void);167168JNIEXPORT jlong JNICALL169JVM_FreeMemory(void);170171JNIEXPORT jlong JNICALL172JVM_MaxMemory(void);173174JNIEXPORT jint JNICALL175JVM_ActiveProcessorCount(void);176177JNIEXPORT jboolean JNICALL178JVM_IsUseContainerSupport(void);179180JNIEXPORT void * JNICALL181JVM_LoadLibrary(const char *name);182183JNIEXPORT void JNICALL184JVM_UnloadLibrary(void * handle);185186JNIEXPORT void * JNICALL187JVM_FindLibraryEntry(void *handle, const char *name);188189JNIEXPORT jboolean JNICALL190JVM_IsSupportedJNIVersion(jint version);191192/*193* java.lang.Float and java.lang.Double194*/195JNIEXPORT jboolean JNICALL196JVM_IsNaN(jdouble d);197198/*199* java.lang.Throwable200*/201JNIEXPORT void JNICALL202JVM_FillInStackTrace(JNIEnv *env, jobject throwable);203204JNIEXPORT jint JNICALL205JVM_GetStackTraceDepth(JNIEnv *env, jobject throwable);206207JNIEXPORT jobject JNICALL208JVM_GetStackTraceElement(JNIEnv *env, jobject throwable, jint index);209210/*211* java.lang.Compiler212*/213JNIEXPORT void JNICALL214JVM_InitializeCompiler (JNIEnv *env, jclass compCls);215216JNIEXPORT jboolean JNICALL217JVM_IsSilentCompiler(JNIEnv *env, jclass compCls);218219JNIEXPORT jboolean JNICALL220JVM_CompileClass(JNIEnv *env, jclass compCls, jclass cls);221222JNIEXPORT jboolean JNICALL223JVM_CompileClasses(JNIEnv *env, jclass cls, jstring jname);224225JNIEXPORT jobject JNICALL226JVM_CompilerCommand(JNIEnv *env, jclass compCls, jobject arg);227228JNIEXPORT void JNICALL229JVM_EnableCompiler(JNIEnv *env, jclass compCls);230231JNIEXPORT void JNICALL232JVM_DisableCompiler(JNIEnv *env, jclass compCls);233234/*235* java.lang.Thread236*/237JNIEXPORT void JNICALL238JVM_StartThread(JNIEnv *env, jobject thread);239240JNIEXPORT void JNICALL241JVM_StopThread(JNIEnv *env, jobject thread, jobject exception);242243JNIEXPORT jboolean JNICALL244JVM_IsThreadAlive(JNIEnv *env, jobject thread);245246JNIEXPORT void JNICALL247JVM_SuspendThread(JNIEnv *env, jobject thread);248249JNIEXPORT void JNICALL250JVM_ResumeThread(JNIEnv *env, jobject thread);251252JNIEXPORT void JNICALL253JVM_SetThreadPriority(JNIEnv *env, jobject thread, jint prio);254255JNIEXPORT void JNICALL256JVM_Yield(JNIEnv *env, jclass threadClass);257258JNIEXPORT void JNICALL259JVM_Sleep(JNIEnv *env, jclass threadClass, jlong millis);260261JNIEXPORT jobject JNICALL262JVM_CurrentThread(JNIEnv *env, jclass threadClass);263264JNIEXPORT jint JNICALL265JVM_CountStackFrames(JNIEnv *env, jobject thread);266267JNIEXPORT void JNICALL268JVM_Interrupt(JNIEnv *env, jobject thread);269270JNIEXPORT jboolean JNICALL271JVM_IsInterrupted(JNIEnv *env, jobject thread, jboolean clearInterrupted);272273JNIEXPORT jboolean JNICALL274JVM_HoldsLock(JNIEnv *env, jclass threadClass, jobject obj);275276JNIEXPORT void JNICALL277JVM_DumpAllStacks(JNIEnv *env, jclass unused);278279JNIEXPORT jobjectArray JNICALL280JVM_GetAllThreads(JNIEnv *env, jclass dummy);281282JNIEXPORT void JNICALL283JVM_SetNativeThreadName(JNIEnv *env, jobject jthread, jstring name);284285/* getStackTrace() and getAllStackTraces() method */286JNIEXPORT jobjectArray JNICALL287JVM_DumpThreads(JNIEnv *env, jclass threadClass, jobjectArray threads);288289/*290* java.lang.SecurityManager291*/292JNIEXPORT jclass JNICALL293JVM_CurrentLoadedClass(JNIEnv *env);294295JNIEXPORT jobject JNICALL296JVM_CurrentClassLoader(JNIEnv *env);297298JNIEXPORT jobjectArray JNICALL299JVM_GetClassContext(JNIEnv *env);300301JNIEXPORT jint JNICALL302JVM_ClassDepth(JNIEnv *env, jstring name);303304JNIEXPORT jint JNICALL305JVM_ClassLoaderDepth(JNIEnv *env);306307/*308* java.lang.Package309*/310JNIEXPORT jstring JNICALL311JVM_GetSystemPackage(JNIEnv *env, jstring name);312313JNIEXPORT jobjectArray JNICALL314JVM_GetSystemPackages(JNIEnv *env);315316/*317* java.io.ObjectInputStream318*/319JNIEXPORT jobject JNICALL320JVM_AllocateNewObject(JNIEnv *env, jobject obj, jclass currClass,321jclass initClass);322323JNIEXPORT jobject JNICALL324JVM_AllocateNewArray(JNIEnv *env, jobject obj, jclass currClass,325jint length);326327JNIEXPORT jobject JNICALL328JVM_LatestUserDefinedLoader(JNIEnv *env);329330/*331* This function has been deprecated and should not be considered332* part of the specified JVM interface.333*/334JNIEXPORT jclass JNICALL335JVM_LoadClass0(JNIEnv *env, jobject obj, jclass currClass,336jstring currClassName);337338/*339* java.lang.reflect.Array340*/341JNIEXPORT jint JNICALL342JVM_GetArrayLength(JNIEnv *env, jobject arr);343344JNIEXPORT jobject JNICALL345JVM_GetArrayElement(JNIEnv *env, jobject arr, jint index);346347JNIEXPORT jvalue JNICALL348JVM_GetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jint wCode);349350JNIEXPORT void JNICALL351JVM_SetArrayElement(JNIEnv *env, jobject arr, jint index, jobject val);352353JNIEXPORT void JNICALL354JVM_SetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jvalue v,355unsigned char vCode);356357JNIEXPORT jobject JNICALL358JVM_NewArray(JNIEnv *env, jclass eltClass, jint length);359360JNIEXPORT jobject JNICALL361JVM_NewMultiArray(JNIEnv *env, jclass eltClass, jintArray dim);362363/*364* java.lang.Class and java.lang.ClassLoader365*/366367#define JVM_CALLER_DEPTH -1368369/*370* Returns the immediate caller class of the native method invoking371* JVM_GetCallerClass. The Method.invoke and other frames due to372* reflection machinery are skipped.373*374* The depth parameter must be -1 (JVM_DEPTH). The caller is expected375* to be marked with sun.reflect.CallerSensitive. The JVM will throw376* an error if it is not marked propertly.377*/378JNIEXPORT jclass JNICALL379JVM_GetCallerClass(JNIEnv *env, int depth);380381382/*383* Find primitive classes384* utf: class name385*/386JNIEXPORT jclass JNICALL387JVM_FindPrimitiveClass(JNIEnv *env, const char *utf);388389/*390* Link the class391*/392JNIEXPORT void JNICALL393JVM_ResolveClass(JNIEnv *env, jclass cls);394395/*396* Find a class from a boot class loader. Returns NULL if class not found.397*/398JNIEXPORT jclass JNICALL399JVM_FindClassFromBootLoader(JNIEnv *env, const char *name);400401/*402* Find a class from a given class loader. Throws ClassNotFoundException.403* name: name of class404* init: whether initialization is done405* loader: class loader to look up the class. This may not be the same as the caller's406* class loader.407* caller: initiating class. The initiating class may be null when a security408* manager is not installed.409*/410JNIEXPORT jclass JNICALL411JVM_FindClassFromCaller(JNIEnv *env, const char *name, jboolean init,412jobject loader, jclass caller);413414/*415* Find a class from a given class loader. Throw ClassNotFoundException416* or NoClassDefFoundError depending on the value of the last417* argument.418*/419JNIEXPORT jclass JNICALL420JVM_FindClassFromClassLoader(JNIEnv *env, const char *name, jboolean init,421jobject loader, jboolean throwError);422423/*424* Find a class from a given class.425*/426JNIEXPORT jclass JNICALL427JVM_FindClassFromClass(JNIEnv *env, const char *name, jboolean init,428jclass from);429430/* Find a loaded class cached by the VM */431JNIEXPORT jclass JNICALL432JVM_FindLoadedClass(JNIEnv *env, jobject loader, jstring name);433434/* Define a class */435JNIEXPORT jclass JNICALL436JVM_DefineClass(JNIEnv *env, const char *name, jobject loader, const jbyte *buf,437jsize len, jobject pd);438439/* Define a class with a source (added in JDK1.5) */440JNIEXPORT jclass JNICALL441JVM_DefineClassWithSource(JNIEnv *env, const char *name, jobject loader,442const jbyte *buf, jsize len, jobject pd,443const char *source);444445/*446* Reflection support functions447*/448449JNIEXPORT jstring JNICALL450JVM_GetClassName(JNIEnv *env, jclass cls);451452JNIEXPORT jobjectArray JNICALL453JVM_GetClassInterfaces(JNIEnv *env, jclass cls);454455JNIEXPORT jboolean JNICALL456JVM_IsInterface(JNIEnv *env, jclass cls);457458JNIEXPORT jobjectArray JNICALL459JVM_GetClassSigners(JNIEnv *env, jclass cls);460461JNIEXPORT void JNICALL462JVM_SetClassSigners(JNIEnv *env, jclass cls, jobjectArray signers);463464JNIEXPORT jobject JNICALL465JVM_GetProtectionDomain(JNIEnv *env, jclass cls);466467JNIEXPORT jboolean JNICALL468JVM_IsArrayClass(JNIEnv *env, jclass cls);469470JNIEXPORT jboolean JNICALL471JVM_IsPrimitiveClass(JNIEnv *env, jclass cls);472473JNIEXPORT jclass JNICALL474JVM_GetComponentType(JNIEnv *env, jclass cls);475476JNIEXPORT jint JNICALL477JVM_GetClassModifiers(JNIEnv *env, jclass cls);478479JNIEXPORT jobjectArray JNICALL480JVM_GetDeclaredClasses(JNIEnv *env, jclass ofClass);481482JNIEXPORT jclass JNICALL483JVM_GetDeclaringClass(JNIEnv *env, jclass ofClass);484485/* Generics support (JDK 1.5) */486JNIEXPORT jstring JNICALL487JVM_GetClassSignature(JNIEnv *env, jclass cls);488489/* Annotations support (JDK 1.5) */490JNIEXPORT jbyteArray JNICALL491JVM_GetClassAnnotations(JNIEnv *env, jclass cls);492493/* Type use annotations support (JDK 1.8) */494495JNIEXPORT jbyteArray JNICALL496JVM_GetClassTypeAnnotations(JNIEnv *env, jclass cls);497498JNIEXPORT jbyteArray JNICALL499JVM_GetFieldTypeAnnotations(JNIEnv *env, jobject field);500501JNIEXPORT jbyteArray JNICALL502JVM_GetMethodTypeAnnotations(JNIEnv *env, jobject method);503504/*505* New (JDK 1.4) reflection implementation506*/507508JNIEXPORT jobjectArray JNICALL509JVM_GetClassDeclaredMethods(JNIEnv *env, jclass ofClass, jboolean publicOnly);510511JNIEXPORT jobjectArray JNICALL512JVM_GetClassDeclaredFields(JNIEnv *env, jclass ofClass, jboolean publicOnly);513514JNIEXPORT jobjectArray JNICALL515JVM_GetClassDeclaredConstructors(JNIEnv *env, jclass ofClass, jboolean publicOnly);516517/* Differs from JVM_GetClassModifiers in treatment of inner classes.518This returns the access flags for the class as specified in the519class file rather than searching the InnerClasses attribute (if520present) to find the source-level access flags. Only the values of521the low 13 bits (i.e., a mask of 0x1FFF) are guaranteed to be522valid. */523JNIEXPORT jint JNICALL524JVM_GetClassAccessFlags(JNIEnv *env, jclass cls);525526/* The following two reflection routines are still needed due to startup time issues */527/*528* java.lang.reflect.Method529*/530JNIEXPORT jobject JNICALL531JVM_InvokeMethod(JNIEnv *env, jobject method, jobject obj, jobjectArray args0);532533/*534* java.lang.reflect.Constructor535*/536JNIEXPORT jobject JNICALL537JVM_NewInstanceFromConstructor(JNIEnv *env, jobject c, jobjectArray args0);538539/*540* Constant pool access; currently used to implement reflective access to annotations (JDK 1.5)541*/542543JNIEXPORT jobject JNICALL544JVM_GetClassConstantPool(JNIEnv *env, jclass cls);545546JNIEXPORT jint JNICALL JVM_ConstantPoolGetSize547(JNIEnv *env, jobject unused, jobject jcpool);548549JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAt550(JNIEnv *env, jobject unused, jobject jcpool, jint index);551552JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAtIfLoaded553(JNIEnv *env, jobject unused, jobject jcpool, jint index);554555JNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAt556(JNIEnv *env, jobject unused, jobject jcpool, jint index);557558JNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAtIfLoaded559(JNIEnv *env, jobject unused, jobject jcpool, jint index);560561JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAt562(JNIEnv *env, jobject unused, jobject jcpool, jint index);563564JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAtIfLoaded565(JNIEnv *env, jobject unused, jobject jcpool, jint index);566567JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetMemberRefInfoAt568(JNIEnv *env, jobject unused, jobject jcpool, jint index);569570JNIEXPORT jint JNICALL JVM_ConstantPoolGetIntAt571(JNIEnv *env, jobject unused, jobject jcpool, jint index);572573JNIEXPORT jlong JNICALL JVM_ConstantPoolGetLongAt574(JNIEnv *env, jobject unused, jobject jcpool, jint index);575576JNIEXPORT jfloat JNICALL JVM_ConstantPoolGetFloatAt577(JNIEnv *env, jobject unused, jobject jcpool, jint index);578579JNIEXPORT jdouble JNICALL JVM_ConstantPoolGetDoubleAt580(JNIEnv *env, jobject unused, jobject jcpool, jint index);581582JNIEXPORT jstring JNICALL JVM_ConstantPoolGetStringAt583(JNIEnv *env, jobject unused, jobject jcpool, jint index);584585JNIEXPORT jstring JNICALL JVM_ConstantPoolGetUTF8At586(JNIEnv *env, jobject unused, jobject jcpool, jint index);587588/*589* Parameter reflection590*/591592JNIEXPORT jobjectArray JNICALL593JVM_GetMethodParameters(JNIEnv *env, jobject method);594595/*596* java.security.*597*/598599JNIEXPORT jobject JNICALL600JVM_DoPrivileged(JNIEnv *env, jclass cls,601jobject action, jobject context, jboolean wrapException);602603JNIEXPORT jobject JNICALL604JVM_GetInheritedAccessControlContext(JNIEnv *env, jclass cls);605606JNIEXPORT jobject JNICALL607JVM_GetStackAccessControlContext(JNIEnv *env, jclass cls);608609/*610* Signal support, used to implement the shutdown sequence. Every VM must611* support JVM_SIGINT and JVM_SIGTERM, raising the former for user interrupts612* (^C) and the latter for external termination (kill, system shutdown, etc.).613* Other platform-dependent signal values may also be supported.614*/615616JNIEXPORT void * JNICALL617JVM_RegisterSignal(jint sig, void *handler);618619JNIEXPORT jboolean JNICALL620JVM_RaiseSignal(jint sig);621622JNIEXPORT jint JNICALL623JVM_FindSignal(const char *name);624625/*626* Retrieve the assertion directives for the specified class.627*/628JNIEXPORT jboolean JNICALL629JVM_DesiredAssertionStatus(JNIEnv *env, jclass unused, jclass cls);630631/*632* Retrieve the assertion directives from the VM.633*/634JNIEXPORT jobject JNICALL635JVM_AssertionStatusDirectives(JNIEnv *env, jclass unused);636637/*638* java.util.concurrent.atomic.AtomicLong639*/640JNIEXPORT jboolean JNICALL641JVM_SupportsCX8(void);642643/*644* com.sun.dtrace.jsdt support645*/646647#define JVM_TRACING_DTRACE_VERSION 1648649/*650* Structure to pass one probe description to JVM651*/652typedef struct {653jmethodID method;654jstring function;655jstring name;656void* reserved[4]; // for future use657} JVM_DTraceProbe;658659/**660* Encapsulates the stability ratings for a DTrace provider field661*/662typedef struct {663jint nameStability;664jint dataStability;665jint dependencyClass;666} JVM_DTraceInterfaceAttributes;667668/*669* Structure to pass one provider description to JVM670*/671typedef struct {672jstring name;673JVM_DTraceProbe* probes;674jint probe_count;675JVM_DTraceInterfaceAttributes providerAttributes;676JVM_DTraceInterfaceAttributes moduleAttributes;677JVM_DTraceInterfaceAttributes functionAttributes;678JVM_DTraceInterfaceAttributes nameAttributes;679JVM_DTraceInterfaceAttributes argsAttributes;680void* reserved[4]; // for future use681} JVM_DTraceProvider;682683/*684* Get the version number the JVM was built with685*/686JNIEXPORT jint JNICALL687JVM_DTraceGetVersion(JNIEnv* env);688689/*690* Register new probe with given signature, return global handle691*692* The version passed in is the version that the library code was693* built with.694*/695JNIEXPORT jlong JNICALL696JVM_DTraceActivate(JNIEnv* env, jint version, jstring module_name,697jint providers_count, JVM_DTraceProvider* providers);698699/*700* Check JSDT probe701*/702JNIEXPORT jboolean JNICALL703JVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method);704705/*706* Destroy custom DOF707*/708JNIEXPORT void JNICALL709JVM_DTraceDispose(JNIEnv* env, jlong activation_handle);710711/*712* Check to see if DTrace is supported by OS713*/714JNIEXPORT jboolean JNICALL715JVM_DTraceIsSupported(JNIEnv* env);716717/*************************************************************************718PART 2: Support for the Verifier and Class File Format Checker719************************************************************************/720/*721* Return the class name in UTF format. The result is valid722* until JVM_ReleaseUTf is called.723*724* The caller must treat the string as a constant and not modify it725* in any way.726*/727JNIEXPORT const char * JNICALL728JVM_GetClassNameUTF(JNIEnv *env, jclass cb);729730/*731* Returns the constant pool types in the buffer provided by "types."732*/733JNIEXPORT void JNICALL734JVM_GetClassCPTypes(JNIEnv *env, jclass cb, unsigned char *types);735736/*737* Returns the number of Constant Pool entries.738*/739JNIEXPORT jint JNICALL740JVM_GetClassCPEntriesCount(JNIEnv *env, jclass cb);741742/*743* Returns the number of *declared* fields or methods.744*/745JNIEXPORT jint JNICALL746JVM_GetClassFieldsCount(JNIEnv *env, jclass cb);747748JNIEXPORT jint JNICALL749JVM_GetClassMethodsCount(JNIEnv *env, jclass cb);750751/*752* Returns the CP indexes of exceptions raised by a given method.753* Places the result in the given buffer.754*755* The method is identified by method_index.756*/757JNIEXPORT void JNICALL758JVM_GetMethodIxExceptionIndexes(JNIEnv *env, jclass cb, jint method_index,759unsigned short *exceptions);760/*761* Returns the number of exceptions raised by a given method.762* The method is identified by method_index.763*/764JNIEXPORT jint JNICALL765JVM_GetMethodIxExceptionsCount(JNIEnv *env, jclass cb, jint method_index);766767/*768* Returns the byte code sequence of a given method.769* Places the result in the given buffer.770*771* The method is identified by method_index.772*/773JNIEXPORT void JNICALL774JVM_GetMethodIxByteCode(JNIEnv *env, jclass cb, jint method_index,775unsigned char *code);776777/*778* Returns the length of the byte code sequence of a given method.779* The method is identified by method_index.780*/781JNIEXPORT jint JNICALL782JVM_GetMethodIxByteCodeLength(JNIEnv *env, jclass cb, jint method_index);783784/*785* A structure used to a capture exception table entry in a Java method.786*/787typedef struct {788jint start_pc;789jint end_pc;790jint handler_pc;791jint catchType;792} JVM_ExceptionTableEntryType;793794/*795* Returns the exception table entry at entry_index of a given method.796* Places the result in the given buffer.797*798* The method is identified by method_index.799*/800JNIEXPORT void JNICALL801JVM_GetMethodIxExceptionTableEntry(JNIEnv *env, jclass cb, jint method_index,802jint entry_index,803JVM_ExceptionTableEntryType *entry);804805/*806* Returns the length of the exception table of a given method.807* The method is identified by method_index.808*/809JNIEXPORT jint JNICALL810JVM_GetMethodIxExceptionTableLength(JNIEnv *env, jclass cb, int index);811812/*813* Returns the modifiers of a given field.814* The field is identified by field_index.815*/816JNIEXPORT jint JNICALL817JVM_GetFieldIxModifiers(JNIEnv *env, jclass cb, int index);818819/*820* Returns the modifiers of a given method.821* The method is identified by method_index.822*/823JNIEXPORT jint JNICALL824JVM_GetMethodIxModifiers(JNIEnv *env, jclass cb, int index);825826/*827* Returns the number of local variables of a given method.828* The method is identified by method_index.829*/830JNIEXPORT jint JNICALL831JVM_GetMethodIxLocalsCount(JNIEnv *env, jclass cb, int index);832833/*834* Returns the number of arguments (including this pointer) of a given method.835* The method is identified by method_index.836*/837JNIEXPORT jint JNICALL838JVM_GetMethodIxArgsSize(JNIEnv *env, jclass cb, int index);839840/*841* Returns the maximum amount of stack (in words) used by a given method.842* The method is identified by method_index.843*/844JNIEXPORT jint JNICALL845JVM_GetMethodIxMaxStack(JNIEnv *env, jclass cb, int index);846847/*848* Is a given method a constructor.849* The method is identified by method_index.850*/851JNIEXPORT jboolean JNICALL852JVM_IsConstructorIx(JNIEnv *env, jclass cb, int index);853854/*855* Is the given method generated by the VM.856* The method is identified by method_index.857*/858JNIEXPORT jboolean JNICALL859JVM_IsVMGeneratedMethodIx(JNIEnv *env, jclass cb, int index);860861/*862* Returns the name of a given method in UTF format.863* The result remains valid until JVM_ReleaseUTF is called.864*865* The caller must treat the string as a constant and not modify it866* in any way.867*/868JNIEXPORT const char * JNICALL869JVM_GetMethodIxNameUTF(JNIEnv *env, jclass cb, jint index);870871/*872* Returns the signature of a given method in UTF format.873* The result remains valid until JVM_ReleaseUTF is called.874*875* The caller must treat the string as a constant and not modify it876* in any way.877*/878JNIEXPORT const char * JNICALL879JVM_GetMethodIxSignatureUTF(JNIEnv *env, jclass cb, jint index);880881/*882* Returns the name of the field referred to at a given constant pool883* index.884*885* The result is in UTF format and remains valid until JVM_ReleaseUTF886* is called.887*888* The caller must treat the string as a constant and not modify it889* in any way.890*/891JNIEXPORT const char * JNICALL892JVM_GetCPFieldNameUTF(JNIEnv *env, jclass cb, jint index);893894/*895* Returns the name of the method referred to at a given constant pool896* index.897*898* The result is in UTF format and remains valid until JVM_ReleaseUTF899* is called.900*901* The caller must treat the string as a constant and not modify it902* in any way.903*/904JNIEXPORT const char * JNICALL905JVM_GetCPMethodNameUTF(JNIEnv *env, jclass cb, jint index);906907/*908* Returns the signature of the method referred to at a given constant pool909* index.910*911* The result is in UTF format and remains valid until JVM_ReleaseUTF912* is called.913*914* The caller must treat the string as a constant and not modify it915* in any way.916*/917JNIEXPORT const char * JNICALL918JVM_GetCPMethodSignatureUTF(JNIEnv *env, jclass cb, jint index);919920/*921* Returns the signature of the field referred to at a given constant pool922* index.923*924* The result is in UTF format and remains valid until JVM_ReleaseUTF925* is called.926*927* The caller must treat the string as a constant and not modify it928* in any way.929*/930JNIEXPORT const char * JNICALL931JVM_GetCPFieldSignatureUTF(JNIEnv *env, jclass cb, jint index);932933/*934* Returns the class name referred to at a given constant pool index.935*936* The result is in UTF format and remains valid until JVM_ReleaseUTF937* is called.938*939* The caller must treat the string as a constant and not modify it940* in any way.941*/942JNIEXPORT const char * JNICALL943JVM_GetCPClassNameUTF(JNIEnv *env, jclass cb, jint index);944945/*946* Returns the class name referred to at a given constant pool index.947*948* The constant pool entry must refer to a CONSTANT_Fieldref.949*950* The result is in UTF format and remains valid until JVM_ReleaseUTF951* is called.952*953* The caller must treat the string as a constant and not modify it954* in any way.955*/956JNIEXPORT const char * JNICALL957JVM_GetCPFieldClassNameUTF(JNIEnv *env, jclass cb, jint index);958959/*960* Returns the class name referred to at a given constant pool index.961*962* The constant pool entry must refer to CONSTANT_Methodref or963* CONSTANT_InterfaceMethodref.964*965* The result is in UTF format and remains valid until JVM_ReleaseUTF966* is called.967*968* The caller must treat the string as a constant and not modify it969* in any way.970*/971JNIEXPORT const char * JNICALL972JVM_GetCPMethodClassNameUTF(JNIEnv *env, jclass cb, jint index);973974/*975* Returns the modifiers of a field in calledClass. The field is976* referred to in class cb at constant pool entry index.977*978* The caller must treat the string as a constant and not modify it979* in any way.980*981* Returns -1 if the field does not exist in calledClass.982*/983JNIEXPORT jint JNICALL984JVM_GetCPFieldModifiers(JNIEnv *env, jclass cb, int index, jclass calledClass);985986/*987* Returns the modifiers of a method in calledClass. The method is988* referred to in class cb at constant pool entry index.989*990* Returns -1 if the method does not exist in calledClass.991*/992JNIEXPORT jint JNICALL993JVM_GetCPMethodModifiers(JNIEnv *env, jclass cb, int index, jclass calledClass);994995/*996* Releases the UTF string obtained from the VM.997*/998JNIEXPORT void JNICALL999JVM_ReleaseUTF(const char *utf);10001001/*1002* Compare if two classes are in the same package.1003*/1004JNIEXPORT jboolean JNICALL1005JVM_IsSameClassPackage(JNIEnv *env, jclass class1, jclass class2);10061007/* Get classfile constants */1008#include "classfile_constants.h"10091010/*1011* A function defined by the byte-code verifier and called by the VM.1012* This is not a function implemented in the VM.1013*1014* Returns JNI_FALSE if verification fails. A detailed error message1015* will be places in msg_buf, whose length is specified by buf_len.1016*/1017typedef jboolean (*verifier_fn_t)(JNIEnv *env,1018jclass cb,1019char * msg_buf,1020jint buf_len);102110221023/*1024* Support for a VM-independent class format checker.1025*/1026typedef struct {1027unsigned long code; /* byte code */1028unsigned long excs; /* exceptions */1029unsigned long etab; /* catch table */1030unsigned long lnum; /* line number */1031unsigned long lvar; /* local vars */1032} method_size_info;10331034typedef struct {1035unsigned int constants; /* constant pool */1036unsigned int fields;1037unsigned int methods;1038unsigned int interfaces;1039unsigned int fields2; /* number of static 2-word fields */1040unsigned int innerclasses; /* # of records in InnerClasses attr */10411042method_size_info clinit; /* memory used in clinit */1043method_size_info main; /* used everywhere else */1044} class_size_info;10451046/*1047* Functions defined in libjava.so to perform string conversions.1048*1049*/10501051typedef jstring (*to_java_string_fn_t)(JNIEnv *env, char *str);10521053typedef char *(*to_c_string_fn_t)(JNIEnv *env, jstring s, jboolean *b);10541055/* This is the function defined in libjava.so that performs class1056* format checks. This functions fills in size information about1057* the class file and returns:1058*1059* 0: good1060* -1: out of memory1061* -2: bad format1062* -3: unsupported version1063* -4: bad class name1064*/10651066typedef jint (*check_format_fn_t)(char *class_name,1067unsigned char *data,1068unsigned int data_size,1069class_size_info *class_size,1070char *message_buffer,1071jint buffer_length,1072jboolean measure_only,1073jboolean check_relaxed);10741075#define JVM_RECOGNIZED_CLASS_MODIFIERS (JVM_ACC_PUBLIC | \1076JVM_ACC_FINAL | \1077JVM_ACC_SUPER | \1078JVM_ACC_INTERFACE | \1079JVM_ACC_ABSTRACT | \1080JVM_ACC_ANNOTATION | \1081JVM_ACC_ENUM | \1082JVM_ACC_SYNTHETIC)10831084#define JVM_RECOGNIZED_FIELD_MODIFIERS (JVM_ACC_PUBLIC | \1085JVM_ACC_PRIVATE | \1086JVM_ACC_PROTECTED | \1087JVM_ACC_STATIC | \1088JVM_ACC_FINAL | \1089JVM_ACC_VOLATILE | \1090JVM_ACC_TRANSIENT | \1091JVM_ACC_ENUM | \1092JVM_ACC_SYNTHETIC)10931094#define JVM_RECOGNIZED_METHOD_MODIFIERS (JVM_ACC_PUBLIC | \1095JVM_ACC_PRIVATE | \1096JVM_ACC_PROTECTED | \1097JVM_ACC_STATIC | \1098JVM_ACC_FINAL | \1099JVM_ACC_SYNCHRONIZED | \1100JVM_ACC_BRIDGE | \1101JVM_ACC_VARARGS | \1102JVM_ACC_NATIVE | \1103JVM_ACC_ABSTRACT | \1104JVM_ACC_STRICT | \1105JVM_ACC_SYNTHETIC)11061107/*1108* This is the function defined in libjava.so to perform path1109* canonicalization. VM call this function before opening jar files1110* to load system classes.1111*1112*/11131114typedef int (*canonicalize_fn_t)(JNIEnv *env, char *orig, char *out, int len);11151116/*************************************************************************1117PART 3: I/O and Network Support1118************************************************************************/11191120/* Note that the JVM IO functions are expected to return JVM_IO_ERR1121* when there is any kind of error. The caller can then use the1122* platform specific support (e.g., errno) to get the detailed1123* error info. The JVM_GetLastErrorString procedure may also be used1124* to obtain a descriptive error string.1125*/1126#define JVM_IO_ERR (-1)11271128/* For interruptible IO. Returning JVM_IO_INTR indicates that an IO1129* operation has been disrupted by Thread.interrupt. There are a1130* number of technical difficulties related to interruptible IO that1131* need to be solved. For example, most existing programs do not handle1132* InterruptedIOExceptions specially, they simply treat those as any1133* IOExceptions, which typically indicate fatal errors.1134*1135* There are also two modes of operation for interruptible IO. In the1136* resumption mode, an interrupted IO operation is guaranteed not to1137* have any side-effects, and can be restarted. In the termination mode,1138* an interrupted IO operation corrupts the underlying IO stream, so1139* that the only reasonable operation on an interrupted stream is to1140* close that stream. The resumption mode seems to be impossible to1141* implement on Win32 and Solaris. Implementing the termination mode is1142* easier, but it's not clear that's the right semantics.1143*1144* Interruptible IO is not supported on Win32.It can be enabled/disabled1145* using a compile-time flag on Solaris. Third-party JVM ports do not1146* need to implement interruptible IO.1147*/1148#define JVM_IO_INTR (-2)11491150/* Write a string into the given buffer, in the platform's local encoding,1151* that describes the most recent system-level error to occur in this thread.1152* Return the length of the string or zero if no error occurred.1153*/1154JNIEXPORT jint JNICALL1155JVM_GetLastErrorString(char *buf, int len);11561157/*1158* Convert a pathname into native format. This function does syntactic1159* cleanup, such as removing redundant separator characters. It modifies1160* the given pathname string in place.1161*/1162JNIEXPORT char * JNICALL1163JVM_NativePath(char *);11641165/*1166* JVM I/O error codes1167*/1168#define JVM_EEXIST -10011691170/*1171* Open a file descriptor. This function returns a negative error code1172* on error, and a non-negative integer that is the file descriptor on1173* success.1174*/1175JNIEXPORT jint JNICALL1176JVM_Open(const char *fname, jint flags, jint mode);11771178/*1179* Close a file descriptor. This function returns -1 on error, and 01180* on success.1181*1182* fd the file descriptor to close.1183*/1184JNIEXPORT jint JNICALL1185JVM_Close(jint fd);11861187/*1188* Read data from a file decriptor into a char array.1189*1190* fd the file descriptor to read from.1191* buf the buffer where to put the read data.1192* nbytes the number of bytes to read.1193*1194* This function returns -1 on error, and 0 on success.1195*/1196JNIEXPORT jint JNICALL1197JVM_Read(jint fd, char *buf, jint nbytes);11981199/*1200* Write data from a char array to a file decriptor.1201*1202* fd the file descriptor to read from.1203* buf the buffer from which to fetch the data.1204* nbytes the number of bytes to write.1205*1206* This function returns -1 on error, and 0 on success.1207*/1208JNIEXPORT jint JNICALL1209JVM_Write(jint fd, char *buf, jint nbytes);12101211/*1212* Returns the number of bytes available for reading from a given file1213* descriptor1214*/1215JNIEXPORT jint JNICALL1216JVM_Available(jint fd, jlong *pbytes);12171218/*1219* Move the file descriptor pointer from whence by offset.1220*1221* fd the file descriptor to move.1222* offset the number of bytes to move it by.1223* whence the start from where to move it.1224*1225* This function returns the resulting pointer location.1226*/1227JNIEXPORT jlong JNICALL1228JVM_Lseek(jint fd, jlong offset, jint whence);12291230/*1231* Set the length of the file associated with the given descriptor to the given1232* length. If the new length is longer than the current length then the file1233* is extended; the contents of the extended portion are not defined. The1234* value of the file pointer is undefined after this procedure returns.1235*/1236JNIEXPORT jint JNICALL1237JVM_SetLength(jint fd, jlong length);12381239/*1240* Synchronize the file descriptor's in memory state with that of the1241* physical device. Return of -1 is an error, 0 is OK.1242*/1243JNIEXPORT jint JNICALL1244JVM_Sync(jint fd);12451246/*1247* Networking library support1248*/12491250JNIEXPORT jint JNICALL1251JVM_InitializeSocketLibrary(void);12521253struct sockaddr;12541255JNIEXPORT jint JNICALL1256JVM_Socket(jint domain, jint type, jint protocol);12571258JNIEXPORT jint JNICALL1259JVM_SocketClose(jint fd);12601261JNIEXPORT jint JNICALL1262JVM_SocketShutdown(jint fd, jint howto);12631264JNIEXPORT jint JNICALL1265JVM_Recv(jint fd, char *buf, jint nBytes, jint flags);12661267JNIEXPORT jint JNICALL1268JVM_Send(jint fd, char *buf, jint nBytes, jint flags);12691270JNIEXPORT jint JNICALL1271JVM_Timeout(int fd, long timeout);12721273JNIEXPORT jint JNICALL1274JVM_Listen(jint fd, jint count);12751276JNIEXPORT jint JNICALL1277JVM_Connect(jint fd, struct sockaddr *him, jint len);12781279JNIEXPORT jint JNICALL1280JVM_Bind(jint fd, struct sockaddr *him, jint len);12811282JNIEXPORT jint JNICALL1283JVM_Accept(jint fd, struct sockaddr *him, jint *len);12841285JNIEXPORT jint JNICALL1286JVM_RecvFrom(jint fd, char *buf, int nBytes,1287int flags, struct sockaddr *from, int *fromlen);12881289JNIEXPORT jint JNICALL1290JVM_SendTo(jint fd, char *buf, int len,1291int flags, struct sockaddr *to, int tolen);12921293JNIEXPORT jint JNICALL1294JVM_SocketAvailable(jint fd, jint *result);129512961297JNIEXPORT jint JNICALL1298JVM_GetSockName(jint fd, struct sockaddr *him, int *len);12991300JNIEXPORT jint JNICALL1301JVM_GetSockOpt(jint fd, int level, int optname, char *optval, int *optlen);13021303JNIEXPORT jint JNICALL1304JVM_SetSockOpt(jint fd, int level, int optname, const char *optval, int optlen);13051306JNIEXPORT int JNICALL1307JVM_GetHostName(char* name, int namelen);13081309/*1310* The standard printing functions supported by the Java VM. (Should they1311* be renamed to JVM_* in the future?1312*/13131314/*1315* BE CAREFUL! The following functions do not implement the1316* full feature set of standard C printf formats.1317*/1318int1319jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args);13201321int1322jio_snprintf(char *str, size_t count, const char *fmt, ...);13231324int1325jio_fprintf(FILE *, const char *fmt, ...);13261327int1328jio_vfprintf(FILE *, const char *fmt, va_list args);132913301331JNIEXPORT void * JNICALL1332JVM_RawMonitorCreate(void);13331334JNIEXPORT void JNICALL1335JVM_RawMonitorDestroy(void *mon);13361337JNIEXPORT jint JNICALL1338JVM_RawMonitorEnter(void *mon);13391340JNIEXPORT void JNICALL1341JVM_RawMonitorExit(void *mon);13421343/*1344* java.lang.management support1345*/1346JNIEXPORT void* JNICALL1347JVM_GetManagement(jint version);13481349/*1350* com.sun.tools.attach.VirtualMachine support1351*1352* Initialize the agent properties with the properties maintained in the VM.1353*/1354JNIEXPORT jobject JNICALL1355JVM_InitAgentProperties(JNIEnv *env, jobject agent_props);13561357JNIEXPORT jstring JNICALL1358JVM_GetTemporaryDirectory(JNIEnv *env);13591360/* Generics reflection support.1361*1362* Returns information about the given class's EnclosingMethod1363* attribute, if present, or null if the class had no enclosing1364* method.1365*1366* If non-null, the returned array contains three elements. Element 01367* is the java.lang.Class of which the enclosing method is a member,1368* and elements 1 and 2 are the java.lang.Strings for the enclosing1369* method's name and descriptor, respectively.1370*/1371JNIEXPORT jobjectArray JNICALL1372JVM_GetEnclosingMethodInfo(JNIEnv* env, jclass ofClass);13731374/*1375* Java thread state support1376*/1377enum {1378JAVA_THREAD_STATE_NEW = 0,1379JAVA_THREAD_STATE_RUNNABLE = 1,1380JAVA_THREAD_STATE_BLOCKED = 2,1381JAVA_THREAD_STATE_WAITING = 3,1382JAVA_THREAD_STATE_TIMED_WAITING = 4,1383JAVA_THREAD_STATE_TERMINATED = 5,1384JAVA_THREAD_STATE_COUNT = 61385};13861387/*1388* Returns an array of the threadStatus values representing the1389* given Java thread state. Returns NULL if the VM version is1390* incompatible with the JDK or doesn't support the given1391* Java thread state.1392*/1393JNIEXPORT jintArray JNICALL1394JVM_GetThreadStateValues(JNIEnv* env, jint javaThreadState);13951396/*1397* Returns an array of the substate names representing the1398* given Java thread state. Returns NULL if the VM version is1399* incompatible with the JDK or the VM doesn't support1400* the given Java thread state.1401* values must be the jintArray returned from JVM_GetThreadStateValues1402* and javaThreadState.1403*/1404JNIEXPORT jobjectArray JNICALL1405JVM_GetThreadStateNames(JNIEnv* env, jint javaThreadState, jintArray values);14061407/*1408* Returns true if the JVM's lookup cache indicates that this class is1409* known to NOT exist for the given loader.1410*/1411JNIEXPORT jboolean JNICALL1412JVM_KnownToNotExist(JNIEnv *env, jobject loader, const char *classname);14131414/*1415* Returns an array of all URLs that are stored in the JVM's lookup cache1416* for the given loader. NULL if the lookup cache is unavailable.1417*/1418JNIEXPORT jobjectArray JNICALL1419JVM_GetResourceLookupCacheURLs(JNIEnv *env, jobject loader);14201421/*1422* Returns an array of all URLs that *may* contain the resource_name for the1423* given loader. This function returns an integer array, each element1424* of which can be used to index into the array returned by1425* JVM_GetResourceLookupCacheURLs of the same loader to determine the1426* URLs.1427*/1428JNIEXPORT jintArray JNICALL1429JVM_GetResourceLookupCache(JNIEnv *env, jobject loader, const char *resource_name);143014311432/* =========================================================================1433* The following defines a private JVM interface that the JDK can query1434* for the JVM version and capabilities. sun.misc.Version defines1435* the methods for getting the VM version and its capabilities.1436*1437* When a new bit is added, the following should be updated to provide1438* access to the new capability:1439* HS: JVM_GetVersionInfo and Abstract_VM_Version class1440* SDK: Version class1441*1442* Similary, a private JDK interface JDK_GetVersionInfo0 is defined for1443* JVM to query for the JDK version and capabilities.1444*1445* When a new bit is added, the following should be updated to provide1446* access to the new capability:1447* HS: JDK_Version class1448* SDK: JDK_GetVersionInfo01449*1450* ==========================================================================1451*/1452typedef struct {1453/* Naming convention of RE build version string: n.n.n[_uu[c]][-<identifier>]-bxx */1454unsigned int jvm_version; /* Consists of major, minor, micro (n.n.n) */1455/* and build number (xx) */1456unsigned int update_version : 8; /* Update release version (uu) */1457unsigned int special_update_version : 8; /* Special update release version (c)*/1458unsigned int reserved1 : 16;1459unsigned int reserved2;14601461/* The following bits represents JVM supports that JDK has dependency on.1462* JDK can use these bits to determine which JVM version1463* and support it has to maintain runtime compatibility.1464*1465* When a new bit is added in a minor or update release, make sure1466* the new bit is also added in the main/baseline.1467*/1468unsigned int is_attach_supported : 1;1469unsigned int : 31;1470unsigned int : 32;1471unsigned int : 32;1472} jvm_version_info;14731474#define JVM_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24)1475#define JVM_VERSION_MINOR(version) ((version & 0x00FFFF00) >> 8)1476#define JVM_VERSION_MICRO(version) 014771478/* Build number is available only for RE builds.1479* It will be zero for internal builds.1480*/1481#define JVM_VERSION_BUILD(version) ((version & 0x000000FF))14821483JNIEXPORT void JNICALL1484JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t info_size);14851486typedef struct {1487// Naming convention of RE build version string: n.n.n[_uu[c]][-<identifier>]-bxx1488unsigned int jdk_version; /* Consists of major, minor, micro (n.n.n) */1489/* and build number (xx) */1490unsigned int update_version : 16; /* Update release version (uu) */1491unsigned int special_update_version : 8; /* Special update release version (c)*/1492unsigned int reserved1 : 8;1493unsigned int reserved2;14941495/* The following bits represents new JDK supports that VM has dependency on.1496* VM implementation can use these bits to determine which JDK version1497* and support it has to maintain runtime compatibility.1498*1499* When a new bit is added in a minor or update release, make sure1500* the new bit is also added in the main/baseline.1501*/1502unsigned int thread_park_blocker : 1;1503unsigned int post_vm_init_hook_enabled : 1;1504unsigned int pending_list_uses_discovered_field : 1;1505unsigned int : 29;1506unsigned int : 32;1507unsigned int : 32;1508} jdk_version_info;15091510#define JDK_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24)1511#define JDK_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16)1512#define JDK_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8)15131514/* Build number is available only for RE build (i.e. JDK_BUILD_NUMBER is set to bNN)1515* It will be zero for internal builds.1516*/1517#define JDK_VERSION_BUILD(version) ((version & 0x000000FF))15181519/*1520* This is the function JDK_GetVersionInfo0 defined in libjava.so1521* that is dynamically looked up by JVM.1522*/1523typedef void (*jdk_version_info_fn_t)(jdk_version_info* info, size_t info_size);15241525/*1526* This structure is used by the launcher to get the default thread1527* stack size from the VM using JNI_GetDefaultJavaVMInitArgs() with a1528* version of 1.1. As it is not supported otherwise, it has been removed1529* from jni.h1530*/1531typedef struct JDK1_1InitArgs {1532jint version;15331534char **properties;1535jint checkSource;1536jint nativeStackSize;1537jint javaStackSize;1538jint minHeapSize;1539jint maxHeapSize;1540jint verifyMode;1541char *classpath;15421543jint (JNICALL *vfprintf)(FILE *fp, const char *format, va_list args);1544void (JNICALL *exit)(jint code);1545void (JNICALL *abort)(void);15461547jint enableClassGC;1548jint enableVerboseGC;1549jint disableAsyncGC;1550jint verbose;1551jboolean debugging;1552jint debugPort;1553} JDK1_1InitArgs;155415551556#ifdef __cplusplus1557} /* extern "C" */15581559#endif /* __cplusplus */15601561#endif /* !_JAVASOFT_JVM_H_ */156215631564