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