jvm.h revision 2362
0N/A/*
6330N/A * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
3012N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6330N/A *
6330N/A * This code is free software; you can redistribute it and/or modify it
6330N/A * under the terms of the GNU General Public License version 2 only, as
6330N/A * published by the Free Software Foundation. Oracle designates this
233N/A * particular file as subject to the "Classpath" exception as provided
6330N/A * by Oracle in the LICENSE file that accompanied this code.
6330N/A *
6330N/A * This code is distributed in the hope that it will be useful, but WITHOUT
6330N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6330N/A * version 2 for more details (a copy is included in the LICENSE file that
6330N/A * accompanied this code).
6330N/A *
6330N/A * You should have received a copy of the GNU General Public License version
6330N/A * 2 along with this work; if not, write to the Free Software Foundation,
6330N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6330N/A *
6330N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6330N/A * or visit www.oracle.com if you need additional information or have any
6330N/A * questions.
6330N/A */
6330N/A
6330N/A#ifndef _JAVASOFT_JVM_H_
6330N/A#define _JAVASOFT_JVM_H_
0N/A
6331N/A#include <sys/stat.h>
6330N/A
6330N/A#include "jni.h"
6330N/A#include "jvm_md.h"
6330N/A
6330N/A#ifdef __cplusplus
6330N/Aextern "C" {
6330N/A#endif
3381N/A
6330N/A/*
6330N/A * This file contains additional functions exported from the VM.
6330N/A * These functions are complementary to the standard JNI support.
6330N/A * There are three parts to this file:
6331N/A *
6331N/A * First, this file contains the VM-related functions needed by native
6330N/A * libraries in the standard Java API. For example, the java.lang.Object
6330N/A * class needs VM-level functions that wait for and notify monitors.
3980N/A *
6330N/A * Second, this file contains the functions and constant definitions
6330N/A * needed by the byte code verifier and class file format checker.
6301N/A * These functions allow the verifier and format checker to be written
6301N/A * in a VM-independent way.
6301N/A *
3012N/A * Third, this file contains various I/O and nerwork operations needed
6330N/A * by the standard Java I/O and network APIs.
6330N/A */
6331N/A
6330N/A/*
6331N/A * Bump the version number when either of the following happens:
6331N/A *
233N/A * 1. There is a change in JVM_* functions.
6330N/A *
6330N/A * 2. There is a change in the contract between VM and Java classes.
6330N/A * For example, if the VM relies on a new private field in Thread
6330N/A * class.
0N/A */
6330N/A
6330N/A#define JVM_INTERFACE_VERSION 4
6330N/A
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetInterfaceVersion(void);
6330N/A
6330N/A/*************************************************************************
6330N/A PART 1: Functions for Native Libraries
6330N/A ************************************************************************/
6330N/A/*
6330N/A * java.lang.Object
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_IHashCode(JNIEnv *env, jobject obj);
6330N/A
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_MonitorWait(JNIEnv *env, jobject obj, jlong ms);
6330N/A
6330N/AJNIEXPORT void JNICALL
6331N/AJVM_MonitorNotify(JNIEnv *env, jobject obj);
567N/A
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_MonitorNotifyAll(JNIEnv *env, jobject obj);
6330N/A
6330N/AJNIEXPORT jobject JNICALL
6330N/AJVM_Clone(JNIEnv *env, jobject obj);
0N/A
6330N/A/*
6330N/A * java.lang.String
6330N/A */
6330N/AJNIEXPORT jstring JNICALL
0N/AJVM_InternString(JNIEnv *env, jstring str);
6330N/A
6330N/A/*
6330N/A * java.lang.System
6330N/A */
6330N/AJNIEXPORT jlong JNICALL
6330N/AJVM_CurrentTimeMillis(JNIEnv *env, jclass ignored);
6330N/A
6330N/AJNIEXPORT jlong JNICALL
6330N/AJVM_NanoTime(JNIEnv *env, jclass ignored);
6330N/A
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_ArrayCopy(JNIEnv *env, jclass ignored, jobject src, jint src_pos,
902N/A jobject dst, jint dst_pos, jint length);
6330N/A
6330N/AJNIEXPORT jobject JNICALL
6330N/AJVM_InitProperties(JNIEnv *env, jobject p);
6330N/A
6330N/A/*
6330N/A * java.io.File
233N/A */
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_OnExit(void (*func)(void));
6330N/A
6330N/A/*
6330N/A * java.lang.Runtime
6330N/A */
699N/AJNIEXPORT void JNICALL
6330N/AJVM_Exit(jint code);
6330N/A
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_Halt(jint code);
6330N/A
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_GC(void);
6330N/A
6330N/A/* Returns the number of real-time milliseconds that have elapsed since the
3381N/A * least-recently-inspected heap object was last inspected by the garbage
6330N/A * collector.
6330N/A *
0N/A * For simple stop-the-world collectors this value is just the time
6330N/A * since the most recent collection. For generational collectors it is the
6330N/A * time since the oldest generation was most recently collected. Other
6330N/A * collectors are free to return a pessimistic estimate of the elapsed time, or
1177N/A * simply the time since the last full collection was performed.
6330N/A *
6330N/A * Note that in the presence of reference objects, a given object that is no
6330N/A * longer strongly reachable may have to be inspected multiple times before it
6330N/A * can be reclaimed.
6330N/A */
6330N/AJNIEXPORT jlong JNICALL
6330N/AJVM_MaxObjectInspectionAge(void);
6330N/A
3980N/AJNIEXPORT void JNICALL
6330N/AJVM_TraceInstructions(jboolean on);
6330N/A
6401N/AJNIEXPORT void JNICALL
6330N/AJVM_TraceMethodCalls(jboolean on);
6330N/A
6330N/AJNIEXPORT jlong JNICALL
3381N/AJVM_TotalMemory(void);
6330N/A
6330N/AJNIEXPORT jlong JNICALL
6330N/AJVM_FreeMemory(void);
6158N/A
6330N/AJNIEXPORT jlong JNICALL
6330N/AJVM_MaxMemory(void);
6330N/A
6165N/AJNIEXPORT jint JNICALL
6330N/AJVM_ActiveProcessorCount(void);
6330N/A
6330N/AJNIEXPORT void * JNICALL
3381N/AJVM_LoadLibrary(const char *name);
6330N/A
6330N/AJNIEXPORT void JNICALL
6165N/AJVM_UnloadLibrary(void * handle);
6330N/A
6330N/AJNIEXPORT void * JNICALL
6330N/AJVM_FindLibraryEntry(void *handle, const char *name);
6330N/A
6330N/AJNIEXPORT jboolean JNICALL
6158N/AJVM_IsSupportedJNIVersion(jint version);
6330N/A
6330N/A/*
6330N/A * java.lang.Float and java.lang.Double
6330N/A */
6330N/AJNIEXPORT jboolean JNICALL
6330N/AJVM_IsNaN(jdouble d);
3381N/A
6330N/A/*
6330N/A * java.lang.Throwable
6330N/A */
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_FillInStackTrace(JNIEnv *env, jobject throwable);
6330N/A
6330N/AJNIEXPORT void JNICALL
3381N/AJVM_PrintStackTrace(JNIEnv *env, jobject throwable, jobject printable);
6330N/A
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetStackTraceDepth(JNIEnv *env, jobject throwable);
6330N/A
6330N/AJNIEXPORT jobject JNICALL
6330N/AJVM_GetStackTraceElement(JNIEnv *env, jobject throwable, jint index);
6330N/A
6330N/A/*
6330N/A * java.lang.Compiler
6330N/A */
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_InitializeCompiler (JNIEnv *env, jclass compCls);
6330N/A
6330N/AJNIEXPORT jboolean JNICALL
6330N/AJVM_IsSilentCompiler(JNIEnv *env, jclass compCls);
6330N/A
0N/AJNIEXPORT jboolean JNICALL
6330N/AJVM_CompileClass(JNIEnv *env, jclass compCls, jclass cls);
6330N/A
6330N/AJNIEXPORT jboolean JNICALL
6330N/AJVM_CompileClasses(JNIEnv *env, jclass cls, jstring jname);
6330N/A
6330N/AJNIEXPORT jobject JNICALL
6330N/AJVM_CompilerCommand(JNIEnv *env, jclass compCls, jobject arg);
6330N/A
6330N/AJNIEXPORT void JNICALL
0N/AJVM_EnableCompiler(JNIEnv *env, jclass compCls);
6330N/A
6330N/AJNIEXPORT void JNICALL
0N/AJVM_DisableCompiler(JNIEnv *env, jclass compCls);
6330N/A
6330N/A/*
6330N/A * java.lang.Thread
6330N/A */
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_StartThread(JNIEnv *env, jobject thread);
6330N/A
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_StopThread(JNIEnv *env, jobject thread, jobject exception);
6330N/A
6330N/AJNIEXPORT jboolean JNICALL
6330N/AJVM_IsThreadAlive(JNIEnv *env, jobject thread);
6330N/A
0N/AJNIEXPORT void JNICALL
0N/AJVM_SuspendThread(JNIEnv *env, jobject thread);
6330N/A
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_ResumeThread(JNIEnv *env, jobject thread);
6330N/A
6330N/AJNIEXPORT void JNICALL
6301N/AJVM_SetThreadPriority(JNIEnv *env, jobject thread, jint prio);
6330N/A
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_Yield(JNIEnv *env, jclass threadClass);
5947N/A
6302N/AJNIEXPORT void JNICALL
6302N/AJVM_Sleep(JNIEnv *env, jclass threadClass, jlong millis);
6302N/A
6330N/AJNIEXPORT jobject JNICALL
6302N/AJVM_CurrentThread(JNIEnv *env, jclass threadClass);
6330N/A
6302N/AJNIEXPORT jint JNICALL
6302N/AJVM_CountStackFrames(JNIEnv *env, jobject thread);
5947N/A
6302N/AJNIEXPORT void JNICALL
6302N/AJVM_Interrupt(JNIEnv *env, jobject thread);
6302N/A
6302N/AJNIEXPORT jboolean JNICALL
6302N/AJVM_IsInterrupted(JNIEnv *env, jobject thread, jboolean clearInterrupted);
6302N/A
6302N/AJNIEXPORT jboolean JNICALL
6302N/AJVM_HoldsLock(JNIEnv *env, jclass threadClass, jobject obj);
6302N/A
0N/AJNIEXPORT void JNICALL
6302N/AJVM_DumpAllStacks(JNIEnv *env, jclass unused);
6302N/A
6302N/AJNIEXPORT jobjectArray JNICALL
6302N/AJVM_GetAllThreads(JNIEnv *env, jclass dummy);
6302N/A
6302N/A/* getStackTrace() and getAllStackTraces() method */
6302N/AJNIEXPORT jobjectArray JNICALL
6330N/AJVM_DumpThreads(JNIEnv *env, jclass threadClass, jobjectArray threads);
6302N/A
6302N/A/*
6302N/A * java.lang.SecurityManager
3381N/A */
6330N/AJNIEXPORT jclass JNICALL
6330N/AJVM_CurrentLoadedClass(JNIEnv *env);
6330N/A
6302N/AJNIEXPORT jobject JNICALL
6330N/AJVM_CurrentClassLoader(JNIEnv *env);
6302N/A
0N/AJNIEXPORT jobjectArray JNICALL
6330N/AJVM_GetClassContext(JNIEnv *env);
6330N/A
6330N/AJNIEXPORT jint JNICALL
6302N/AJVM_ClassDepth(JNIEnv *env, jstring name);
6330N/A
6302N/AJNIEXPORT jint JNICALL
6302N/AJVM_ClassLoaderDepth(JNIEnv *env);
1344N/A
6330N/A/*
6302N/A * java.lang.Package
6302N/A */
1344N/AJNIEXPORT jstring JNICALL
6302N/AJVM_GetSystemPackage(JNIEnv *env, jstring name);
6330N/A
6330N/AJNIEXPORT jobjectArray JNICALL
6302N/AJVM_GetSystemPackages(JNIEnv *env);
6302N/A
0N/A/*
0N/A * java.io.ObjectInputStream
6330N/A */
6330N/AJNIEXPORT jobject JNICALL
6330N/AJVM_AllocateNewObject(JNIEnv *env, jobject obj, jclass currClass,
6330N/A jclass initClass);
6330N/A
6331N/AJNIEXPORT jobject JNICALL
567N/AJVM_AllocateNewArray(JNIEnv *env, jobject obj, jclass currClass,
6330N/A jint length);
6330N/A
6330N/AJNIEXPORT jobject JNICALL
6330N/AJVM_LatestUserDefinedLoader(JNIEnv *env);
6330N/A
6330N/A/*
6330N/A * This function has been deprecated and should not be considered
6330N/A * part of the specified JVM interface.
6330N/A */
6330N/AJNIEXPORT jclass JNICALL
6330N/AJVM_LoadClass0(JNIEnv *env, jobject obj, jclass currClass,
6330N/A jstring currClassName);
6330N/A
6330N/A/*
6330N/A * java.lang.reflect.Array
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetArrayLength(JNIEnv *env, jobject arr);
6330N/A
6330N/AJNIEXPORT jobject JNICALL
6330N/AJVM_GetArrayElement(JNIEnv *env, jobject arr, jint index);
6330N/A
6330N/AJNIEXPORT jvalue JNICALL
6330N/AJVM_GetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jint wCode);
6330N/A
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_SetArrayElement(JNIEnv *env, jobject arr, jint index, jobject val);
662N/A
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_SetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jvalue v,
1210N/A unsigned char vCode);
6330N/A
6330N/AJNIEXPORT jobject JNICALL
6330N/AJVM_NewArray(JNIEnv *env, jclass eltClass, jint length);
6330N/A
6330N/AJNIEXPORT jobject JNICALL
6330N/AJVM_NewMultiArray(JNIEnv *env, jclass eltClass, jintArray dim);
6330N/A
3387N/A/*
6330N/A * java.lang.Class and java.lang.ClassLoader
6330N/A */
6330N/A/*
712N/A * Returns the class in which the code invoking the native method
6330N/A * belongs.
6330N/A *
6330N/A * Note that in JDK 1.1, native methods did not create a frame.
6330N/A * In 1.2, they do. Therefore native methods like Class.forName
6330N/A * can no longer look at the current frame for the caller class.
6330N/A */
6330N/AJNIEXPORT jclass JNICALL
6330N/AJVM_GetCallerClass(JNIEnv *env, int n);
6330N/A
6330N/A/*
6330N/A * Find primitive classes
3381N/A * utf: class name
6330N/A */
6330N/AJNIEXPORT jclass JNICALL
6330N/AJVM_FindPrimitiveClass(JNIEnv *env, const char *utf);
6330N/A
6331N/A/*
6331N/A * Link the class
6331N/A */
6331N/AJNIEXPORT void JNICALL
114N/AJVM_ResolveClass(JNIEnv *env, jclass cls);
6330N/A
6330N/A/*
6330N/A * Find a class from a boot class loader. Returns NULL if class not found.
6331N/A */
6331N/AJNIEXPORT jclass JNICALL
6331N/AJVM_FindClassFromBootLoader(JNIEnv *env, const char *name);
6331N/A
6330N/A/*
6330N/A * Find a class from a given class loader. Throw ClassNotFoundException
0N/A * or NoClassDefFoundError depending on the value of the last
6330N/A * argument.
6330N/A */
6330N/AJNIEXPORT jclass JNICALL
6330N/AJVM_FindClassFromClassLoader(JNIEnv *env, const char *name, jboolean init,
6330N/A jobject loader, jboolean throwError);
6330N/A
6330N/A/*
6330N/A * Find a class from a given class.
6330N/A */
6330N/AJNIEXPORT jclass JNICALL
6330N/AJVM_FindClassFromClass(JNIEnv *env, const char *name, jboolean init,
6330N/A jclass from);
6330N/A
6330N/A/* Find a loaded class cached by the VM */
4156N/AJNIEXPORT jclass JNICALL
6330N/AJVM_FindLoadedClass(JNIEnv *env, jobject loader, jstring name);
6330N/A
6330N/A/* Define a class */
6330N/AJNIEXPORT jclass JNICALL
6330N/AJVM_DefineClass(JNIEnv *env, const char *name, jobject loader, const jbyte *buf,
6330N/A jsize len, jobject pd);
6330N/A
6330N/A/* Define a class with a source (added in JDK1.5) */
6330N/AJNIEXPORT jclass JNICALL
6330N/AJVM_DefineClassWithSource(JNIEnv *env, const char *name, jobject loader,
6330N/A const jbyte *buf, jsize len, jobject pd,
6330N/A const char *source);
1607N/A
6330N/A/*
6330N/A * Reflection support functions
0N/A */
6330N/A
6330N/AJNIEXPORT jstring JNICALL
6330N/AJVM_GetClassName(JNIEnv *env, jclass cls);
6330N/A
6330N/AJNIEXPORT jobjectArray JNICALL
6330N/AJVM_GetClassInterfaces(JNIEnv *env, jclass cls);
6330N/A
6330N/AJNIEXPORT jobject JNICALL
6330N/AJVM_GetClassLoader(JNIEnv *env, jclass cls);
1177N/A
6330N/AJNIEXPORT jboolean JNICALL
6330N/AJVM_IsInterface(JNIEnv *env, jclass cls);
6330N/A
6330N/AJNIEXPORT jobjectArray JNICALL
6330N/AJVM_GetClassSigners(JNIEnv *env, jclass cls);
6330N/A
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_SetClassSigners(JNIEnv *env, jclass cls, jobjectArray signers);
6330N/A
6330N/AJNIEXPORT jobject JNICALL
2556N/AJVM_GetProtectionDomain(JNIEnv *env, jclass cls);
6330N/A
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_SetProtectionDomain(JNIEnv *env, jclass cls, jobject protection_domain);
6330N/A
6330N/AJNIEXPORT jboolean JNICALL
6330N/AJVM_IsArrayClass(JNIEnv *env, jclass cls);
6330N/A
6330N/AJNIEXPORT jboolean JNICALL
6330N/AJVM_IsPrimitiveClass(JNIEnv *env, jclass cls);
6330N/A
6330N/AJNIEXPORT jclass JNICALL
6330N/AJVM_GetComponentType(JNIEnv *env, jclass cls);
6330N/A
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetClassModifiers(JNIEnv *env, jclass cls);
6330N/A
6330N/AJNIEXPORT jobjectArray JNICALL
6330N/AJVM_GetDeclaredClasses(JNIEnv *env, jclass ofClass);
6330N/A
6330N/AJNIEXPORT jclass JNICALL
6330N/AJVM_GetDeclaringClass(JNIEnv *env, jclass ofClass);
6330N/A
6330N/A/* Generics support (JDK 1.5) */
6330N/AJNIEXPORT jstring JNICALL
6330N/AJVM_GetClassSignature(JNIEnv *env, jclass cls);
6330N/A
6330N/A/* Annotations support (JDK 1.5) */
2710N/AJNIEXPORT jbyteArray JNICALL
6330N/AJVM_GetClassAnnotations(JNIEnv *env, jclass cls);
6330N/A
6330N/A/*
6330N/A * New (JDK 1.4) reflection implementation
6330N/A */
6330N/A
6330N/AJNIEXPORT jobjectArray JNICALL
6330N/AJVM_GetClassDeclaredMethods(JNIEnv *env, jclass ofClass, jboolean publicOnly);
6330N/A
6330N/AJNIEXPORT jobjectArray JNICALL
6330N/AJVM_GetClassDeclaredFields(JNIEnv *env, jclass ofClass, jboolean publicOnly);
6330N/A
6330N/AJNIEXPORT jobjectArray JNICALL
6330N/AJVM_GetClassDeclaredConstructors(JNIEnv *env, jclass ofClass, jboolean publicOnly);
6330N/A
5058N/A/* Differs from JVM_GetClassModifiers in treatment of inner classes.
6330N/A This returns the access flags for the class as specified in the
6330N/A class file rather than searching the InnerClasses attribute (if
6330N/A present) to find the source-level access flags. Only the values of
6330N/A the low 13 bits (i.e., a mask of 0x1FFF) are guaranteed to be
6330N/A valid. */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetClassAccessFlags(JNIEnv *env, jclass cls);
6330N/A
6330N/A/* The following two reflection routines are still needed due to startup time issues */
6330N/A/*
6330N/A * java.lang.reflect.Method
6330N/A */
6330N/AJNIEXPORT jobject JNICALL
6330N/AJVM_InvokeMethod(JNIEnv *env, jobject method, jobject obj, jobjectArray args0);
6330N/A
6330N/A/*
6330N/A * java.lang.reflect.Constructor
6330N/A */
6330N/AJNIEXPORT jobject JNICALL
6330N/AJVM_NewInstanceFromConstructor(JNIEnv *env, jobject c, jobjectArray args0);
6330N/A
6330N/A/*
6330N/A * Constant pool access; currently used to implement reflective access to annotations (JDK 1.5)
6330N/A */
6330N/A
6330N/AJNIEXPORT jobject JNICALL
6330N/AJVM_GetClassConstantPool(JNIEnv *env, jclass cls);
6330N/A
6330N/AJNIEXPORT jint JNICALL JVM_ConstantPoolGetSize
0N/A(JNIEnv *env, jobject unused, jobject jcpool);
6330N/A
6330N/AJNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAt
6330N/A(JNIEnv *env, jobject unused, jobject jcpool, jint index);
6330N/A
6330N/AJNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAtIfLoaded
6330N/A(JNIEnv *env, jobject unused, jobject jcpool, jint index);
6330N/A
6330N/AJNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAt
6330N/A(JNIEnv *env, jobject unused, jobject jcpool, jint index);
6330N/A
6330N/AJNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAtIfLoaded
6330N/A(JNIEnv *env, jobject unused, jobject jcpool, jint index);
6330N/A
712N/AJNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAt
6330N/A(JNIEnv *env, jobject unused, jobject jcpool, jint index);
6330N/A
6330N/AJNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAtIfLoaded
6330N/A(JNIEnv *env, jobject unused, jobject jcpool, jint index);
6330N/A
6330N/AJNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetMemberRefInfoAt
6330N/A(JNIEnv *env, jobject unused, jobject jcpool, jint index);
6330N/A
6330N/AJNIEXPORT jint JNICALL JVM_ConstantPoolGetIntAt
6330N/A(JNIEnv *env, jobject unused, jobject jcpool, jint index);
1008N/A
6330N/AJNIEXPORT jlong JNICALL JVM_ConstantPoolGetLongAt
6330N/A(JNIEnv *env, jobject unused, jobject jcpool, jint index);
6330N/A
6330N/AJNIEXPORT jfloat JNICALL JVM_ConstantPoolGetFloatAt
6330N/A(JNIEnv *env, jobject unused, jobject jcpool, jint index);
6330N/A
3381N/AJNIEXPORT jdouble JNICALL JVM_ConstantPoolGetDoubleAt
6330N/A(JNIEnv *env, jobject unused, jobject jcpool, jint index);
6330N/A
6330N/AJNIEXPORT jstring JNICALL JVM_ConstantPoolGetStringAt
6330N/A(JNIEnv *env, jobject unused, jobject jcpool, jint index);
6330N/A
6330N/AJNIEXPORT jstring JNICALL JVM_ConstantPoolGetUTF8At
6330N/A(JNIEnv *env, jobject unused, jobject jcpool, jint index);
6330N/A
6330N/A/*
6330N/A * java.security.*
6330N/A */
6330N/A
2086N/AJNIEXPORT jobject JNICALL
3980N/AJVM_DoPrivileged(JNIEnv *env, jclass cls,
6330N/A jobject action, jobject context, jboolean wrapException);
6330N/A
6330N/AJNIEXPORT jobject JNICALL
6330N/AJVM_GetInheritedAccessControlContext(JNIEnv *env, jclass cls);
6330N/A
6330N/AJNIEXPORT jobject JNICALL
6330N/AJVM_GetStackAccessControlContext(JNIEnv *env, jclass cls);
6330N/A
6330N/A/*
6330N/A * Signal support, used to implement the shutdown sequence. Every VM must
6330N/A * support JVM_SIGINT and JVM_SIGTERM, raising the former for user interrupts
6330N/A * (^C) and the latter for external termination (kill, system shutdown, etc.).
6330N/A * Other platform-dependent signal values may also be supported.
6330N/A */
6330N/A
6330N/AJNIEXPORT void * JNICALL
6330N/AJVM_RegisterSignal(jint sig, void *handler);
6330N/A
6330N/AJNIEXPORT jboolean JNICALL
6330N/AJVM_RaiseSignal(jint sig);
6330N/A
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_FindSignal(const char *name);
6330N/A
6330N/A/*
6330N/A * Retrieve the assertion directives for the specified class.
6330N/A */
6330N/AJNIEXPORT jboolean JNICALL
6330N/AJVM_DesiredAssertionStatus(JNIEnv *env, jclass unused, jclass cls);
6330N/A
6330N/A/*
6330N/A * Retrieve the assertion directives from the VM.
6330N/A */
6330N/AJNIEXPORT jobject JNICALL
6330N/AJVM_AssertionStatusDirectives(JNIEnv *env, jclass unused);
6330N/A
6330N/A/*
6330N/A * java.util.concurrent.AtomicLong
6330N/A */
6330N/AJNIEXPORT jboolean JNICALL
6330N/AJVM_SupportsCX8(void);
6330N/A
6330N/A/*
6330N/A * com.sun.dtrace.jsdt support
6330N/A */
6330N/A
6330N/A#define JVM_TRACING_DTRACE_VERSION 1
6330N/A
6330N/A/*
6330N/A * Structure to pass one probe description to JVM
712N/A */
6330N/Atypedef struct {
6330N/A jmethodID method;
6330N/A jstring function;
6330N/A jstring name;
6330N/A void* reserved[4]; // for future use
6330N/A} JVM_DTraceProbe;
6330N/A
6330N/A/**
6330N/A * Encapsulates the stability ratings for a DTrace provider field
6330N/A */
6330N/Atypedef struct {
6330N/A jint nameStability;
6330N/A jint dataStability;
6330N/A jint dependencyClass;
6330N/A} JVM_DTraceInterfaceAttributes;
6330N/A
6330N/A/*
6330N/A * Structure to pass one provider description to JVM
6330N/A */
6330N/Atypedef struct {
6330N/A jstring name;
6330N/A JVM_DTraceProbe* probes;
6330N/A jint probe_count;
6330N/A JVM_DTraceInterfaceAttributes providerAttributes;
6330N/A JVM_DTraceInterfaceAttributes moduleAttributes;
6330N/A JVM_DTraceInterfaceAttributes functionAttributes;
6330N/A JVM_DTraceInterfaceAttributes nameAttributes;
6330N/A JVM_DTraceInterfaceAttributes argsAttributes;
6330N/A void* reserved[4]; // for future use
6330N/A} JVM_DTraceProvider;
6330N/A
6330N/A/*
6330N/A * Get the version number the JVM was built with
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_DTraceGetVersion(JNIEnv* env);
6330N/A
6330N/A/*
6330N/A * Register new probe with given signature, return global handle
6330N/A *
6330N/A * The version passed in is the version that the library code was
6330N/A * built with.
6330N/A */
6330N/AJNIEXPORT jlong JNICALL
6330N/AJVM_DTraceActivate(JNIEnv* env, jint version, jstring module_name,
6330N/A jint providers_count, JVM_DTraceProvider* providers);
6330N/A
6330N/A/*
6330N/A * Check JSDT probe
6330N/A */
6330N/AJNIEXPORT jboolean JNICALL
6330N/AJVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method);
563N/A
6330N/A/*
6330N/A * Destroy custom DOF
6330N/A */
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_DTraceDispose(JNIEnv* env, jlong activation_handle);
6330N/A
712N/A/*
6330N/A * Check to see if DTrace is supported by OS
6330N/A */
6330N/AJNIEXPORT jboolean JNICALL
6330N/AJVM_DTraceIsSupported(JNIEnv* env);
6330N/A
6330N/A/*************************************************************************
6330N/A PART 2: Support for the Verifier and Class File Format Checker
6330N/A ************************************************************************/
6330N/A/*
6330N/A * Return the class name in UTF format. The result is valid
6330N/A * until JVM_ReleaseUTf is called.
6330N/A *
6330N/A * The caller must treat the string as a constant and not modify it
6330N/A * in any way.
6330N/A */
6330N/AJNIEXPORT const char * JNICALL
6330N/AJVM_GetClassNameUTF(JNIEnv *env, jclass cb);
6330N/A
6330N/A/*
6330N/A * Returns the constant pool types in the buffer provided by "types."
6330N/A */
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_GetClassCPTypes(JNIEnv *env, jclass cb, unsigned char *types);
6330N/A
6330N/A/*
6330N/A * Returns the number of Constant Pool entries.
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetClassCPEntriesCount(JNIEnv *env, jclass cb);
6330N/A
6330N/A/*
6330N/A * Returns the number of *declared* fields or methods.
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetClassFieldsCount(JNIEnv *env, jclass cb);
6330N/A
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetClassMethodsCount(JNIEnv *env, jclass cb);
6330N/A
6330N/A/*
6330N/A * Returns the CP indexes of exceptions raised by a given method.
6330N/A * Places the result in the given buffer.
6330N/A *
6330N/A * The method is identified by method_index.
6330N/A */
3381N/AJNIEXPORT void JNICALL
6330N/AJVM_GetMethodIxExceptionIndexes(JNIEnv *env, jclass cb, jint method_index,
6330N/A unsigned short *exceptions);
6330N/A/*
6330N/A * Returns the number of exceptions raised by a given method.
6330N/A * The method is identified by method_index.
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetMethodIxExceptionsCount(JNIEnv *env, jclass cb, jint method_index);
6330N/A
6330N/A/*
6330N/A * Returns the byte code sequence of a given method.
6330N/A * Places the result in the given buffer.
6330N/A *
6330N/A * The method is identified by method_index.
6330N/A */
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_GetMethodIxByteCode(JNIEnv *env, jclass cb, jint method_index,
6330N/A unsigned char *code);
6330N/A
6330N/A/*
6330N/A * Returns the length of the byte code sequence of a given method.
6330N/A * The method is identified by method_index.
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetMethodIxByteCodeLength(JNIEnv *env, jclass cb, jint method_index);
6330N/A
6330N/A/*
6330N/A * A structure used to a capture exception table entry in a Java method.
6330N/A */
6330N/Atypedef struct {
6330N/A jint start_pc;
6330N/A jint end_pc;
6330N/A jint handler_pc;
6330N/A jint catchType;
3214N/A} JVM_ExceptionTableEntryType;
6330N/A
6330N/A/*
6330N/A * Returns the exception table entry at entry_index of a given method.
6330N/A * Places the result in the given buffer.
6330N/A *
6330N/A * The method is identified by method_index.
6330N/A */
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_GetMethodIxExceptionTableEntry(JNIEnv *env, jclass cb, jint method_index,
6330N/A jint entry_index,
6330N/A JVM_ExceptionTableEntryType *entry);
6330N/A
6330N/A/*
6330N/A * Returns the length of the exception table of a given method.
6330N/A * The method is identified by method_index.
6330N/A */
0N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetMethodIxExceptionTableLength(JNIEnv *env, jclass cb, int index);
6330N/A
6330N/A/*
6330N/A * Returns the modifiers of a given field.
6330N/A * The field is identified by field_index.
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetFieldIxModifiers(JNIEnv *env, jclass cb, int index);
6330N/A
6330N/A/*
6330N/A * Returns the modifiers of a given method.
6330N/A * The method is identified by method_index.
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetMethodIxModifiers(JNIEnv *env, jclass cb, int index);
6330N/A
6330N/A/*
6330N/A * Returns the number of local variables of a given method.
6330N/A * The method is identified by method_index.
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetMethodIxLocalsCount(JNIEnv *env, jclass cb, int index);
6330N/A
6330N/A/*
6330N/A * Returns the number of arguments (including this pointer) of a given method.
3214N/A * The method is identified by method_index.
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetMethodIxArgsSize(JNIEnv *env, jclass cb, int index);
6330N/A
6330N/A/*
6330N/A * Returns the maximum amount of stack (in words) used by a given method.
6330N/A * The method is identified by method_index.
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetMethodIxMaxStack(JNIEnv *env, jclass cb, int index);
6330N/A
6330N/A/*
6330N/A * Is a given method a constructor.
6330N/A * The method is identified by method_index.
6330N/A */
6330N/AJNIEXPORT jboolean JNICALL
0N/AJVM_IsConstructorIx(JNIEnv *env, jclass cb, int index);
6330N/A
6330N/A/*
6330N/A * Returns the name of a given method in UTF format.
6330N/A * The result remains valid until JVM_ReleaseUTF is called.
6330N/A *
6330N/A * The caller must treat the string as a constant and not modify it
6330N/A * in any way.
6330N/A */
6330N/AJNIEXPORT const char * JNICALL
6330N/AJVM_GetMethodIxNameUTF(JNIEnv *env, jclass cb, jint index);
6330N/A
6330N/A/*
6330N/A * Returns the signature of a given method in UTF format.
6330N/A * The result remains valid until JVM_ReleaseUTF is called.
6330N/A *
6330N/A * The caller must treat the string as a constant and not modify it
6330N/A * in any way.
0N/A */
6330N/AJNIEXPORT const char * JNICALL
6330N/AJVM_GetMethodIxSignatureUTF(JNIEnv *env, jclass cb, jint index);
6330N/A
6330N/A/*
6330N/A * Returns the name of the field refered to at a given constant pool
6330N/A * index.
6330N/A *
6330N/A * The result is in UTF format and remains valid until JVM_ReleaseUTF
6330N/A * is called.
6330N/A *
6330N/A * The caller must treat the string as a constant and not modify it
6330N/A * in any way.
6330N/A */
6330N/AJNIEXPORT const char * JNICALL
6330N/AJVM_GetCPFieldNameUTF(JNIEnv *env, jclass cb, jint index);
0N/A
6330N/A/*
6330N/A * Returns the name of the method refered to at a given constant pool
6330N/A * index.
6330N/A *
6330N/A * The result is in UTF format and remains valid until JVM_ReleaseUTF
6330N/A * is called.
6330N/A *
6330N/A * The caller must treat the string as a constant and not modify it
6330N/A * in any way.
6330N/A */
6330N/AJNIEXPORT const char * JNICALL
6330N/AJVM_GetCPMethodNameUTF(JNIEnv *env, jclass cb, jint index);
6330N/A
6330N/A/*
6330N/A * Returns the signature of the method refered to at a given constant pool
6330N/A * index.
6330N/A *
6330N/A * The result is in UTF format and remains valid until JVM_ReleaseUTF
6330N/A * is called.
6330N/A *
6330N/A * The caller must treat the string as a constant and not modify it
6330N/A * in any way.
6330N/A */
6330N/AJNIEXPORT const char * JNICALL
6330N/AJVM_GetCPMethodSignatureUTF(JNIEnv *env, jclass cb, jint index);
6330N/A
6330N/A/*
6330N/A * Returns the signature of the field refered to at a given constant pool
6330N/A * index.
6330N/A *
2086N/A * The result is in UTF format and remains valid until JVM_ReleaseUTF
6330N/A * is called.
6330N/A *
6330N/A * The caller must treat the string as a constant and not modify it
3980N/A * in any way.
3980N/A */
6330N/AJNIEXPORT const char * JNICALL
6330N/AJVM_GetCPFieldSignatureUTF(JNIEnv *env, jclass cb, jint index);
6330N/A
6330N/A/*
6330N/A * Returns the class name refered to at a given constant pool index.
6330N/A *
6330N/A * The result is in UTF format and remains valid until JVM_ReleaseUTF
6330N/A * is called.
6330N/A *
6330N/A * The caller must treat the string as a constant and not modify it
6330N/A * in any way.
6330N/A */
6330N/AJNIEXPORT const char * JNICALL
6330N/AJVM_GetCPClassNameUTF(JNIEnv *env, jclass cb, jint index);
6330N/A
6330N/A/*
6330N/A * Returns the class name refered to at a given constant pool index.
6330N/A *
6330N/A * The constant pool entry must refer to a CONSTANT_Fieldref.
6256N/A *
6330N/A * The result is in UTF format and remains valid until JVM_ReleaseUTF
6330N/A * is called.
6330N/A *
6330N/A * The caller must treat the string as a constant and not modify it
6330N/A * in any way.
6330N/A */
6330N/AJNIEXPORT const char * JNICALL
6330N/AJVM_GetCPFieldClassNameUTF(JNIEnv *env, jclass cb, jint index);
6330N/A
6330N/A/*
6330N/A * Returns the class name refered to at a given constant pool index.
6330N/A *
6330N/A * The constant pool entry must refer to CONSTANT_Methodref or
6330N/A * CONSTANT_InterfaceMethodref.
6330N/A *
6330N/A * The result is in UTF format and remains valid until JVM_ReleaseUTF
6330N/A * is called.
6330N/A *
6330N/A * The caller must treat the string as a constant and not modify it
6330N/A * in any way.
6330N/A */
6330N/AJNIEXPORT const char * JNICALL
6330N/AJVM_GetCPMethodClassNameUTF(JNIEnv *env, jclass cb, jint index);
6330N/A
6330N/A/*
6330N/A * Returns the modifiers of a field in calledClass. The field is
2556N/A * referred to in class cb at constant pool entry index.
6330N/A *
6330N/A * The caller must treat the string as a constant and not modify it
6330N/A * in any way.
6330N/A *
6330N/A * Returns -1 if the field does not exist in calledClass.
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetCPFieldModifiers(JNIEnv *env, jclass cb, int index, jclass calledClass);
6330N/A
6330N/A/*
6330N/A * Returns the modifiers of a method in calledClass. The method is
6330N/A * referred to in class cb at constant pool entry index.
6330N/A *
6330N/A * Returns -1 if the method does not exist in calledClass.
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetCPMethodModifiers(JNIEnv *env, jclass cb, int index, jclass calledClass);
4575N/A
4575N/A/*
6330N/A * Releases the UTF string obtained from the VM.
6330N/A */
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_ReleaseUTF(const char *utf);
6330N/A
6330N/A/*
6330N/A * Compare if two classes are in the same package.
3381N/A */
6330N/AJNIEXPORT jboolean JNICALL
6330N/AJVM_IsSameClassPackage(JNIEnv *env, jclass class1, jclass class2);
6330N/A
6330N/A/* Get classfile constants */
6330N/A#include "classfile_constants.h"
6330N/A
6330N/A/*
0N/A * A function defined by the byte-code verifier and called by the VM.
6330N/A * This is not a function implemented in the VM.
6330N/A *
6330N/A * Returns JNI_FALSE if verification fails. A detailed error message
6330N/A * will be places in msg_buf, whose length is specified by buf_len.
6330N/A */
6330N/Atypedef jboolean (*verifier_fn_t)(JNIEnv *env,
6330N/A jclass cb,
6330N/A char * msg_buf,
6330N/A jint buf_len);
6330N/A
6330N/A
6330N/A/*
6330N/A * Support for a VM-independent class format checker.
6330N/A */
6330N/Atypedef struct {
6330N/A unsigned long code; /* byte code */
6330N/A unsigned long excs; /* exceptions */
6330N/A unsigned long etab; /* catch table */
6330N/A unsigned long lnum; /* line number */
6330N/A unsigned long lvar; /* local vars */
6330N/A} method_size_info;
6330N/A
6330N/Atypedef struct {
6330N/A unsigned int constants; /* constant pool */
6330N/A unsigned int fields;
6330N/A unsigned int methods;
6330N/A unsigned int interfaces;
6330N/A unsigned int fields2; /* number of static 2-word fields */
6330N/A unsigned int innerclasses; /* # of records in InnerClasses attr */
6330N/A
6330N/A method_size_info clinit; /* memory used in clinit */
6330N/A method_size_info main; /* used everywhere else */
6330N/A} class_size_info;
6330N/A
6330N/A/*
6330N/A * Functions defined in libjava.so to perform string conversions.
6330N/A *
6330N/A */
6330N/A
6330N/Atypedef jstring (*to_java_string_fn_t)(JNIEnv *env, char *str);
6330N/A
6330N/Atypedef char *(*to_c_string_fn_t)(JNIEnv *env, jstring s, jboolean *b);
3069N/A
6330N/A/* This is the function defined in libjava.so that performs class
6330N/A * format checks. This functions fills in size information about
6330N/A * the class file and returns:
6330N/A *
6330N/A * 0: good
6330N/A * -1: out of memory
6330N/A * -2: bad format
3069N/A * -3: unsupported version
6330N/A * -4: bad class name
6330N/A */
6330N/A
6330N/Atypedef jint (*check_format_fn_t)(char *class_name,
6330N/A unsigned char *data,
6330N/A unsigned int data_size,
6330N/A class_size_info *class_size,
6330N/A char *message_buffer,
6330N/A jint buffer_length,
6330N/A jboolean measure_only,
6330N/A jboolean check_relaxed);
6330N/A
3069N/A#define JVM_RECOGNIZED_CLASS_MODIFIERS (JVM_ACC_PUBLIC | \
6330N/A JVM_ACC_FINAL | \
6330N/A JVM_ACC_SUPER | \
6330N/A JVM_ACC_INTERFACE | \
6330N/A JVM_ACC_ABSTRACT | \
6330N/A JVM_ACC_ANNOTATION | \
6330N/A JVM_ACC_ENUM | \
6330N/A JVM_ACC_SYNTHETIC)
6330N/A
6330N/A#define JVM_RECOGNIZED_FIELD_MODIFIERS (JVM_ACC_PUBLIC | \
6330N/A JVM_ACC_PRIVATE | \
6330N/A JVM_ACC_PROTECTED | \
6330N/A JVM_ACC_STATIC | \
6330N/A JVM_ACC_FINAL | \
6330N/A JVM_ACC_VOLATILE | \
6330N/A JVM_ACC_TRANSIENT | \
6330N/A JVM_ACC_ENUM | \
6330N/A JVM_ACC_SYNTHETIC)
6330N/A
6330N/A#define JVM_RECOGNIZED_METHOD_MODIFIERS (JVM_ACC_PUBLIC | \
6330N/A JVM_ACC_PRIVATE | \
6330N/A JVM_ACC_PROTECTED | \
6330N/A JVM_ACC_STATIC | \
6330N/A JVM_ACC_FINAL | \
6330N/A JVM_ACC_SYNCHRONIZED | \
6330N/A JVM_ACC_BRIDGE | \
6330N/A JVM_ACC_VARARGS | \
6330N/A JVM_ACC_NATIVE | \
6330N/A JVM_ACC_ABSTRACT | \
6330N/A JVM_ACC_STRICT | \
6330N/A JVM_ACC_SYNTHETIC)
6330N/A
6330N/A/*
6330N/A * This is the function defined in libjava.so to perform path
6330N/A * canonicalization. VM call this function before opening jar files
6330N/A * to load system classes.
6330N/A *
6330N/A */
6330N/A
6330N/Atypedef int (*canonicalize_fn_t)(JNIEnv *env, char *orig, char *out, int len);
6330N/A
6330N/A/*************************************************************************
6330N/A PART 3: I/O and Network Support
6330N/A ************************************************************************/
3069N/A
6330N/A/* Note that the JVM IO functions are expected to return JVM_IO_ERR
6330N/A * when there is any kind of error. The caller can then use the
6330N/A * platform specific support (e.g., errno) to get the detailed
6330N/A * error info. The JVM_GetLastErrorString procedure may also be used
6330N/A * to obtain a descriptive error string.
6330N/A */
6330N/A#define JVM_IO_ERR (-1)
6330N/A
6330N/A/* For interruptible IO. Returning JVM_IO_INTR indicates that an IO
6330N/A * operation has been disrupted by Thread.interrupt. There are a
6330N/A * number of technical difficulties related to interruptible IO that
6330N/A * need to be solved. For example, most existing programs do not handle
6330N/A * InterruptedIOExceptions specially, they simply treat those as any
3069N/A * IOExceptions, which typically indicate fatal errors.
6330N/A *
6330N/A * There are also two modes of operation for interruptible IO. In the
6330N/A * resumption mode, an interrupted IO operation is guaranteed not to
6330N/A * have any side-effects, and can be restarted. In the termination mode,
6330N/A * an interrupted IO operation corrupts the underlying IO stream, so
6330N/A * that the only reasonable operation on an interrupted stream is to
6330N/A * close that stream. The resumption mode seems to be impossible to
6330N/A * implement on Win32 and Solaris. Implementing the termination mode is
6330N/A * easier, but it's not clear that's the right semantics.
6330N/A *
6330N/A * Interruptible IO is not supported on Win32.It can be enabled/disabled
6330N/A * using a compile-time flag on Solaris. Third-party JVM ports do not
6330N/A * need to implement interruptible IO.
3069N/A */
6330N/A#define JVM_IO_INTR (-2)
6330N/A
6330N/A/* Write a string into the given buffer, in the platform's local encoding,
6330N/A * that describes the most recent system-level error to occur in this thread.
6330N/A * Return the length of the string or zero if no error occurred.
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_GetLastErrorString(char *buf, int len);
6330N/A
6330N/A/*
6330N/A * Convert a pathname into native format. This function does syntactic
6330N/A * cleanup, such as removing redundant separator characters. It modifies
6330N/A * the given pathname string in place.
6330N/A */
6330N/AJNIEXPORT char * JNICALL
6330N/AJVM_NativePath(char *);
6330N/A
6330N/A/*
6330N/A * JVM I/O error codes
6330N/A */
6330N/A#define JVM_EEXIST -100
6330N/A
6330N/A/*
6330N/A * Open a file descriptor. This function returns a negative error code
6330N/A * on error, and a non-negative integer that is the file descriptor on
6330N/A * success.
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_Open(const char *fname, jint flags, jint mode);
6330N/A
6331N/A/*
6330N/A * Close a file descriptor. This function returns -1 on error, and 0
6330N/A * on success.
6330N/A *
6330N/A * fd the file descriptor to close.
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_Close(jint fd);
6330N/A
6330N/A/*
6330N/A * Read data from a file decriptor into a char array.
6330N/A *
6330N/A * fd the file descriptor to read from.
6330N/A * buf the buffer where to put the read data.
6330N/A * nbytes the number of bytes to read.
6330N/A *
6330N/A * This function returns -1 on error, and 0 on success.
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_Read(jint fd, char *buf, jint nbytes);
6330N/A
6330N/A/*
6330N/A * Write data from a char array to a file decriptor.
6330N/A *
6330N/A * fd the file descriptor to read from.
6330N/A * buf the buffer from which to fetch the data.
6330N/A * nbytes the number of bytes to write.
6330N/A *
6330N/A * This function returns -1 on error, and 0 on success.
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6238N/AJVM_Write(jint fd, char *buf, jint nbytes);
6330N/A
6330N/A/*
6330N/A * Returns the number of bytes available for reading from a given file
6330N/A * descriptor
6330N/A */
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_Available(jint fd, jlong *pbytes);
6330N/A
6330N/A/*
6330N/A * Move the file descriptor pointer from whence by offset.
6330N/A *
6330N/A * fd the file descriptor to move.
6330N/A * offset the number of bytes to move it by.
6330N/A * whence the start from where to move it.
6330N/A *
6330N/A * This function returns the resulting pointer location.
6330N/A */
6330N/AJNIEXPORT jlong JNICALL
6330N/AJVM_Lseek(jint fd, jlong offset, jint whence);
6330N/A
6280N/A/*
6331N/A * Set the length of the file associated with the given descriptor to the given
6331N/A * length. If the new length is longer than the current length then the file
6331N/A * is extended; the contents of the extended portion are not defined. The
6331N/A * value of the file pointer is undefined after this procedure returns.
6331N/A */
6331N/AJNIEXPORT jint JNICALL
6331N/AJVM_SetLength(jint fd, jlong length);
6331N/A
6331N/A/*
6331N/A * Synchronize the file descriptor's in memory state with that of the
6331N/A * physical device. Return of -1 is an error, 0 is OK.
6331N/A */
6331N/AJNIEXPORT jint JNICALL
6331N/AJVM_Sync(jint fd);
6331N/A
6331N/A/*
6331N/A * Networking library support
6331N/A */
6331N/A
6331N/AJNIEXPORT jint JNICALL
6331N/AJVM_InitializeSocketLibrary(void);
6331N/A
6331N/Astruct sockaddr;
6331N/A
6331N/AJNIEXPORT jint JNICALL
6331N/AJVM_Socket(jint domain, jint type, jint protocol);
6331N/A
6331N/AJNIEXPORT jint JNICALL
6331N/AJVM_SocketClose(jint fd);
6331N/A
6331N/AJNIEXPORT jint JNICALL
1177N/AJVM_SocketShutdown(jint fd, jint howto);
6330N/A
6331N/AJNIEXPORT jint JNICALL
6331N/AJVM_Recv(jint fd, char *buf, jint nBytes, jint flags);
6330N/A
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_Send(jint fd, char *buf, jint nBytes, jint flags);
6330N/A
6331N/AJNIEXPORT jint JNICALL
6331N/AJVM_Timeout(int fd, long timeout);
6331N/A
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_Listen(jint fd, jint count);
6330N/A
6330N/AJNIEXPORT jint JNICALL
0N/AJVM_Connect(jint fd, struct sockaddr *him, jint len);
6331N/A
6331N/AJNIEXPORT jint JNICALL
6331N/AJVM_Bind(jint fd, struct sockaddr *him, jint len);
6331N/A
6331N/AJNIEXPORT jint JNICALL
6331N/AJVM_Accept(jint fd, struct sockaddr *him, jint *len);
6331N/A
6331N/AJNIEXPORT jint JNICALL
6331N/AJVM_RecvFrom(jint fd, char *buf, int nBytes,
6331N/A int flags, struct sockaddr *from, int *fromlen);
6331N/A
6331N/AJNIEXPORT jint JNICALL
6331N/AJVM_SendTo(jint fd, char *buf, int len,
6331N/A int flags, struct sockaddr *to, int tolen);
6331N/A
6331N/AJNIEXPORT jint JNICALL
6331N/AJVM_SocketAvailable(jint fd, jint *result);
6331N/A
6331N/A
6331N/AJNIEXPORT jint JNICALL
6331N/AJVM_GetSockName(jint fd, struct sockaddr *him, int *len);
6331N/A
6331N/AJNIEXPORT jint JNICALL
6331N/AJVM_GetSockOpt(jint fd, int level, int optname, char *optval, int *optlen);
6331N/A
6331N/AJNIEXPORT jint JNICALL
0N/AJVM_SetSockOpt(jint fd, int level, int optname, const char *optval, int optlen);
6330N/A
6330N/AJNIEXPORT int JNICALL
6330N/AJVM_GetHostName(char* name, int namelen);
6330N/A
6330N/A/*
6330N/A * The standard printing functions supported by the Java VM. (Should they
6330N/A * be renamed to JVM_* in the future?
6330N/A */
6330N/A
6330N/A/*
6330N/A * BE CAREFUL! The following functions do not implement the
6330N/A * full feature set of standard C printf formats.
0N/A */
6330N/Aint
6330N/Ajio_vsnprintf(char *str, size_t count, const char *fmt, va_list args);
6330N/A
6330N/Aint
6330N/Ajio_snprintf(char *str, size_t count, const char *fmt, ...);
0N/A
6330N/Aint
6330N/Ajio_fprintf(FILE *, const char *fmt, ...);
6330N/A
6330N/Aint
6330N/Ajio_vfprintf(FILE *, const char *fmt, va_list args);
6330N/A
6330N/A
6330N/AJNIEXPORT void * JNICALL
6330N/AJVM_RawMonitorCreate(void);
6330N/A
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_RawMonitorDestroy(void *mon);
6330N/A
6330N/AJNIEXPORT jint JNICALL
6330N/AJVM_RawMonitorEnter(void *mon);
6330N/A
6330N/AJNIEXPORT void JNICALL
6330N/AJVM_RawMonitorExit(void *mon);
6330N/A
6330N/A/*
6330N/A * java.lang.management support
6330N/A */
6330N/AJNIEXPORT void* JNICALL
6330N/AJVM_GetManagement(jint version);
0N/A
6330N/A/*
6330N/A * com.sun.tools.attach.VirtualMachine support
6330N/A *
6330N/A * Initialize the agent properties with the properties maintained in the VM.
6330N/A */
6330N/AJNIEXPORT jobject JNICALL
0N/AJVM_InitAgentProperties(JNIEnv *env, jobject agent_props);
6330N/A
6330N/A/* Generics reflection support.
6330N/A *
6330N/A * Returns information about the given class's EnclosingMethod
6330N/A * attribute, if present, or null if the class had no enclosing
6330N/A * method.
6330N/A *
6330N/A * If non-null, the returned array contains three elements. Element 0
6330N/A * is the java.lang.Class of which the enclosing method is a member,
6330N/A * and elements 1 and 2 are the java.lang.Strings for the enclosing
3000N/A * method's name and descriptor, respectively.
6330N/A */
6330N/AJNIEXPORT jobjectArray JNICALL
6330N/AJVM_GetEnclosingMethodInfo(JNIEnv* env, jclass ofClass);
6330N/A
6330N/A/*
6330N/A * Java thread state support
6330N/A */
6330N/Aenum {
6330N/A JAVA_THREAD_STATE_NEW = 0,
6330N/A JAVA_THREAD_STATE_RUNNABLE = 1,
6330N/A JAVA_THREAD_STATE_BLOCKED = 2,
6330N/A JAVA_THREAD_STATE_WAITING = 3,
6330N/A JAVA_THREAD_STATE_TIMED_WAITING = 4,
6330N/A JAVA_THREAD_STATE_TERMINATED = 5,
6330N/A JAVA_THREAD_STATE_COUNT = 6
6330N/A};
6330N/A
6330N/A/*
6330N/A * Returns an array of the threadStatus values representing the
6330N/A * given Java thread state. Returns NULL if the VM version is
6330N/A * incompatible with the JDK or doesn't support the given
6330N/A * Java thread state.
6330N/A */
6330N/AJNIEXPORT jintArray JNICALL
6330N/AJVM_GetThreadStateValues(JNIEnv* env, jint javaThreadState);
6330N/A
6330N/A/*
6330N/A * Returns an array of the substate names representing the
0N/A * given Java thread state. Returns NULL if the VM version is
6331N/A * incompatible with the JDK or the VM doesn't support
6374N/A * the given Java thread state.
6374N/A * values must be the jintArray returned from JVM_GetThreadStateValues
6331N/A * and javaThreadState.
0N/A */
6331N/AJNIEXPORT jobjectArray JNICALL
6330N/AJVM_GetThreadStateNames(JNIEnv* env, jint javaThreadState, jintArray values);
6330N/A
6330N/A/* =========================================================================
6330N/A * The following defines a private JVM interface that the JDK can query
6330N/A * for the JVM version and capabilities. sun.misc.Version defines
6330N/A * the methods for getting the VM version and its capabilities.
6330N/A *
6330N/A * When a new bit is added, the following should be updated to provide
6330N/A * access to the new capability:
6330N/A * HS: JVM_GetVersionInfo and Abstract_VM_Version class
6330N/A * SDK: Version class
6330N/A *
6330N/A * Similary, a private JDK interface JDK_GetVersionInfo0 is defined for
6330N/A * JVM to query for the JDK version and capabilities.
6330N/A *
6330N/A * When a new bit is added, the following should be updated to provide
6330N/A * access to the new capability:
6330N/A * HS: JDK_Version class
0N/A * SDK: JDK_GetVersionInfo0
6331N/A *
6331N/A * ==========================================================================
6331N/A */
6331N/Atypedef struct {
6331N/A /* Naming convention of RE build version string: n.n.n[_uu[c]][-<identifier>]-bxx */
6331N/A unsigned int jvm_version; /* Consists of major, minor, micro (n.n.n) */
6331N/A /* and build number (xx) */
6331N/A unsigned int update_version : 8; /* Update release version (uu) */
6331N/A unsigned int special_update_version : 8; /* Special update release version (c)*/
6331N/A unsigned int reserved1 : 16;
6331N/A unsigned int reserved2;
6331N/A
6331N/A /* The following bits represents JVM supports that JDK has dependency on.
6331N/A * JDK can use these bits to determine which JVM version
6331N/A * and support it has to maintain runtime compatibility.
6331N/A *
6331N/A * When a new bit is added in a minor or update release, make sure
6331N/A * the new bit is also added in the main/baseline.
6331N/A */
6331N/A unsigned int is_attach_supported : 1;
6331N/A unsigned int is_kernel_jvm : 1;
6331N/A unsigned int : 30;
6331N/A unsigned int : 32;
6331N/A unsigned int : 32;
6331N/A} jvm_version_info;
6331N/A
6331N/A#define JVM_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24)
6331N/A#define JVM_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16)
6331N/A#define JVM_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8)
6331N/A
6331N/A/* Build number is available only for RE builds.
6331N/A * It will be zero for internal builds.
6331N/A */
6331N/A#define JVM_VERSION_BUILD(version) ((version & 0x000000FF))
6331N/A
6331N/AJNIEXPORT void JNICALL
6331N/AJVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t info_size);
6331N/A
6331N/Atypedef struct {
6331N/A // Naming convention of RE build version string: n.n.n[_uu[c]][-<identifier>]-bxx
6331N/A unsigned int jdk_version; /* Consists of major, minor, micro (n.n.n) */
0N/A /* and build number (xx) */
6331N/A unsigned int update_version : 8; /* Update release version (uu) */
6331N/A unsigned int special_update_version : 8; /* Special update release version (c)*/
6331N/A unsigned int reserved1 : 16;
6331N/A unsigned int reserved2;
6331N/A
6331N/A /* The following bits represents new JDK supports that VM has dependency on.
6331N/A * VM implementation can use these bits to determine which JDK version
6331N/A * and support it has to maintain runtime compatibility.
6331N/A *
6331N/A * When a new bit is added in a minor or update release, make sure
6330N/A * the new bit is also added in the main/baseline.
6330N/A */
6331N/A unsigned int thread_park_blocker : 1;
6331N/A unsigned int : 31;
6330N/A unsigned int : 32;
6331N/A unsigned int : 32;
6331N/A} jdk_version_info;
6331N/A
6331N/A#define JDK_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24)
6330N/A#define JDK_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16)
2528N/A#define JDK_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8)
6406N/A
6406N/A/* Build number is available only for RE build (i.e. JDK_BUILD_NUMBER is set to bNN)
6406N/A * It will be zero for internal builds.
6406N/A */
6406N/A#define JDK_VERSION_BUILD(version) ((version & 0x000000FF))
6406N/A
6406N/A/*
6406N/A * This is the function JDK_GetVersionInfo0 defined in libjava.so
6406N/A * that is dynamically looked up by JVM.
6406N/A */
6406N/Atypedef void (*jdk_version_info_fn_t)(jdk_version_info* info, size_t info_size);
6406N/A
6406N/A/*
0N/A * This structure is used by the launcher to get the default thread
6406N/A * stack size from the VM using JNI_GetDefaultJavaVMInitArgs() with a
6406N/A * version of 1.1. As it is not supported otherwise, it has been removed
6330N/A * from jni.h
6330N/A */
6330N/Atypedef struct JDK1_1InitArgs {
6330N/A jint version;
6331N/A
6331N/A char **properties;
6331N/A jint checkSource;
6330N/A jint nativeStackSize;
6330N/A jint javaStackSize;
6330N/A jint minHeapSize;
6330N/A jint maxHeapSize;
6330N/A jint verifyMode;
6330N/A char *classpath;
6330N/A
6330N/A jint (JNICALL *vfprintf)(FILE *fp, const char *format, va_list args);
0N/A void (JNICALL *exit)(jint code);
0N/A void (JNICALL *abort)(void);
6330N/A
6330N/A jint enableClassGC;
6330N/A jint enableVerboseGC;
6330N/A jint disableAsyncGC;
6330N/A jint verbose;
6330N/A jboolean debugging;
6330N/A jint debugPort;
6330N/A} JDK1_1InitArgs;
6330N/A
6330N/A
6330N/A#ifdef __cplusplus
6330N/A} /* extern "C" */
2900N/A
6330N/A#endif /* __cplusplus */
6330N/A
6330N/A#endif /* !_JAVASOFT_JVM_H_ */
6330N/A