org.jikesrvm.jni
Class JNIFunctions

java.lang.Object
  extended by org.jikesrvm.jni.JNIFunctions
All Implemented Interfaces:
SizeConstants

public class JNIFunctions
extends Object
implements SizeConstants

This class implements the 232 JNI functions. All methods here will be specially compiled with the necessary prolog to perform the transition from native code (Linux/AIX/OSX convention) to RVM. For this reason, no Java methods (including the JNI methods here) can call any methods in this class from within Java. These JNI methods are to be invoked from native C or C++. They're all declared private to enforce this discipline.
The first argument for all the functions is the JNIEnvironment object of the thread.
The second argument is a JREF index for either the RVMClass object or the object instance itself. To get the actual object, we use the access method in JNIEnvironment and cast the reference as needed.
NOTE:

  1. JREF index refers to the index into the side table of references maintained by the JNIEnvironment for each thread. Except for some cases of array access, no references are passed directly to the native code; rather, the references are kept in the table and the index is passed to the native procedure. The JREF index are used by the JNI code to retrieve the corresponding reference.
  2. Strings from C are seen as raw address (int) and need to be cloned as Java Strings
  3. Because of many of the transformation above, the method signature of the JNI functions may not match its definition in the jni.h file
  4. For exception handling, all JNI functions are wrapped in Try/Catch block to catch all exception generated during JNI call, then these exceptions or the appropriate exception to be thrown according to the spec is recorded in JNIEnvironment.pendingException. When the native code returns to the the Java caller, the epilogue in the glue code will check for the pending exception and deliver it to the caller as if executing an athrow bytecode in the caller.
Known Problems with our JNI implementation:
  1. We can not return a global reference (whether weak or strong) from a JNI function. We can only return local refs.
  2. We do not implement all of the invocation API; we don't support the concept of a regular native program that links with "libjava" and creates and destroys virtual machines.
  3. Similarly, we can not attach and detach a native threads to and from the VM.
  4. We don't really free local refs when we call the PopLocalFrame(org.jikesrvm.jni.JNIEnvironment, int) method.


Field Summary
static int FUNCTIONCOUNT
           
static boolean traceJNI
           
 
Fields inherited from interface org.jikesrvm.SizeConstants
BITS_IN_ADDRESS, BITS_IN_BOOLEAN, BITS_IN_BYTE, BITS_IN_CHAR, BITS_IN_DOUBLE, BITS_IN_EXTENT, BITS_IN_FLOAT, BITS_IN_INT, BITS_IN_LONG, BITS_IN_OFFSET, BITS_IN_PAGE, BITS_IN_SHORT, BITS_IN_WORD, BYTES_IN_ADDRESS, BYTES_IN_BOOLEAN, BYTES_IN_BYTE, BYTES_IN_CHAR, BYTES_IN_DOUBLE, BYTES_IN_EXTENT, BYTES_IN_FLOAT, BYTES_IN_INT, BYTES_IN_LONG, BYTES_IN_OFFSET, BYTES_IN_PAGE, BYTES_IN_SHORT, BYTES_IN_WORD, LOG_BITS_IN_ADDRESS, LOG_BITS_IN_BOOLEAN, LOG_BITS_IN_BYTE, LOG_BITS_IN_CHAR, LOG_BITS_IN_DOUBLE, LOG_BITS_IN_EXTENT, LOG_BITS_IN_FLOAT, LOG_BITS_IN_INT, LOG_BITS_IN_LONG, LOG_BITS_IN_OFFSET, LOG_BITS_IN_PAGE, LOG_BITS_IN_SHORT, LOG_BITS_IN_WORD, LOG_BYTES_IN_ADDRESS, LOG_BYTES_IN_BOOLEAN, LOG_BYTES_IN_BYTE, LOG_BYTES_IN_CHAR, LOG_BYTES_IN_DOUBLE, LOG_BYTES_IN_EXTENT, LOG_BYTES_IN_FLOAT, LOG_BYTES_IN_INT, LOG_BYTES_IN_LONG, LOG_BYTES_IN_OFFSET, LOG_BYTES_IN_PAGE, LOG_BYTES_IN_SHORT, LOG_BYTES_IN_WORD
 
Constructor Summary
JNIFunctions()
           
 
Method Summary
private static int AllocObject(JNIEnvironment env, int classJREF)
          AllocObject: allocate the space for an object without running any constructor the header is filled and the fields are initialized to null
private static boolean CallBooleanMethod(JNIEnvironment env, int objJREF, int methodID)
          CallBooleanMethod: invoke a virtual method that returns a boolean value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static boolean CallBooleanMethodA(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallBooleanMethodA: invoke a virtual method that returns a boolean value
private static boolean CallBooleanMethodV(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallBooleanMethodV: invoke a virtual method that returns a boolean value
private static byte CallByteMethod(JNIEnvironment env, int objJREF, int methodID)
          CallByteMethod: invoke a virtual method that returns a byte value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static byte CallByteMethodA(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallByteMethodA: invoke a virtual method that returns a byte value
private static byte CallByteMethodV(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallByteMethodV: invoke a virtual method that returns a byte value
private static char CallCharMethod(JNIEnvironment env, int objJREF, int methodID)
          CallCharMethod: invoke a virtual method that returns a char value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static char CallCharMethodA(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallCharMethodA: invoke a virtual method that returns a char value
private static char CallCharMethodV(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallCharMethodV: invoke a virtual method that returns a char value
private static double CallDoubleMethod(JNIEnvironment env, int objJREF, int methodID)
          CallDoubleMethod: invoke a virtual method that returns a double value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static double CallDoubleMethodA(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallDoubleMethodA: invoke a virtual method that returns a double value
private static double CallDoubleMethodV(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallDoubleMethodV: invoke a virtual method that returns a double value
private static float CallFloatMethod(JNIEnvironment env, int objJREF, int methodID)
          CallFloatMethod: invoke a virtual method that returns a float value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static float CallFloatMethodA(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallFloatMethodA: invoke a virtual method that returns a float value
private static float CallFloatMethodV(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallFloatMethodV: invoke a virtual method that returns a float value
private static int CallIntMethod(JNIEnvironment env, int objJREF, int methodID)
          CallIntMethod: invoke a virtual method that returns a int value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static int CallIntMethodA(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallIntMethodA: invoke a virtual method that returns an integer value
private static int CallIntMethodV(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallIntMethodV: invoke a virtual method that returns an int value
private static long CallLongMethod(JNIEnvironment env, int objJREF, int methodID)
          CallLongMethod: invoke a virtual method that returns a long value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static long CallLongMethodA(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallLongMethodA: invoke a virtual method that returns a long value
private static long CallLongMethodV(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallLongMethodV: invoke a virtual method that returns a long value
private static boolean CallNonvirtualBooleanMethod(JNIEnvironment env, int objJREF, int classJREF, int methodID)
          CallNonvirtualBooleanMethod: invoke a virtual method that returns a boolean value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static boolean CallNonvirtualBooleanMethodA(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualBooleanMethodA: invoke a virtual method that returns a boolean value
private static boolean CallNonvirtualBooleanMethodV(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualBooleanMethodV: invoke a virtual method that returns a boolean value
private static byte CallNonvirtualByteMethod(JNIEnvironment env, int objJREF, int classJREF, int methodID)
          CallNonvirtualByteMethod: invoke a virtual method that returns a byte value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static byte CallNonvirtualByteMethodA(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualByteMethodA: invoke a virtual method that returns a byte value
private static byte CallNonvirtualByteMethodV(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualByteMethodV: invoke a virtual method that returns a byte value
private static char CallNonvirtualCharMethod(JNIEnvironment env, int objJREF, int classJREF, int methodID)
          CallNonvirtualCharMethod: invoke a virtual method that returns a char value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static char CallNonvirtualCharMethodA(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualCharMethodA: invoke a virtual method that returns a char value
private static char CallNonvirtualCharMethodV(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualCharMethodV: invoke a virtual method that returns a char value
private static double CallNonvirtualDoubleMethod(JNIEnvironment env, int objJREF, int classJREF, int methodID)
          CallNonvirtualDoubleMethod: invoke a virtual method that returns a double value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static double CallNonvirtualDoubleMethodA(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualDoubleMethodA: invoke a virtual method that returns a double value
private static double CallNonvirtualDoubleMethodV(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualDoubleMethodV: invoke a virtual method that returns a double value
private static float CallNonvirtualFloatMethod(JNIEnvironment env, int objJREF, int classJREF, int methodID)
          CallNonvirtualFloatMethod: invoke a virtual method that returns a float value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static float CallNonvirtualFloatMethodA(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualFloatMethodA: invoke a virtual method that returns a float value
private static float CallNonvirtualFloatMethodV(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualFloatMethodV: invoke a virtual method that returns a float value
private static int CallNonvirtualIntMethod(JNIEnvironment env, int objJREF, int classJREF, int methodID)
          CallNonvirtualIntMethod: invoke a virtual method that returns a int value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static int CallNonvirtualIntMethodA(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualIntMethodA: invoke a virtual method that returns an integer value
private static int CallNonvirtualIntMethodV(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualIntMethodV: invoke a virtual method that returns an int value
private static long CallNonvirtualLongMethod(JNIEnvironment env, int objJREF, int classJREF, int methodID)
          CallNonvirtualLongMethod: invoke a virtual method that returns a long value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static long CallNonvirtualLongMethodA(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualLongMethodA: invoke a virtual method that returns a long value
private static long CallNonvirtualLongMethodV(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualLongMethodV: invoke a virtual method that returns a long value
private static int CallNonvirtualObjectMethod(JNIEnvironment env, int objJREF, int classJREF, int methodID)
          CallNonvirtualObjectMethod: invoke a virtual method that returns an object arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static int CallNonvirtualObjectMethodA(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualNonvirtualObjectMethodA: invoke a virtual method that returns an object value
private static int CallNonvirtualObjectMethodV(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualObjectMethodV: invoke a virtual method that returns an object
private static short CallNonvirtualShortMethod(JNIEnvironment env, int objJREF, int classJREF, int methodID)
          CallNonvirtualShortMethod: invoke a virtual method that returns a short value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static short CallNonvirtualShortMethodA(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualShortMethodA: invoke a virtual method that returns a short value
private static short CallNonvirtualShortMethodV(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualShortMethodV: invoke a virtual method that returns a short value
private static void CallNonvirtualVoidMethod(JNIEnvironment env, int objJREF, int classJREF, int methodID)
          CallNonvirtualVoidMethod: invoke a virtual method that returns a void value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static void CallNonvirtualVoidMethodA(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualVoidMethodA: invoke a virtual method that returns void
private static void CallNonvirtualVoidMethodV(JNIEnvironment env, int objJREF, int classJREF, int methodID, Address argAddress)
          CallNonvirtualVoidMethodV: invoke a virtual method that returns void
private static int CallObjectMethod(JNIEnvironment env, int objJREF, int methodID)
          CallObjectMethod: invoke a virtual method that returns an object arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static int CallObjectMethodA(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallObjectMethodA: invoke a virtual method that returns an object value
private static int CallObjectMethodV(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallObjectMethodV: invoke a virtual method that returns an object
private static short CallShortMethod(JNIEnvironment env, int objJREF, int methodID)
          CallShortMethod: invoke a virtual method that returns a short value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static short CallShortMethodA(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallShortMethodA: invoke a virtual method that returns a short value
private static short CallShortMethodV(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallShortMethodV: invoke a virtual method that returns a short value
private static boolean CallStaticBooleanMethod(JNIEnvironment env, int classJREF, int methodID)
          CallStaticBooleanMethod: invoke a static method that returns a boolean value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static boolean CallStaticBooleanMethodA(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticBooleanMethodA: invoke a static method that returns a boolean value
private static boolean CallStaticBooleanMethodV(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticBooleanMethodV: invoke a static method that returns a boolean value
private static byte CallStaticByteMethod(JNIEnvironment env, int classJREF, int methodID)
          CallStaticByteMethod: invoke a static method that returns a byte value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static byte CallStaticByteMethodA(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticByteMethodA: invoke a static method that returns a byte value
private static byte CallStaticByteMethodV(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticByteMethodV: invoke a static method that returns a byte value
private static char CallStaticCharMethod(JNIEnvironment env, int classJREF, int methodID)
          CallStaticCharMethod: invoke a static method that returns a char value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static char CallStaticCharMethodA(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticCharMethodA: invoke a static method that returns a char value
private static char CallStaticCharMethodV(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticCharMethodV: invoke a static method that returns a char value
private static double CallStaticDoubleMethod(JNIEnvironment env, int classJREF, int methodID)
          CallStaticDoubleMethod: invoke a static method that returns a double value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static double CallStaticDoubleMethodA(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticDoubleMethodA: invoke a static method that returns a double value
private static double CallStaticDoubleMethodV(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticDoubleMethodV: invoke a static method that returns a double value
private static float CallStaticFloatMethod(JNIEnvironment env, int classJREF, int methodID)
          CallStaticFloagMethod: invoke a static method that returns a float value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static float CallStaticFloatMethodA(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticFloatMethodA: invoke a static method that returns a float value
private static float CallStaticFloatMethodV(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticFloatMethodV: invoke a static method that returns a float value
private static int CallStaticIntMethod(JNIEnvironment env, int classJREF, int methodID)
          CallStaticIntMethod: invoke a static method that returns an integer value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static int CallStaticIntMethodA(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticIntMethodA: invoke a static method that returns an integer value
private static int CallStaticIntMethodV(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticIntMethodV: invoke a static method that returns an integer value
private static long CallStaticLongMethod(JNIEnvironment env, int classJREF, int methodID)
          CallStaticLongMethod: invoke a static method that returns a long value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static long CallStaticLongMethodA(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticLongMethodA: invoke a static method that returns a long value
private static long CallStaticLongMethodV(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticLongMethodV: invoke a static method that returns a long value
private static int CallStaticObjectMethod(JNIEnvironment env, int classJREF, int methodID)
          CallStaticObjectMethod: invoke a static method that returns an object value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static int CallStaticObjectMethodA(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticObjectMethodA: invoke a static method that returns an object
private static int CallStaticObjectMethodV(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticObjectMethodV: invoke a static method that returns an object
private static short CallStaticShortMethod(JNIEnvironment env, int classJREF, int methodID)
          CallStaticShortMethod: invoke a static method that returns a short value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static short CallStaticShortMethodA(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticShortMethodA: invoke a static method that returns a short value
private static short CallStaticShortMethodV(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticShortMethodV: invoke a static method that returns a short value
private static void CallStaticVoidMethod(JNIEnvironment env, int classJREF, int methodID)
          CallStaticVoidMethod: invoke a static method that returns void arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static void CallStaticVoidMethodA(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticVoidMethodA: invoke a static method that returns void
private static void CallStaticVoidMethodV(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          CallStaticVoidMethodA: invoke a static method that returns void
private static void CallVoidMethod(JNIEnvironment env, int objJREF, int methodID)
          CallVoidMethod: invoke a virtual method that returns a void value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static void CallVoidMethodA(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallVoidMethodA: invoke a virtual method that returns void
private static void CallVoidMethodV(JNIEnvironment env, int objJREF, int methodID, Address argAddress)
          CallVoidMethodV: invoke a virtual method that returns void
private static int DefineClass(JNIEnvironment env, Address classNameAddress, int classLoader, Address data, int dataLen)
          DefineClass: Loads a class from a buffer of raw class data.
private static void DeleteGlobalRef(JNIEnvironment env, int refJREF)
           
private static void DeleteLocalRef(JNIEnvironment env, int objJREF)
           
private static void DeleteWeakGlobalRef(JNIEnvironment env, int refJREF)
           
private static int EnsureLocalCapacity(JNIEnvironment env, int capacity)
          EnsureLocalCapacity
private static int ExceptionCheck(JNIEnvironment env)
           
private static void ExceptionClear(JNIEnvironment env)
          ExceptionClear
private static void ExceptionDescribe(JNIEnvironment env)
          ExceptionDescribe: print the exception description and the stack trace back, then clear the exception
private static int ExceptionOccurred(JNIEnvironment env)
          ExceptionOccurred
private static void FatalError(JNIEnvironment env, Address messageAddress)
          FatalError: print a message and terminate the VM
private static int FindClass(JNIEnvironment env, Address classNameAddress)
          FindClass: given a class name, find its RVMClass, or 0 if not found
private static int FromReflectedField(JNIEnvironment env, int fieldJREF)
          FromReflectedField
private static int FromReflectedMethod(JNIEnvironment env, int methodJREF)
          FromReflectedMethod
private static int GetArrayLength(JNIEnvironment env, int arrayJREF)
          GetArrayLength: return array length
private static Address GetBooleanArrayElements(JNIEnvironment env, int arrayJREF, Address isCopyAddress)
          GetBooleanArrayElements: get all the elements of a boolean array
private static void GetBooleanArrayRegion(JNIEnvironment env, int arrayJREF, int startIndex, int length, Address bufAddress)
          GetBooleanArrayRegion: copy a region of the array into the native buffer
private static int GetBooleanField(JNIEnvironment env, int objJREF, int fieldID)
          GetBooleanField: read an instance field of type boolean
private static Address GetByteArrayElements(JNIEnvironment env, int arrayJREF, Address isCopyAddress)
          GetByteArrayElements: get all the elements of a byte array
private static void GetByteArrayRegion(JNIEnvironment env, int arrayJREF, int startIndex, int length, Address bufAddress)
          GetByteArrayRegion: copy a region of the array into the native buffer
private static int GetByteField(JNIEnvironment env, int objJREF, int fieldID)
          GetByteField: read an instance field of type byte
private static Address GetCharArrayElements(JNIEnvironment env, int arrayJREF, Address isCopyAddress)
          GetCharArrayElements: get all the elements of a char array
private static void GetCharArrayRegion(JNIEnvironment env, int arrayJREF, int startIndex, int length, Address bufAddress)
          GetCharArrayRegion: copy a region of the array into the native buffer
private static int GetCharField(JNIEnvironment env, int objJREF, int fieldID)
          GetCharField: read an instance field of type character
private static Address GetDirectBufferAddress(JNIEnvironment env, int bufJREF)
           
private static long GetDirectBufferCapacity(JNIEnvironment env, int bufJREF)
           
private static Address GetDoubleArrayElements(JNIEnvironment env, int arrayJREF, Address isCopyAddress)
          GetDoubleArrayElements: get all the elements of a double array
private static void GetDoubleArrayRegion(JNIEnvironment env, int arrayJREF, int startIndex, int length, Address bufAddress)
          GetDoubleArrayRegion: copy a region of the array into the native buffer
private static double GetDoubleField(JNIEnvironment env, int objJREF, int fieldID)
          GetDoubleField: read an instance field of type double
private static int GetFieldID(JNIEnvironment env, int classJREF, Address fieldNameAddress, Address descriptorAddress)
          GetFieldID: return a field id, which can be cached in native code and reused
private static Address GetFloatArrayElements(JNIEnvironment env, int arrayJREF, Address isCopyAddress)
          GetFloatArrayElements: get all the elements of a float array
private static void GetFloatArrayRegion(JNIEnvironment env, int arrayJREF, int startIndex, int length, Address bufAddress)
          GetFloatArrayRegion: copy a region of the array into the native buffer
private static float GetFloatField(JNIEnvironment env, int objJREF, int fieldID)
          GetFloatField: read an instance field of type float
private static Address GetIntArrayElements(JNIEnvironment env, int arrayJREF, Address isCopyAddress)
          GetIntArrayElements: get all the elements of an integer array
private static void GetIntArrayRegion(JNIEnvironment env, int arrayJREF, int startIndex, int length, Address bufAddress)
          GetIntArrayRegion: copy a region of the array into the native buffer
private static int GetIntField(JNIEnvironment env, int objJREF, int fieldID)
          GetIntField: read an instance field of type integer
private static int GetJavaVM(JNIEnvironment env, Address StarStarJavaVM)
           
private static Address GetLongArrayElements(JNIEnvironment env, int arrayJREF, Address isCopyAddress)
          GetLongArrayElements: get all the elements of a long array
private static void GetLongArrayRegion(JNIEnvironment env, int arrayJREF, int startIndex, int length, Address bufAddress)
          GetLongArrayRegion: copy a region of the array into the native buffer
private static long GetLongField(JNIEnvironment env, int objJREF, int fieldID)
          GetLongField: read an instance field of type long
private static int GetMethodID(JNIEnvironment env, int classJREF, Address methodNameAddress, Address methodSigAddress)
          GetMethodID: get the virtual method ID given the name and the signature
private static int GetObjectArrayElement(JNIEnvironment env, int arrayJREF, int index)
          GetObjectArrayElement: retrieve an object from an object array
private static int GetObjectClass(JNIEnvironment env, int objJREF)
          GetObjectClass
private static int GetObjectField(JNIEnvironment env, int objJREF, int fieldID)
          GetObjectField: read a instance field of type Object
private static Address GetPrimitiveArrayCritical(JNIEnvironment env, int arrayJREF, Address isCopyAddress)
          GetPrimitiveArrayCritical: return a direct pointer to the primitive array and disable GC so that the array will not be moved.
private static Address GetShortArrayElements(JNIEnvironment env, int arrayJREF, Address isCopyAddress)
          GetShortArrayElements: get all the elements of a short array
private static void GetShortArrayRegion(JNIEnvironment env, int arrayJREF, int startIndex, int length, Address bufAddress)
          GetShortArrayRegion: copy a region of the array into the native buffer
private static int GetShortField(JNIEnvironment env, int objJREF, int fieldID)
          GetShortField: read an instance field of type short
private static int GetStaticBooleanField(JNIEnvironment env, int classJREF, int fieldID)
          GetStaticBooleanField: read a static field of type boolean
private static int GetStaticByteField(JNIEnvironment env, int classJREF, int fieldID)
          GetStaticByteField: read a static field of type byte
private static int GetStaticCharField(JNIEnvironment env, int classJREF, int fieldID)
          GetStaticCharField: read a static field of type character
private static double GetStaticDoubleField(JNIEnvironment env, int classJREF, int fieldID)
          GetStaticDoubleField: read a static field of type double
private static int GetStaticFieldID(JNIEnvironment env, int classJREF, Address fieldNameAddress, Address descriptorAddress)
          GetStaticFieldID: return a field id which can be cached in native code and reused
private static float GetStaticFloatField(JNIEnvironment env, int classJREF, int fieldID)
          GetStaticFloatField: read a static field of type float
private static int GetStaticIntField(JNIEnvironment env, int classJREF, int fieldID)
          GetStaticIntField: read a static field of type integer
private static long GetStaticLongField(JNIEnvironment env, int classJREF, int fieldID)
          GetStaticLongField: read a static field of type long
private static int GetStaticMethodID(JNIEnvironment env, int classJREF, Address methodNameAddress, Address methodSigAddress)
          GetStaticMethodID: return the method ID for invocation later
private static int GetStaticObjectField(JNIEnvironment env, int classJREF, int fieldID)
          GetStaticObjectField: read a static field of type Object
private static int GetStaticShortField(JNIEnvironment env, int classJREF, int fieldID)
          GetStaticShortField: read a static field of type short
private static Address GetStringChars(JNIEnvironment env, int strJREF, Address isCopyAddress)
          GetStringChars: return address of buffer containing contents of a String
private static Address GetStringCritical(JNIEnvironment env, int strJREF, Address isCopyAddress)
          GetStringCritical: Like GetStringChars and ReleaseStringChars, but in some VM environments the VM may be able to avoid making a copy.
private static int GetStringLength(JNIEnvironment env, int objJREF)
          GetStringLength: return the length of a String
private static void GetStringRegion(JNIEnvironment env, int strJREF, int start, int len, Address buf)
          GetStringRegion: Copy a region of Unicode characters from a string to the given buffer.
private static Address GetStringUTFChars(JNIEnvironment env, int strJREF, Address isCopyAddress)
          GetStringUTFChars: return address of buffer containing contents of a String
private static int GetStringUTFLength(JNIEnvironment env, int objJREF)
          GetStringUTFLength: return number of bytes to represent a String in UTF8 format
private static void GetStringUTFRegion(JNIEnvironment env, int strJREF, int start, int len, Address buf)
          GetStringUTFRegion: Copy a region of Unicode characters from a string to the given buffer, as UTF8 characters.
private static int GetSuperclass(JNIEnvironment env, int classJREF)
          GetSuperclass: find the superclass given a class
private static int GetVersion(JNIEnvironment env)
          GetVersion: the version of the JNI
private static boolean IsAssignableFrom(JNIEnvironment env, int firstClassJREF, int secondClassJREF)
          IsAssignableFrom: determine if an an object of class or interface cls1 can be cast to the class or interface cls2
private static int IsInstanceOf(JNIEnvironment env, int objJREF, int classJREF)
          IsInstanceOf: determine if an object is an instance of the class
private static boolean IsSameObject(JNIEnvironment env, int obj1JREF, int obj2JREF)
          IsSameObject: determine if two references point to the same object
private static int MonitorEnter(JNIEnvironment env, int objJREF)
          MonitorEnter
private static int MonitorExit(JNIEnvironment env, int objJREF)
          MonitorExit
private static int NewBooleanArray(JNIEnvironment env, int length)
          NewBooleanArray: create a new boolean array
private static int NewByteArray(JNIEnvironment env, int length)
          NewByteArray: create a new byte array
private static int NewCharArray(JNIEnvironment env, int length)
          NewCharArray: create a new char array
private static int NewDirectByteBuffer(JNIEnvironment env, Address address, long capacity)
          These functions are in JNI 1.4
private static int NewDoubleArray(JNIEnvironment env, int length)
          NewDoubleArray: create a new double array
private static int NewFloatArray(JNIEnvironment env, int length)
          NewFloatArray: create a new float array
private static int NewGlobalRef(JNIEnvironment env, int objectJREF)
           
private static int NewIntArray(JNIEnvironment env, int length)
          NewIntArray: create a new integer array
private static int NewLocalRef(JNIEnvironment env, int oldJREF)
          NewLocalRef
private static int NewLongArray(JNIEnvironment env, int length)
          NewLongArray: create a new long array
private static int NewObject(JNIEnvironment env, int classJREF, int methodID)
          NewObject: create a new object instance NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame
private static int NewObjectA(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          NewObjectA: create a new object instance
private static int NewObjectArray(JNIEnvironment env, int length, int classJREF, int initElementJREF)
          NewObjectArray: create a new Object array
private static int NewObjectV(JNIEnvironment env, int classJREF, int methodID, Address argAddress)
          NewObjectV: create a new object instance
private static int NewShortArray(JNIEnvironment env, int length)
          NewShortArray: create a new short array
private static int NewString(JNIEnvironment env, Address uchars, int len)
          NewString: create a String Object from C array of unicode chars
private static int NewStringUTF(JNIEnvironment env, Address utf8bytes)
          NewStringUTF: create a String Object from C array of utf8 bytes
private static int NewWeakGlobalRef(JNIEnvironment env, int objectJREF)
           
private static int PopLocalFrame(JNIEnvironment env, int resultJREF)
          Push a local frame for local references.
private static int PushLocalFrame(JNIEnvironment env, int capacity)
          Push a local frame for local references.
private static int RegisterNatives(JNIEnvironment env, int classJREF, Address methodsAddress, int nmethods)
          RegisterNatives: registers implementation of native methods
private static void ReleaseBooleanArrayElements(JNIEnvironment env, int arrayJREF, Address copyBufferAddress, int releaseMode)
          ReleaseBooleanArrayElements: free the native copy of the array, update changes to Java array as indicated
private static void ReleaseByteArrayElements(JNIEnvironment env, int arrayJREF, Address copyBufferAddress, int releaseMode)
          ReleaseByteArrayElements: free the native copy of the array, update changes to Java array as indicated
private static void ReleaseCharArrayElements(JNIEnvironment env, int arrayJREF, Address copyBufferAddress, int releaseMode)
          ReleaseCharArrayElements: free the native copy of the array, update changes to Java array as indicated
private static void ReleaseDoubleArrayElements(JNIEnvironment env, int arrayJREF, Address copyBufferAddress, int releaseMode)
          ReleaseDoubleArrayElements: free the native copy of the array, update changes to Java array as indicated
private static void ReleaseFloatArrayElements(JNIEnvironment env, int arrayJREF, Address copyBufferAddress, int releaseMode)
          ReleaseFloatArrayElements: free the native copy of the array, update changes to Java array as indicated
private static void ReleaseIntArrayElements(JNIEnvironment env, int arrayJREF, Address copyBufferAddress, int releaseMode)
          ReleaseIntArrayElements: free the native copy of the array, update changes to Java array as indicated
private static void ReleaseLongArrayElements(JNIEnvironment env, int arrayJREF, Address copyBufferAddress, int releaseMode)
          ReleaseLongArrayElements: free the native copy of the array, update changes to Java array as indicated
private static void ReleasePrimitiveArrayCritical(JNIEnvironment env, int arrayJREF, Address arrayCopyAddress, int mode)
          ReleasePrimitiveArrayCritical: this function is intended to be paired with the GetPrimitiveArrayCritical function.
private static void ReleaseShortArrayElements(JNIEnvironment env, int arrayJREF, Address copyBufferAddress, int releaseMode)
          ReleaseShortArrayElements: free the native copy of the array, update changes to Java array as indicated
private static void ReleaseStringChars(JNIEnvironment env, int objJREF, Address bufAddress)
          ReleaseStringChars: release buffer obtained via GetStringChars
private static void ReleaseStringCritical(JNIEnvironment env, int strJREF, Address carray)
          ReleaseStringCritical: this function is intended to be paired with the GetStringCritical function.
private static void ReleaseStringUTFChars(JNIEnvironment env, int objJREF, Address bufAddress)
          ReleaseStringUTFChars: release buffer obtained via GetStringUTFChars
private static int reserved0(JNIEnvironment env)
          Empty Slots
private static int reserved1(JNIEnvironment env)
           
private static int reserved2(JNIEnvironment env)
           
private static int reserved3(JNIEnvironment env)
           
private static void SetBooleanArrayRegion(JNIEnvironment env, int arrayJREF, int startIndex, int length, Address bufAddress)
          SetBooleanArrayRegion: copy a region of the native buffer into the array (1 byte element)
private static void SetBooleanField(JNIEnvironment env, int objJREF, int fieldID, boolean value)
          SetBooleanField: set an instance field of type boolean
private static void SetByteArrayRegion(JNIEnvironment env, int arrayJREF, int startIndex, int length, Address bufAddress)
          SetByteArrayRegion: copy a region of the native buffer into the array (1 byte element)
private static void SetByteField(JNIEnvironment env, int objJREF, int fieldID, byte value)
          SetByteField: set an instance field of type byte
private static void SetCharArrayRegion(JNIEnvironment env, int arrayJREF, int startIndex, int length, Address bufAddress)
          SetCharArrayRegion: copy a region of the native buffer into the array (2 byte element)
private static void SetCharField(JNIEnvironment env, int objJREF, int fieldID, char value)
          SetCharField: set an instance field of type char
private static void SetDoubleArrayRegion(JNIEnvironment env, int arrayJREF, int startIndex, int length, Address bufAddress)
          SetDoubleArrayRegion: copy a region of the native buffer into the array
private static void SetDoubleField(JNIEnvironment env, int objJREF, int fieldID, double value)
          SetDoubleField: set an instance field of type double
private static void SetFloatArrayRegion(JNIEnvironment env, int arrayJREF, int startIndex, int length, Address bufAddress)
          SetFloatArrayRegion: copy a region of the native buffer into the array
private static void SetFloatField(JNIEnvironment env, int objJREF, int fieldID, float value)
          SetFloatField: set an instance field of type float
private static void SetIntArrayRegion(JNIEnvironment env, int arrayJREF, int startIndex, int length, Address bufAddress)
          SetIntArrayRegion: copy a region of the native buffer into the array
private static void SetIntField(JNIEnvironment env, int objJREF, int fieldID, int value)
          SetIntField: set an instance field of type integer
private static void SetLongArrayRegion(JNIEnvironment env, int arrayJREF, int startIndex, int length, Address bufAddress)
          SetLongArrayRegion: copy a region of the native buffer into the array
private static void SetLongField(JNIEnvironment env, int objJREF, int fieldID, long value)
          SetLongField: set an instance field of type long
private static void SetObjectArrayElement(JNIEnvironment env, int arrayJREF, int index, int objectJREF)
          SetObjectArrayElement: store an object into an object array
private static void SetObjectField(JNIEnvironment env, int objJREF, int fieldID, int valueJREF)
          SetObjectField: set a instance field of type Object
private static void SetShortArrayRegion(JNIEnvironment env, int arrayJREF, int startIndex, int length, Address bufAddress)
          SetShortArrayRegion: copy a region of the native buffer into the array (2 byte element)
private static void SetShortField(JNIEnvironment env, int objJREF, int fieldID, short value)
          SetShortField: set an instance field of type short
private static void SetStaticBooleanField(JNIEnvironment env, int classJREF, int fieldID, boolean fieldValue)
          SetStaticBooleanField: set a static field of type boolean
private static void SetStaticByteField(JNIEnvironment env, int classJREF, int fieldID, byte fieldValue)
          SetStaticByteField: set a static field of type byte
private static void SetStaticCharField(JNIEnvironment env, int classJREF, int fieldID, char fieldValue)
          SetStaticCharField: set a static field of type char
private static void SetStaticDoubleField(JNIEnvironment env, int classJREF, int fieldID, double fieldValue)
          SetStaticDoubleField: set a static field of type float
private static void SetStaticFloatField(JNIEnvironment env, int classJREF, int fieldID, float fieldValue)
          SetStaticFloatField: set a static field of type float
private static void SetStaticIntField(JNIEnvironment env, int classJREF, int fieldID, int fieldValue)
          SetStaticIntField: set a static field of type integer
private static void SetStaticLongField(JNIEnvironment env, int classJREF, int fieldID, long fieldValue)
          SetStaticLongField: set a static field of type long
private static void SetStaticObjectField(JNIEnvironment env, int classJREF, int fieldID, int objectJREF)
          SetStaticObjectField: set a static field of type Object
private static void SetStaticShortField(JNIEnvironment env, int classJREF, int fieldID, short fieldValue)
          SetStaticShortField: set a static field of type short
private static int Throw(JNIEnvironment env, int exceptionJREF)
          Throw: register a Throwable object as a pending exception, to be delivered on return to the Java caller
private static int ThrowNew(JNIEnvironment env, int throwableClassJREF, Address exceptionNameAddress)
          ThrowNew
private static int ToReflectedField(JNIEnvironment env, int clsJREF, int fieldID, boolean isStatic)
          ToReflectedField
private static int ToReflectedMethod(JNIEnvironment env, int clsJREF, int methodID, boolean isStatic)
          ToReflectedMethod
private static int UnregisterNatives(JNIEnvironment env, int classJREF)
          UnregisterNatives: unregisters native methods
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

traceJNI

public static final boolean traceJNI

FUNCTIONCOUNT

public static final int FUNCTIONCOUNT
See Also:
Constant Field Values
Constructor Detail

JNIFunctions

public JNIFunctions()
Method Detail

GetVersion

private static int GetVersion(JNIEnvironment env)
GetVersion: the version of the JNI

Parameters:
env - A JREF index for the JNI environment object
Returns:
0x00010004 for JNI 1.4, 0x00010002 for JNI 1.2, 0x00010001 for JNI 1.1,

DefineClass

private static int DefineClass(JNIEnvironment env,
                               Address classNameAddress,
                               int classLoader,
                               Address data,
                               int dataLen)
DefineClass: Loads a class from a buffer of raw class data.

Parameters:
env - A JREF index for the JNI environment object
classNameAddress - a raw address to a null-terminated string in C for the class name
classLoader - a JREF index for the class loader assigned to the defined class
data - buffer containing the .class file
dataLen - buffer length
Returns:
a JREF index for the Java Class object, or 0 if not found
Throws:
ClassFormatError - if the class data does not specify a valid class
ClassCircularityError - (not implemented)
OutOfMemoryError - (not implemented)

FindClass

private static int FindClass(JNIEnvironment env,
                             Address classNameAddress)
FindClass: given a class name, find its RVMClass, or 0 if not found

Parameters:
env - A JREF index for the JNI environment object
classNameAddress - a raw address to a null-terminated string in C for the class name
Returns:
a JREF index for the Java Class object, or 0 if not found
Throws:
ClassFormatError - (not implemented)
ClassCircularityError - (not implemented)
NoClassDefFoundError - if the class cannot be found
OutOfMemoryError - (not implemented)
ExceptionInInitializerError - (not implemented)

GetSuperclass

private static int GetSuperclass(JNIEnvironment env,
                                 int classJREF)
GetSuperclass: find the superclass given a class

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
Returns:
a JREF index for the super class object, or 0 if the given class is java.lang.Object or an interface

IsAssignableFrom

private static boolean IsAssignableFrom(JNIEnvironment env,
                                        int firstClassJREF,
                                        int secondClassJREF)
IsAssignableFrom: determine if an an object of class or interface cls1 can be cast to the class or interface cls2

Parameters:
env - A JREF index for the JNI environment object
firstClassJREF - a JREF index for the first class object
secondClassJREF - a JREF index for the second class object
Returns:
true if cls1 can be assigned to cls2

Throw

private static int Throw(JNIEnvironment env,
                         int exceptionJREF)
Throw: register a Throwable object as a pending exception, to be delivered on return to the Java caller

Parameters:
env - A JREF index for the JNI environment object
exceptionJREF - A JREF index for the Throwable object to be thrown
Returns:
0 if successful, -1 if not

ThrowNew

private static int ThrowNew(JNIEnvironment env,
                            int throwableClassJREF,
                            Address exceptionNameAddress)
ThrowNew

Parameters:
env - A JREF index for the JNI environment object
throwableClassJREF - a JREF index for the class object of the exception
exceptionNameAddress - an address of the string in C
Returns:
0 if successful, -1 otherwise

ExceptionOccurred

private static int ExceptionOccurred(JNIEnvironment env)
ExceptionOccurred

Parameters:
env - A JREF index for the JNI environment object
Returns:
a JREF index for the pending exception or null if nothing pending

ExceptionDescribe

private static void ExceptionDescribe(JNIEnvironment env)
ExceptionDescribe: print the exception description and the stack trace back, then clear the exception

Parameters:
env - A JREF index for the JNI environment object

ExceptionClear

private static void ExceptionClear(JNIEnvironment env)
ExceptionClear

Parameters:
env - A JREF index for the JNI environment object

FatalError

private static void FatalError(JNIEnvironment env,
                               Address messageAddress)
FatalError: print a message and terminate the VM

Parameters:
env - A JREF index for the JNI environment object
messageAddress - an address of the string in C

NewGlobalRef

private static int NewGlobalRef(JNIEnvironment env,
                                int objectJREF)

DeleteGlobalRef

private static void DeleteGlobalRef(JNIEnvironment env,
                                    int refJREF)

DeleteLocalRef

private static void DeleteLocalRef(JNIEnvironment env,
                                   int objJREF)

IsSameObject

private static boolean IsSameObject(JNIEnvironment env,
                                    int obj1JREF,
                                    int obj2JREF)
IsSameObject: determine if two references point to the same object

Parameters:
env - A JREF index for the JNI environment object
obj1JREF - A JREF index for the first object
obj2JREF - A JREF index for the second object
Returns:
true if it's the same object, false otherwise

AllocObject

private static int AllocObject(JNIEnvironment env,
                               int classJREF)
                        throws InstantiationException,
                               OutOfMemoryError
AllocObject: allocate the space for an object without running any constructor the header is filled and the fields are initialized to null

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
Returns:
a JREF index for the uninitialized object
Throws:
InstantiationException - if the class is abstract or is an interface
OutOfMemoryError - if no more memory to allocate

NewObject

private static int NewObject(JNIEnvironment env,
                             int classJREF,
                             int methodID)
                      throws Exception
NewObject: create a new object instance NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
Returns:
the new object instance
Throws:
InstantiationException - if the class is abstract or is an interface
OutOfMemoryError - if no more memory to allocate
Exception

NewObjectV

private static int NewObjectV(JNIEnvironment env,
                              int classJREF,
                              int methodID,
                              Address argAddress)
                       throws Exception
NewObjectV: create a new object instance

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the constructor invocation
Returns:
the new object instance
Throws:
InstantiationException - if the class is abstract or is an interface
OutOfMemoryError - if no more memory to allocate
Exception

NewObjectA

private static int NewObjectA(JNIEnvironment env,
                              int classJREF,
                              int methodID,
                              Address argAddress)
                       throws Exception
NewObjectA: create a new object instance

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the constructor invocation
Returns:
the new object instance
Throws:
InstantiationException - if the class is abstract or is an interface
OutOfMemoryError - if no more memory to allocate
Exception

GetObjectClass

private static int GetObjectClass(JNIEnvironment env,
                                  int objJREF)
GetObjectClass

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object to check
Returns:
a JREF index for the Class object

IsInstanceOf

private static int IsInstanceOf(JNIEnvironment env,
                                int objJREF,
                                int classJREF)
IsInstanceOf: determine if an object is an instance of the class

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object to check
classJREF - a JREF index for the class to check
Returns:
true if the object is an instance of the class

GetMethodID

private static int GetMethodID(JNIEnvironment env,
                               int classJREF,
                               Address methodNameAddress,
                               Address methodSigAddress)
GetMethodID: get the virtual method ID given the name and the signature

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodNameAddress - a raw address to a null-terminated string in C for the method name
methodSigAddress - a raw address to a null-terminated string in C for the method signature
Returns:
id of a MethodReference
Throws:
NoSuchMethodError - if the method cannot be found
ExceptionInInitializerError - if the class or interface static initializer fails
OutOfMemoryError - if the system runs out of memory

CallObjectMethod

private static int CallObjectMethod(JNIEnvironment env,
                                    int objJREF,
                                    int methodID)
                             throws Exception
CallObjectMethod: invoke a virtual method that returns an object arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
Returns:
the JREF index for the object returned from the method invocation
Throws:
Exception

CallObjectMethodV

private static int CallObjectMethodV(JNIEnvironment env,
                                     int objJREF,
                                     int methodID,
                                     Address argAddress)
                              throws Exception
CallObjectMethodV: invoke a virtual method that returns an object

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the JREF index for the object returned from the method invocation
Throws:
Exception

CallObjectMethodA

private static int CallObjectMethodA(JNIEnvironment env,
                                     int objJREF,
                                     int methodID,
                                     Address argAddress)
                              throws Exception
CallObjectMethodA: invoke a virtual method that returns an object value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the JREF index for the object returned from the method invocation
Throws:
Exception

CallBooleanMethod

private static boolean CallBooleanMethod(JNIEnvironment env,
                                         int objJREF,
                                         int methodID)
                                  throws Exception
CallBooleanMethod: invoke a virtual method that returns a boolean value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
Returns:
the boolean value returned from the method invocation
Throws:
Exception

CallBooleanMethodV

private static boolean CallBooleanMethodV(JNIEnvironment env,
                                          int objJREF,
                                          int methodID,
                                          Address argAddress)
                                   throws Exception
CallBooleanMethodV: invoke a virtual method that returns a boolean value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the boolean value returned from the method invocation
Throws:
Exception

CallBooleanMethodA

private static boolean CallBooleanMethodA(JNIEnvironment env,
                                          int objJREF,
                                          int methodID,
                                          Address argAddress)
                                   throws Exception
CallBooleanMethodA: invoke a virtual method that returns a boolean value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the boolean value returned from the method invocation
Throws:
Exception

CallByteMethod

private static byte CallByteMethod(JNIEnvironment env,
                                   int objJREF,
                                   int methodID)
                            throws Exception
CallByteMethod: invoke a virtual method that returns a byte value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
Returns:
the byte value returned from the method invocation
Throws:
Exception

CallByteMethodV

private static byte CallByteMethodV(JNIEnvironment env,
                                    int objJREF,
                                    int methodID,
                                    Address argAddress)
                             throws Exception
CallByteMethodV: invoke a virtual method that returns a byte value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the byte value returned from the method invocation
Throws:
Exception

CallByteMethodA

private static byte CallByteMethodA(JNIEnvironment env,
                                    int objJREF,
                                    int methodID,
                                    Address argAddress)
                             throws Exception
CallByteMethodA: invoke a virtual method that returns a byte value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the byte value returned from the method invocation
Throws:
Exception

CallCharMethod

private static char CallCharMethod(JNIEnvironment env,
                                   int objJREF,
                                   int methodID)
                            throws Exception
CallCharMethod: invoke a virtual method that returns a char value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
Returns:
the char value returned from the method invocation
Throws:
Exception

CallCharMethodV

private static char CallCharMethodV(JNIEnvironment env,
                                    int objJREF,
                                    int methodID,
                                    Address argAddress)
                             throws Exception
CallCharMethodV: invoke a virtual method that returns a char value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the char value returned from the method invocation
Throws:
Exception

CallCharMethodA

private static char CallCharMethodA(JNIEnvironment env,
                                    int objJREF,
                                    int methodID,
                                    Address argAddress)
                             throws Exception
CallCharMethodA: invoke a virtual method that returns a char value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the char value returned from the method invocation
Throws:
Exception

CallShortMethod

private static short CallShortMethod(JNIEnvironment env,
                                     int objJREF,
                                     int methodID)
                              throws Exception
CallShortMethod: invoke a virtual method that returns a short value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
Returns:
the short value returned from the method invocation
Throws:
Exception

CallShortMethodV

private static short CallShortMethodV(JNIEnvironment env,
                                      int objJREF,
                                      int methodID,
                                      Address argAddress)
                               throws Exception
CallShortMethodV: invoke a virtual method that returns a short value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the short value returned from the method invocation
Throws:
Exception

CallShortMethodA

private static short CallShortMethodA(JNIEnvironment env,
                                      int objJREF,
                                      int methodID,
                                      Address argAddress)
                               throws Exception
CallShortMethodA: invoke a virtual method that returns a short value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the short value returned from the method invocation
Throws:
Exception

CallIntMethod

private static int CallIntMethod(JNIEnvironment env,
                                 int objJREF,
                                 int methodID)
                          throws Exception
CallIntMethod: invoke a virtual method that returns a int value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
Returns:
the int value returned from the method invocation
Throws:
Exception

CallIntMethodV

private static int CallIntMethodV(JNIEnvironment env,
                                  int objJREF,
                                  int methodID,
                                  Address argAddress)
                           throws Exception
CallIntMethodV: invoke a virtual method that returns an int value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the int value returned from the method invocation
Throws:
Exception

CallIntMethodA

private static int CallIntMethodA(JNIEnvironment env,
                                  int objJREF,
                                  int methodID,
                                  Address argAddress)
                           throws Exception
CallIntMethodA: invoke a virtual method that returns an integer value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the integer value returned from the method invocation
Throws:
Exception

CallLongMethod

private static long CallLongMethod(JNIEnvironment env,
                                   int objJREF,
                                   int methodID)
                            throws Exception
CallLongMethod: invoke a virtual method that returns a long value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
Returns:
the long value returned from the method invocation
Throws:
Exception

CallLongMethodV

private static long CallLongMethodV(JNIEnvironment env,
                                    int objJREF,
                                    int methodID,
                                    Address argAddress)
                             throws Exception
CallLongMethodV: invoke a virtual method that returns a long value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the long value returned from the method invocation
Throws:
Exception

CallLongMethodA

private static long CallLongMethodA(JNIEnvironment env,
                                    int objJREF,
                                    int methodID,
                                    Address argAddress)
                             throws Exception
CallLongMethodA: invoke a virtual method that returns a long value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the long value returned from the method invocation
Throws:
Exception

CallFloatMethod

private static float CallFloatMethod(JNIEnvironment env,
                                     int objJREF,
                                     int methodID)
                              throws Exception
CallFloatMethod: invoke a virtual method that returns a float value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
Returns:
the float value returned from the method invocation
Throws:
Exception

CallFloatMethodV

private static float CallFloatMethodV(JNIEnvironment env,
                                      int objJREF,
                                      int methodID,
                                      Address argAddress)
                               throws Exception
CallFloatMethodV: invoke a virtual method that returns a float value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the float value returned from the method invocation
Throws:
Exception

CallFloatMethodA

private static float CallFloatMethodA(JNIEnvironment env,
                                      int objJREF,
                                      int methodID,
                                      Address argAddress)
                               throws Exception
CallFloatMethodA: invoke a virtual method that returns a float value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the float value returned from the method invocation
Throws:
Exception

CallDoubleMethod

private static double CallDoubleMethod(JNIEnvironment env,
                                       int objJREF,
                                       int methodID)
                                throws Exception
CallDoubleMethod: invoke a virtual method that returns a double value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
Returns:
the double value returned from the method invocation
Throws:
Exception

CallDoubleMethodV

private static double CallDoubleMethodV(JNIEnvironment env,
                                        int objJREF,
                                        int methodID,
                                        Address argAddress)
                                 throws Exception
CallDoubleMethodV: invoke a virtual method that returns a double value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the double value returned from the method invocation
Throws:
Exception

CallDoubleMethodA

private static double CallDoubleMethodA(JNIEnvironment env,
                                        int objJREF,
                                        int methodID,
                                        Address argAddress)
                                 throws Exception
CallDoubleMethodA: invoke a virtual method that returns a double value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the double value returned from the method invocation
Throws:
Exception

CallVoidMethod

private static void CallVoidMethod(JNIEnvironment env,
                                   int objJREF,
                                   int methodID)
                            throws Exception
CallVoidMethod: invoke a virtual method that returns a void value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
Throws:
Exception

CallVoidMethodV

private static void CallVoidMethodV(JNIEnvironment env,
                                    int objJREF,
                                    int methodID,
                                    Address argAddress)
                             throws Exception
CallVoidMethodV: invoke a virtual method that returns void

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Throws:
Exception

CallVoidMethodA

private static void CallVoidMethodA(JNIEnvironment env,
                                    int objJREF,
                                    int methodID,
                                    Address argAddress)
                             throws Exception
CallVoidMethodA: invoke a virtual method that returns void

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Throws:
Exception

CallNonvirtualObjectMethod

private static int CallNonvirtualObjectMethod(JNIEnvironment env,
                                              int objJREF,
                                              int classJREF,
                                              int methodID)
                                       throws Exception
CallNonvirtualObjectMethod: invoke a virtual method that returns an object arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
Returns:
the JREF index for the object returned from the method invocation
Throws:
Exception

CallNonvirtualObjectMethodV

private static int CallNonvirtualObjectMethodV(JNIEnvironment env,
                                               int objJREF,
                                               int classJREF,
                                               int methodID,
                                               Address argAddress)
                                        throws Exception
CallNonvirtualObjectMethodV: invoke a virtual method that returns an object

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the JREF index for the object returned from the method invocation
Throws:
Exception

CallNonvirtualObjectMethodA

private static int CallNonvirtualObjectMethodA(JNIEnvironment env,
                                               int objJREF,
                                               int classJREF,
                                               int methodID,
                                               Address argAddress)
                                        throws Exception
CallNonvirtualNonvirtualObjectMethodA: invoke a virtual method that returns an object value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the JREF index for the object returned from the method invocation
Throws:
Exception

CallNonvirtualBooleanMethod

private static boolean CallNonvirtualBooleanMethod(JNIEnvironment env,
                                                   int objJREF,
                                                   int classJREF,
                                                   int methodID)
                                            throws Exception
CallNonvirtualBooleanMethod: invoke a virtual method that returns a boolean value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
Returns:
the boolean value returned from the method invocation
Throws:
Exception

CallNonvirtualBooleanMethodV

private static boolean CallNonvirtualBooleanMethodV(JNIEnvironment env,
                                                    int objJREF,
                                                    int classJREF,
                                                    int methodID,
                                                    Address argAddress)
                                             throws Exception
CallNonvirtualBooleanMethodV: invoke a virtual method that returns a boolean value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the boolean value returned from the method invocation
Throws:
Exception

CallNonvirtualBooleanMethodA

private static boolean CallNonvirtualBooleanMethodA(JNIEnvironment env,
                                                    int objJREF,
                                                    int classJREF,
                                                    int methodID,
                                                    Address argAddress)
                                             throws Exception
CallNonvirtualBooleanMethodA: invoke a virtual method that returns a boolean value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the boolean value returned from the method invocation
Throws:
Exception

CallNonvirtualByteMethod

private static byte CallNonvirtualByteMethod(JNIEnvironment env,
                                             int objJREF,
                                             int classJREF,
                                             int methodID)
                                      throws Exception
CallNonvirtualByteMethod: invoke a virtual method that returns a byte value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
Returns:
the byte value returned from the method invocation
Throws:
Exception

CallNonvirtualByteMethodV

private static byte CallNonvirtualByteMethodV(JNIEnvironment env,
                                              int objJREF,
                                              int classJREF,
                                              int methodID,
                                              Address argAddress)
                                       throws Exception
CallNonvirtualByteMethodV: invoke a virtual method that returns a byte value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
classJREF - a JREF index for the class object that declares this method
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the byte value returned from the method invocation
Throws:
Exception

CallNonvirtualByteMethodA

private static byte CallNonvirtualByteMethodA(JNIEnvironment env,
                                              int objJREF,
                                              int classJREF,
                                              int methodID,
                                              Address argAddress)
                                       throws Exception
CallNonvirtualByteMethodA: invoke a virtual method that returns a byte value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
methodID - id of a MethodReference
classJREF - a JREF index for the class object that declares this method
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the byte value returned from the method invocation
Throws:
Exception

CallNonvirtualCharMethod

private static char CallNonvirtualCharMethod(JNIEnvironment env,
                                             int objJREF,
                                             int classJREF,
                                             int methodID)
                                      throws Exception
CallNonvirtualCharMethod: invoke a virtual method that returns a char value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
Returns:
the char value returned from the method invocation
Throws:
Exception

CallNonvirtualCharMethodV

private static char CallNonvirtualCharMethodV(JNIEnvironment env,
                                              int objJREF,
                                              int classJREF,
                                              int methodID,
                                              Address argAddress)
                                       throws Exception
CallNonvirtualCharMethodV: invoke a virtual method that returns a char value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the char value returned from the method invocation
Throws:
Exception

CallNonvirtualCharMethodA

private static char CallNonvirtualCharMethodA(JNIEnvironment env,
                                              int objJREF,
                                              int classJREF,
                                              int methodID,
                                              Address argAddress)
                                       throws Exception
CallNonvirtualCharMethodA: invoke a virtual method that returns a char value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the char value returned from the method invocation
Throws:
Exception

CallNonvirtualShortMethod

private static short CallNonvirtualShortMethod(JNIEnvironment env,
                                               int objJREF,
                                               int classJREF,
                                               int methodID)
                                        throws Exception
CallNonvirtualShortMethod: invoke a virtual method that returns a short value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
Returns:
the short value returned from the method invocation
Throws:
Exception

CallNonvirtualShortMethodV

private static short CallNonvirtualShortMethodV(JNIEnvironment env,
                                                int objJREF,
                                                int classJREF,
                                                int methodID,
                                                Address argAddress)
                                         throws Exception
CallNonvirtualShortMethodV: invoke a virtual method that returns a short value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the short value returned from the method invocation
Throws:
Exception

CallNonvirtualShortMethodA

private static short CallNonvirtualShortMethodA(JNIEnvironment env,
                                                int objJREF,
                                                int classJREF,
                                                int methodID,
                                                Address argAddress)
                                         throws Exception
CallNonvirtualShortMethodA: invoke a virtual method that returns a short value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the short value returned from the method invocation
Throws:
Exception

CallNonvirtualIntMethod

private static int CallNonvirtualIntMethod(JNIEnvironment env,
                                           int objJREF,
                                           int classJREF,
                                           int methodID)
                                    throws Exception
CallNonvirtualIntMethod: invoke a virtual method that returns a int value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
Returns:
the int value returned from the method invocation
Throws:
Exception

CallNonvirtualIntMethodV

private static int CallNonvirtualIntMethodV(JNIEnvironment env,
                                            int objJREF,
                                            int classJREF,
                                            int methodID,
                                            Address argAddress)
                                     throws Exception
CallNonvirtualIntMethodV: invoke a virtual method that returns an int value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the int value returned from the method invocation
Throws:
Exception

CallNonvirtualIntMethodA

private static int CallNonvirtualIntMethodA(JNIEnvironment env,
                                            int objJREF,
                                            int classJREF,
                                            int methodID,
                                            Address argAddress)
                                     throws Exception
CallNonvirtualIntMethodA: invoke a virtual method that returns an integer value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the integer value returned from the method invocation
Throws:
Exception

CallNonvirtualLongMethod

private static long CallNonvirtualLongMethod(JNIEnvironment env,
                                             int objJREF,
                                             int classJREF,
                                             int methodID)
                                      throws Exception
CallNonvirtualLongMethod: invoke a virtual method that returns a long value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
Returns:
the long value returned from the method invocation
Throws:
Exception

CallNonvirtualLongMethodV

private static long CallNonvirtualLongMethodV(JNIEnvironment env,
                                              int objJREF,
                                              int classJREF,
                                              int methodID,
                                              Address argAddress)
                                       throws Exception
CallNonvirtualLongMethodV: invoke a virtual method that returns a long value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the long value returned from the method invocation
Throws:
Exception

CallNonvirtualLongMethodA

private static long CallNonvirtualLongMethodA(JNIEnvironment env,
                                              int objJREF,
                                              int classJREF,
                                              int methodID,
                                              Address argAddress)
                                       throws Exception
CallNonvirtualLongMethodA: invoke a virtual method that returns a long value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the long value returned from the method invocation
Throws:
Exception

CallNonvirtualFloatMethod

private static float CallNonvirtualFloatMethod(JNIEnvironment env,
                                               int objJREF,
                                               int classJREF,
                                               int methodID)
                                        throws Exception
CallNonvirtualFloatMethod: invoke a virtual method that returns a float value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
Returns:
the float value returned from the method invocation
Throws:
Exception

CallNonvirtualFloatMethodV

private static float CallNonvirtualFloatMethodV(JNIEnvironment env,
                                                int objJREF,
                                                int classJREF,
                                                int methodID,
                                                Address argAddress)
                                         throws Exception
CallNonvirtualFloatMethodV: invoke a virtual method that returns a float value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the float value returned from the method invocation
Throws:
Exception

CallNonvirtualFloatMethodA

private static float CallNonvirtualFloatMethodA(JNIEnvironment env,
                                                int objJREF,
                                                int classJREF,
                                                int methodID,
                                                Address argAddress)
                                         throws Exception
CallNonvirtualFloatMethodA: invoke a virtual method that returns a float value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the float value returned from the method invocation
Throws:
Exception

CallNonvirtualDoubleMethod

private static double CallNonvirtualDoubleMethod(JNIEnvironment env,
                                                 int objJREF,
                                                 int classJREF,
                                                 int methodID)
                                          throws Exception
CallNonvirtualDoubleMethod: invoke a virtual method that returns a double value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
Returns:
the double value returned from the method invocation
Throws:
Exception

CallNonvirtualDoubleMethodV

private static double CallNonvirtualDoubleMethodV(JNIEnvironment env,
                                                  int objJREF,
                                                  int classJREF,
                                                  int methodID,
                                                  Address argAddress)
                                           throws Exception
CallNonvirtualDoubleMethodV: invoke a virtual method that returns a double value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the double value returned from the method invocation
Throws:
Exception

CallNonvirtualDoubleMethodA

private static double CallNonvirtualDoubleMethodA(JNIEnvironment env,
                                                  int objJREF,
                                                  int classJREF,
                                                  int methodID,
                                                  Address argAddress)
                                           throws Exception
CallNonvirtualDoubleMethodA: invoke a virtual method that returns a double value

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the double value returned from the method invocation
Throws:
Exception

CallNonvirtualVoidMethod

private static void CallNonvirtualVoidMethod(JNIEnvironment env,
                                             int objJREF,
                                             int classJREF,
                                             int methodID)
                                      throws Exception
CallNonvirtualVoidMethod: invoke a virtual method that returns a void value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
Throws:
Exception

CallNonvirtualVoidMethodV

private static void CallNonvirtualVoidMethodV(JNIEnvironment env,
                                              int objJREF,
                                              int classJREF,
                                              int methodID,
                                              Address argAddress)
                                       throws Exception
CallNonvirtualVoidMethodV: invoke a virtual method that returns void

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Throws:
Exception

CallNonvirtualVoidMethodA

private static void CallNonvirtualVoidMethodA(JNIEnvironment env,
                                              int objJREF,
                                              int classJREF,
                                              int methodID,
                                              Address argAddress)
                                       throws Exception
CallNonvirtualVoidMethodA: invoke a virtual method that returns void

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object instance
classJREF - a JREF index for the class object that declares this method
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Throws:
Exception

GetFieldID

private static int GetFieldID(JNIEnvironment env,
                              int classJREF,
                              Address fieldNameAddress,
                              Address descriptorAddress)
GetFieldID: return a field id, which can be cached in native code and reused

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldNameAddress - a raw address to a null-terminated string in C for the field name
descriptorAddress - a raw address to a null-terminated string in C for the descriptor
Returns:
the fieldID of an instance field given the class, field name and type. Return 0 if the field is not found
Throws:
NoSuchFieldError - if the specified field cannot be found
ExceptionInInitializerError - if the class initializer fails
OutOfMemoryError - if the system runs out of memory

GetObjectField

private static int GetObjectField(JNIEnvironment env,
                                  int objJREF,
                                  int fieldID)
GetObjectField: read a instance field of type Object

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the Object field, converted to a JREF index or 0 if the fieldID is incorrect

GetBooleanField

private static int GetBooleanField(JNIEnvironment env,
                                   int objJREF,
                                   int fieldID)
GetBooleanField: read an instance field of type boolean

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the boolean field, or 0 if the fieldID is incorrect

GetByteField

private static int GetByteField(JNIEnvironment env,
                                int objJREF,
                                int fieldID)
GetByteField: read an instance field of type byte

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the byte field, or 0 if the fieldID is incorrect

GetCharField

private static int GetCharField(JNIEnvironment env,
                                int objJREF,
                                int fieldID)
GetCharField: read an instance field of type character

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the character field, or 0 if the fieldID is incorrect

GetShortField

private static int GetShortField(JNIEnvironment env,
                                 int objJREF,
                                 int fieldID)
GetShortField: read an instance field of type short

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the short field, or 0 if the fieldID is incorrect

GetIntField

private static int GetIntField(JNIEnvironment env,
                               int objJREF,
                               int fieldID)
GetIntField: read an instance field of type integer

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the integer field, or 0 if the fieldID is incorrect

GetLongField

private static long GetLongField(JNIEnvironment env,
                                 int objJREF,
                                 int fieldID)
GetLongField: read an instance field of type long

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the long field or 0 if the fieldID is incorrect

GetFloatField

private static float GetFloatField(JNIEnvironment env,
                                   int objJREF,
                                   int fieldID)
GetFloatField: read an instance field of type float

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the float field or 0 if the fieldID is incorrect

GetDoubleField

private static double GetDoubleField(JNIEnvironment env,
                                     int objJREF,
                                     int fieldID)
GetDoubleField: read an instance field of type double

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the double field or 0 if the fieldID is incorrect

SetObjectField

private static void SetObjectField(JNIEnvironment env,
                                   int objJREF,
                                   int fieldID,
                                   int valueJREF)
SetObjectField: set a instance field of type Object

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
valueJREF - a JREF index for the value to assign

SetBooleanField

private static void SetBooleanField(JNIEnvironment env,
                                    int objJREF,
                                    int fieldID,
                                    boolean value)
SetBooleanField: set an instance field of type boolean

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
value - boolean value to assign

SetByteField

private static void SetByteField(JNIEnvironment env,
                                 int objJREF,
                                 int fieldID,
                                 byte value)
SetByteField: set an instance field of type byte

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
value - byte value to assign

SetCharField

private static void SetCharField(JNIEnvironment env,
                                 int objJREF,
                                 int fieldID,
                                 char value)
SetCharField: set an instance field of type char

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
value - char value to assign

SetShortField

private static void SetShortField(JNIEnvironment env,
                                  int objJREF,
                                  int fieldID,
                                  short value)
SetShortField: set an instance field of type short

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
value - short value to assign

SetIntField

private static void SetIntField(JNIEnvironment env,
                                int objJREF,
                                int fieldID,
                                int value)
SetIntField: set an instance field of type integer

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
value - integer value to assign

SetLongField

private static void SetLongField(JNIEnvironment env,
                                 int objJREF,
                                 int fieldID,
                                 long value)
SetLongField: set an instance field of type long

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
value - long value to assign

SetFloatField

private static void SetFloatField(JNIEnvironment env,
                                  int objJREF,
                                  int fieldID,
                                  float value)
SetFloatField: set an instance field of type float

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
value - float value to assign

SetDoubleField

private static void SetDoubleField(JNIEnvironment env,
                                   int objJREF,
                                   int fieldID,
                                   double value)
SetDoubleField: set an instance field of type double

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the target object
fieldID - the id for the RVMField that describes this field
value - double value to assign

GetStaticMethodID

private static int GetStaticMethodID(JNIEnvironment env,
                                     int classJREF,
                                     Address methodNameAddress,
                                     Address methodSigAddress)
GetStaticMethodID: return the method ID for invocation later

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodNameAddress - a raw address to a null-terminated string in C for the method name
methodSigAddress - a raw address to a null-terminated string in C for
Returns:
a method ID or null if it fails
Throws:
NoSuchMethodError - if the method is not found
ExceptionInInitializerError - if the initializer fails
OutOfMemoryError - if the system runs out of memory

CallStaticObjectMethod

private static int CallStaticObjectMethod(JNIEnvironment env,
                                          int classJREF,
                                          int methodID)
                                   throws Exception
CallStaticObjectMethod: invoke a static method that returns an object value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
Returns:
the JREF index for the object returned from the method invocation
Throws:
Exception

CallStaticObjectMethodV

private static int CallStaticObjectMethodV(JNIEnvironment env,
                                           int classJREF,
                                           int methodID,
                                           Address argAddress)
                                    throws Exception
CallStaticObjectMethodV: invoke a static method that returns an object

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the JREF index for the object returned from the method invocation
Throws:
Exception

CallStaticObjectMethodA

private static int CallStaticObjectMethodA(JNIEnvironment env,
                                           int classJREF,
                                           int methodID,
                                           Address argAddress)
                                    throws Exception
CallStaticObjectMethodA: invoke a static method that returns an object

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the JREF index for the object returned from the method invocation
Throws:
Exception

CallStaticBooleanMethod

private static boolean CallStaticBooleanMethod(JNIEnvironment env,
                                               int classJREF,
                                               int methodID)
                                        throws Exception
CallStaticBooleanMethod: invoke a static method that returns a boolean value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
Returns:
the boolean value returned from the method invocation
Throws:
Exception

CallStaticBooleanMethodV

private static boolean CallStaticBooleanMethodV(JNIEnvironment env,
                                                int classJREF,
                                                int methodID,
                                                Address argAddress)
                                         throws Exception
CallStaticBooleanMethodV: invoke a static method that returns a boolean value

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the boolean value returned from the method invocation
Throws:
Exception

CallStaticBooleanMethodA

private static boolean CallStaticBooleanMethodA(JNIEnvironment env,
                                                int classJREF,
                                                int methodID,
                                                Address argAddress)
                                         throws Exception
CallStaticBooleanMethodA: invoke a static method that returns a boolean value

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the boolean value returned from the method invocation
Throws:
Exception

CallStaticByteMethod

private static byte CallStaticByteMethod(JNIEnvironment env,
                                         int classJREF,
                                         int methodID)
                                  throws Exception
CallStaticByteMethod: invoke a static method that returns a byte value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
Returns:
the byte value returned from the method invocation
Throws:
Exception

CallStaticByteMethodV

private static byte CallStaticByteMethodV(JNIEnvironment env,
                                          int classJREF,
                                          int methodID,
                                          Address argAddress)
                                   throws Exception
CallStaticByteMethodV: invoke a static method that returns a byte value

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the byte value returned from the method invocation
Throws:
Exception

CallStaticByteMethodA

private static byte CallStaticByteMethodA(JNIEnvironment env,
                                          int classJREF,
                                          int methodID,
                                          Address argAddress)
                                   throws Exception
CallStaticByteMethodA: invoke a static method that returns a byte value

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the byte value returned from the method invocation
Throws:
Exception

CallStaticCharMethod

private static char CallStaticCharMethod(JNIEnvironment env,
                                         int classJREF,
                                         int methodID)
                                  throws Exception
CallStaticCharMethod: invoke a static method that returns a char value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
Returns:
the char value returned from the method invocation
Throws:
Exception

CallStaticCharMethodV

private static char CallStaticCharMethodV(JNIEnvironment env,
                                          int classJREF,
                                          int methodID,
                                          Address argAddress)
                                   throws Exception
CallStaticCharMethodV: invoke a static method that returns a char value

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the char value returned from the method invocation
Throws:
Exception

CallStaticCharMethodA

private static char CallStaticCharMethodA(JNIEnvironment env,
                                          int classJREF,
                                          int methodID,
                                          Address argAddress)
                                   throws Exception
CallStaticCharMethodA: invoke a static method that returns a char value

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the char value returned from the method invocation
Throws:
Exception

CallStaticShortMethod

private static short CallStaticShortMethod(JNIEnvironment env,
                                           int classJREF,
                                           int methodID)
                                    throws Exception
CallStaticShortMethod: invoke a static method that returns a short value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
Returns:
the short value returned from the method invocation
Throws:
Exception

CallStaticShortMethodV

private static short CallStaticShortMethodV(JNIEnvironment env,
                                            int classJREF,
                                            int methodID,
                                            Address argAddress)
                                     throws Exception
CallStaticShortMethodV: invoke a static method that returns a short value

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the short value returned from the method invocation
Throws:
Exception

CallStaticShortMethodA

private static short CallStaticShortMethodA(JNIEnvironment env,
                                            int classJREF,
                                            int methodID,
                                            Address argAddress)
                                     throws Exception
CallStaticShortMethodA: invoke a static method that returns a short value

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the short value returned from the method invocation
Throws:
Exception

CallStaticIntMethod

private static int CallStaticIntMethod(JNIEnvironment env,
                                       int classJREF,
                                       int methodID)
                                throws Exception
CallStaticIntMethod: invoke a static method that returns an integer value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
Returns:
the integer value returned from the method invocation
Throws:
Exception

CallStaticIntMethodV

private static int CallStaticIntMethodV(JNIEnvironment env,
                                        int classJREF,
                                        int methodID,
                                        Address argAddress)
                                 throws Exception
CallStaticIntMethodV: invoke a static method that returns an integer value

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the integer value returned from the method invocation
Throws:
Exception

CallStaticIntMethodA

private static int CallStaticIntMethodA(JNIEnvironment env,
                                        int classJREF,
                                        int methodID,
                                        Address argAddress)
                                 throws Exception
CallStaticIntMethodA: invoke a static method that returns an integer value

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the integer value returned from the method invocation
Throws:
Exception

CallStaticLongMethod

private static long CallStaticLongMethod(JNIEnvironment env,
                                         int classJREF,
                                         int methodID)
                                  throws Exception
CallStaticLongMethod: invoke a static method that returns a long value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
Returns:
the long value returned from the method invocation
Throws:
Exception

CallStaticLongMethodV

private static long CallStaticLongMethodV(JNIEnvironment env,
                                          int classJREF,
                                          int methodID,
                                          Address argAddress)
                                   throws Exception
CallStaticLongMethodV: invoke a static method that returns a long value

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the long value returned from the method invocation
Throws:
Exception

CallStaticLongMethodA

private static long CallStaticLongMethodA(JNIEnvironment env,
                                          int classJREF,
                                          int methodID,
                                          Address argAddress)
                                   throws Exception
CallStaticLongMethodA: invoke a static method that returns a long value

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the long value returned from the method invocation
Throws:
Exception

CallStaticFloatMethod

private static float CallStaticFloatMethod(JNIEnvironment env,
                                           int classJREF,
                                           int methodID)
                                    throws Exception
CallStaticFloagMethod: invoke a static method that returns a float value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
Returns:
the float value returned from the method invocation
Throws:
Exception

CallStaticFloatMethodV

private static float CallStaticFloatMethodV(JNIEnvironment env,
                                            int classJREF,
                                            int methodID,
                                            Address argAddress)
                                     throws Exception
CallStaticFloatMethodV: invoke a static method that returns a float value

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the float value returned from the method invocation
Throws:
Exception

CallStaticFloatMethodA

private static float CallStaticFloatMethodA(JNIEnvironment env,
                                            int classJREF,
                                            int methodID,
                                            Address argAddress)
                                     throws Exception
CallStaticFloatMethodA: invoke a static method that returns a float value

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the float value returned from the method invocation
Throws:
Exception

CallStaticDoubleMethod

private static double CallStaticDoubleMethod(JNIEnvironment env,
                                             int classJREF,
                                             int methodID)
                                      throws Exception
CallStaticDoubleMethod: invoke a static method that returns a double value arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - an id of a MethodReference
Returns:
the double value returned from the method invocation
Throws:
Exception

CallStaticDoubleMethodV

private static double CallStaticDoubleMethodV(JNIEnvironment env,
                                              int classJREF,
                                              int methodID,
                                              Address argAddress)
                                       throws Exception
CallStaticDoubleMethodV: invoke a static method that returns a double value

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - an id of a MethodReference
argAddress - a raw address to a variable argument list, each element is 1-word or 2-words of the appropriate type for the method invocation
Returns:
the double value returned from the method invocation
Throws:
Exception

CallStaticDoubleMethodA

private static double CallStaticDoubleMethodA(JNIEnvironment env,
                                              int classJREF,
                                              int methodID,
                                              Address argAddress)
                                       throws Exception
CallStaticDoubleMethodA: invoke a static method that returns a double value

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Returns:
the double value returned from the method invocation
Throws:
Exception

CallStaticVoidMethod

private static void CallStaticVoidMethod(JNIEnvironment env,
                                         int classJREF,
                                         int methodID)
                                  throws Exception
CallStaticVoidMethod: invoke a static method that returns void arguments passed using the vararg ... style NOTE: the vararg's are not visible in the method signature here; they are saved in the caller frame and the glue frame

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
Throws:
Exception

CallStaticVoidMethodV

private static void CallStaticVoidMethodV(JNIEnvironment env,
                                          int classJREF,
                                          int methodID,
                                          Address argAddress)
                                   throws Exception
CallStaticVoidMethodA: invoke a static method that returns void

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Throws:
Exception

CallStaticVoidMethodA

private static void CallStaticVoidMethodA(JNIEnvironment env,
                                          int classJREF,
                                          int methodID,
                                          Address argAddress)
                                   throws Exception
CallStaticVoidMethodA: invoke a static method that returns void

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class object
methodID - id of a MethodReference
argAddress - a raw address to an array of unions in C, each element is 2-word and hold an argument of the appropriate type for the method invocation
Throws:
Exception

GetStaticFieldID

private static int GetStaticFieldID(JNIEnvironment env,
                                    int classJREF,
                                    Address fieldNameAddress,
                                    Address descriptorAddress)
GetStaticFieldID: return a field id which can be cached in native code and reused

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldNameAddress - a raw address to a null-terminated string in C for the field name
descriptorAddress - a raw address to a null-terminated string in C for the descriptor
Returns:
the offset of a static field given the class, field name and type. Return 0 if the field is not found
Throws:
NoSuchFieldError - if the specified field cannot be found
ExceptionInInitializerError - if the class initializer fails
OutOfMemoryError - if the system runs out of memory

GetStaticObjectField

private static int GetStaticObjectField(JNIEnvironment env,
                                        int classJREF,
                                        int fieldID)
GetStaticObjectField: read a static field of type Object

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the Object field, converted to a JREF index or 0 if the fieldID is incorrect

GetStaticBooleanField

private static int GetStaticBooleanField(JNIEnvironment env,
                                         int classJREF,
                                         int fieldID)
GetStaticBooleanField: read a static field of type boolean

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the boolean field, or 0 if the fieldID is incorrect

GetStaticByteField

private static int GetStaticByteField(JNIEnvironment env,
                                      int classJREF,
                                      int fieldID)
GetStaticByteField: read a static field of type byte

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the byte field, or 0 if the fieldID is incorrect

GetStaticCharField

private static int GetStaticCharField(JNIEnvironment env,
                                      int classJREF,
                                      int fieldID)
GetStaticCharField: read a static field of type character

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the character field, or 0 if the fieldID is incorrect

GetStaticShortField

private static int GetStaticShortField(JNIEnvironment env,
                                       int classJREF,
                                       int fieldID)
GetStaticShortField: read a static field of type short

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the short field, or 0 if the fieldID is incorrect

GetStaticIntField

private static int GetStaticIntField(JNIEnvironment env,
                                     int classJREF,
                                     int fieldID)
GetStaticIntField: read a static field of type integer

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the integer field, or 0 if the fieldID is incorrect

GetStaticLongField

private static long GetStaticLongField(JNIEnvironment env,
                                       int classJREF,
                                       int fieldID)
GetStaticLongField: read a static field of type long

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the long field or 0 if the fieldID is incorrect

GetStaticFloatField

private static float GetStaticFloatField(JNIEnvironment env,
                                         int classJREF,
                                         int fieldID)
GetStaticFloatField: read a static field of type float

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the float field or 0 if the fieldID is incorrect

GetStaticDoubleField

private static double GetStaticDoubleField(JNIEnvironment env,
                                           int classJREF,
                                           int fieldID)
GetStaticDoubleField: read a static field of type double

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldID - the id for the RVMField that describes this field
Returns:
the value of the double field or 0 if the fieldID is incorrect

SetStaticObjectField

private static void SetStaticObjectField(JNIEnvironment env,
                                         int classJREF,
                                         int fieldID,
                                         int objectJREF)
SetStaticObjectField: set a static field of type Object

Parameters:
env - A JREF index for the JNI environment object
classJREF - A JREF index for the RVMClass object
fieldID - The id for the RVMField that describes this field
objectJREF - A JREF index of the value to assign

SetStaticBooleanField

private static void SetStaticBooleanField(JNIEnvironment env,
                                          int classJREF,
                                          int fieldID,
                                          boolean fieldValue)
SetStaticBooleanField: set a static field of type boolean

Parameters:
env - A JREF index for the JNI environment object
classJREF - A JREF index for the RVMClass object
fieldID - the id for the RVMField that describes this field
fieldValue - The value to assign

SetStaticByteField

private static void SetStaticByteField(JNIEnvironment env,
                                       int classJREF,
                                       int fieldID,
                                       byte fieldValue)
SetStaticByteField: set a static field of type byte

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldID - the id for the RVMField that describes this field
fieldValue - the value to assign

SetStaticCharField

private static void SetStaticCharField(JNIEnvironment env,
                                       int classJREF,
                                       int fieldID,
                                       char fieldValue)
SetStaticCharField: set a static field of type char

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldID - the id for the RVMField that describes this field
fieldValue - The value to assign

SetStaticShortField

private static void SetStaticShortField(JNIEnvironment env,
                                        int classJREF,
                                        int fieldID,
                                        short fieldValue)
SetStaticShortField: set a static field of type short

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldID - the id for the RVMField that describes this field
fieldValue - The value to assign

SetStaticIntField

private static void SetStaticIntField(JNIEnvironment env,
                                      int classJREF,
                                      int fieldID,
                                      int fieldValue)
SetStaticIntField: set a static field of type integer

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldID - the id for the RVMField that describes this field
fieldValue - The value to assign

SetStaticLongField

private static void SetStaticLongField(JNIEnvironment env,
                                       int classJREF,
                                       int fieldID,
                                       long fieldValue)
SetStaticLongField: set a static field of type long

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldID - the id for the RVMField that describes this field
fieldValue - The value to assign

SetStaticFloatField

private static void SetStaticFloatField(JNIEnvironment env,
                                        int classJREF,
                                        int fieldID,
                                        float fieldValue)
SetStaticFloatField: set a static field of type float

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldID - the id for the RVMField that describes this field
fieldValue - The value to assign

SetStaticDoubleField

private static void SetStaticDoubleField(JNIEnvironment env,
                                         int classJREF,
                                         int fieldID,
                                         double fieldValue)
SetStaticDoubleField: set a static field of type float

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the RVMClass object
fieldID - the id for the RVMField that describes this field
fieldValue - The value to assign

NewString

private static int NewString(JNIEnvironment env,
                             Address uchars,
                             int len)
NewString: create a String Object from C array of unicode chars

Parameters:
env - A JREF index for the JNI environment object
uchars - address of C array of 16 bit unicode characters
len - the number of chars in the C array
Returns:
the allocated String Object, converted to a JREF index or 0 if an OutOfMemoryError Exception has been thrown
Throws:
OutOfMemoryError

GetStringLength

private static int GetStringLength(JNIEnvironment env,
                                   int objJREF)
GetStringLength: return the length of a String

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the String object
Returns:
the length of the String

GetStringChars

private static Address GetStringChars(JNIEnvironment env,
                                      int strJREF,
                                      Address isCopyAddress)
GetStringChars: return address of buffer containing contents of a String

Parameters:
env - A JREF index for the JNI environment object
strJREF - a JREF index for the String object
isCopyAddress - address of isCopy jboolean (an int)
Returns:
address of a copy of the String unicode characters and *isCopy is set to 1 (TRUE)
Throws:
OutOfMemoryError - if the system runs out of memory

ReleaseStringChars

private static void ReleaseStringChars(JNIEnvironment env,
                                       int objJREF,
                                       Address bufAddress)
ReleaseStringChars: release buffer obtained via GetStringChars

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the String object
bufAddress - address of buffer to release

NewStringUTF

private static int NewStringUTF(JNIEnvironment env,
                                Address utf8bytes)
NewStringUTF: create a String Object from C array of utf8 bytes

Parameters:
env - A JREF index for the JNI environment object
utf8bytes - address of C array of 8 bit utf8 bytes
Returns:
the allocated String Object, converted to a JREF index or 0 if an OutOfMemoryError Exception has been thrown
Throws:
OutOfMemoryError - if the system runs out of memory

GetStringUTFLength

private static int GetStringUTFLength(JNIEnvironment env,
                                      int objJREF)
GetStringUTFLength: return number of bytes to represent a String in UTF8 format

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the String object
Returns:
number of bytes to represent in UTF8 format

GetStringUTFChars

private static Address GetStringUTFChars(JNIEnvironment env,
                                         int strJREF,
                                         Address isCopyAddress)
GetStringUTFChars: return address of buffer containing contents of a String

Parameters:
env - A JREF index for the JNI environment object
strJREF - a JREF index for the String object
isCopyAddress - address of isCopy jboolean (an int)
Returns:
address of a copy of the String unicode characters and *isCopy is set to 1 (TRUE)
Throws:
OutOfMemoryError - if the system runs out of memory

ReleaseStringUTFChars

private static void ReleaseStringUTFChars(JNIEnvironment env,
                                          int objJREF,
                                          Address bufAddress)
ReleaseStringUTFChars: release buffer obtained via GetStringUTFChars

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the String object
bufAddress - address of buffer to release

GetArrayLength

private static int GetArrayLength(JNIEnvironment env,
                                  int arrayJREF)
GetArrayLength: return array length

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
Returns:
the array length, or -1 if it's not an array

NewObjectArray

private static int NewObjectArray(JNIEnvironment env,
                                  int length,
                                  int classJREF,
                                  int initElementJREF)
NewObjectArray: create a new Object array

Parameters:
env - A JREF index for the JNI environment object
length - the size of the new array
classJREF - a JREF index for the class of the element
initElementJREF - a JREF index for the value to initialize the array elements
Returns:
the new Object array initialized
Throws:
OutOfMemoryError - if the system runs out of memory

GetObjectArrayElement

private static int GetObjectArrayElement(JNIEnvironment env,
                                         int arrayJREF,
                                         int index)
GetObjectArrayElement: retrieve an object from an object array

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
index - the index for the targeted element
Returns:
the object at the specified index
Throws:
ArrayIndexOutOfBoundsException - if the index is out of range

SetObjectArrayElement

private static void SetObjectArrayElement(JNIEnvironment env,
                                          int arrayJREF,
                                          int index,
                                          int objectJREF)
SetObjectArrayElement: store an object into an object array

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
index - the index for the targeted element
objectJREF - a JREF index for the object to store into the array
Throws:
ArrayStoreException - if the element types do not match ArrayIndexOutOfBoundsException if the index is out of range

NewBooleanArray

private static int NewBooleanArray(JNIEnvironment env,
                                   int length)
NewBooleanArray: create a new boolean array

Parameters:
env - A JREF index for the JNI environment object
length - the size of the new array
Returns:
the new boolean array
Throws:
OutOfMemoryError - if the system runs out of memory

NewByteArray

private static int NewByteArray(JNIEnvironment env,
                                int length)
NewByteArray: create a new byte array

Parameters:
env - A JREF index for the JNI environment object
length - the size of the new array
Returns:
the new byte array
Throws:
OutOfMemoryError - if the system runs out of memory

NewCharArray

private static int NewCharArray(JNIEnvironment env,
                                int length)
NewCharArray: create a new char array

Parameters:
env - A JREF index for the JNI environment object
length - the size of the new array
Returns:
the new char array
Throws:
OutOfMemoryError - if the system runs out of memory

NewShortArray

private static int NewShortArray(JNIEnvironment env,
                                 int length)
NewShortArray: create a new short array

Parameters:
env - A JREF index for the JNI environment object
length - the size of the new array
Returns:
the new short array
Throws:
OutOfMemoryError - if the system runs out of memory

NewIntArray

private static int NewIntArray(JNIEnvironment env,
                               int length)
NewIntArray: create a new integer array

Parameters:
env - A JREF index for the JNI environment object
length - the size of the new array
Returns:
the new integer array
Throws:
OutOfMemoryError - if the system runs out of memory

NewLongArray

private static int NewLongArray(JNIEnvironment env,
                                int length)
NewLongArray: create a new long array

Parameters:
env - A JREF index for the JNI environment object
length - the size of the new array
Returns:
the new long array
Throws:
OutOfMemoryError - if the system runs out of memory

NewFloatArray

private static int NewFloatArray(JNIEnvironment env,
                                 int length)
NewFloatArray: create a new float array

Parameters:
env - A JREF index for the JNI environment object
length - the size of the new array
Returns:
the new float array
Throws:
OutOfMemoryError - if the system runs out of memory

NewDoubleArray

private static int NewDoubleArray(JNIEnvironment env,
                                  int length)
NewDoubleArray: create a new double array

Parameters:
env - A JREF index for the JNI environment object
length - the size of the new array
Returns:
the new long array
Throws:
OutOfMemoryError - if the system runs out of memory

GetBooleanArrayElements

private static Address GetBooleanArrayElements(JNIEnvironment env,
                                               int arrayJREF,
                                               Address isCopyAddress)
GetBooleanArrayElements: get all the elements of a boolean array

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
isCopyAddress - address of a flag to indicate whether the returned array is a copy or a direct pointer
Returns:
A pointer to the boolean array and the isCopy flag is set to true if it's a copy or false if it's a direct pointer
Throws:
OutOfMemoryError - if the system runs out of memory

GetByteArrayElements

private static Address GetByteArrayElements(JNIEnvironment env,
                                            int arrayJREF,
                                            Address isCopyAddress)
GetByteArrayElements: get all the elements of a byte array

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
isCopyAddress - address of a flag to indicate whether the returned array is a copy or a direct pointer
Returns:
A pointer to the byte array and the isCopy flag is set to true if it's a copy or false if it's a direct pointer
Throws:
OutOfMemoryError - if the system runs out of memory

GetCharArrayElements

private static Address GetCharArrayElements(JNIEnvironment env,
                                            int arrayJREF,
                                            Address isCopyAddress)
GetCharArrayElements: get all the elements of a char array

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
isCopyAddress - address of a flag to indicate whether the returned array is a copy or a direct pointer
Returns:
A pointer to the char array and the isCopy flag is set to true if it's a copy or false if it's a direct pointer
Throws:
OutOfMemoryError - if the system runs out of memory

GetShortArrayElements

private static Address GetShortArrayElements(JNIEnvironment env,
                                             int arrayJREF,
                                             Address isCopyAddress)
GetShortArrayElements: get all the elements of a short array

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
isCopyAddress - address of a flag to indicate whether the returned array is a copy or a direct pointer
Returns:
A pointer to the short array and the isCopy flag is set to true if it's a copy or false if it's a direct pointer
Throws:
OutOfMemoryError - if the system runs out of memory

GetIntArrayElements

private static Address GetIntArrayElements(JNIEnvironment env,
                                           int arrayJREF,
                                           Address isCopyAddress)
GetIntArrayElements: get all the elements of an integer array

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
isCopyAddress - address of a flag to indicate whether the returned array is a copy or a direct pointer
Returns:
A pointer to the integer array and the isCopy flag is set to true if it's a copy or false if it's a direct pointer
Throws:
OutOfMemoryError - if the system runs out of memory

GetLongArrayElements

private static Address GetLongArrayElements(JNIEnvironment env,
                                            int arrayJREF,
                                            Address isCopyAddress)
GetLongArrayElements: get all the elements of a long array

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
isCopyAddress - address of a flag to indicate whether the returned array is a copy or a direct pointer
Returns:
A pointer to the long array and the isCopy flag is set to true if it's a copy or false if it's a direct pointer
Throws:
OutOfMemoryError - if the system runs out of memory

GetFloatArrayElements

private static Address GetFloatArrayElements(JNIEnvironment env,
                                             int arrayJREF,
                                             Address isCopyAddress)
GetFloatArrayElements: get all the elements of a float array

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
isCopyAddress - address of a flag to indicate whether the returned array is a copy or a direct pointer
Returns:
A pointer to the float array and the isCopy flag is set to true if it's a copy or false if it's a direct pointer
Throws:
OutOfMemoryError - if the system runs out of memory

GetDoubleArrayElements

private static Address GetDoubleArrayElements(JNIEnvironment env,
                                              int arrayJREF,
                                              Address isCopyAddress)
GetDoubleArrayElements: get all the elements of a double array

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
isCopyAddress - address of a flag to indicate whether the returned array is a copy or a direct pointer
Returns:
A pointer to the double array and the isCopy flag is set to true if it's a copy or false if it's a direct pointer
Throws:
OutOfMemoryError - if the system runs out of memory

ReleaseBooleanArrayElements

private static void ReleaseBooleanArrayElements(JNIEnvironment env,
                                                int arrayJREF,
                                                Address copyBufferAddress,
                                                int releaseMode)
ReleaseBooleanArrayElements: free the native copy of the array, update changes to Java array as indicated

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
copyBufferAddress - the address of the copy of the array
releaseMode - one of 3 codes to indicate whether to copy back or free the array: releaseMode 0: copy back and free the buffer releaseMode 1: JNI_COMMIT, copy back but do not free the buffer releaseMode 2: JNI_ABORT, free the buffer with copying back

ReleaseByteArrayElements

private static void ReleaseByteArrayElements(JNIEnvironment env,
                                             int arrayJREF,
                                             Address copyBufferAddress,
                                             int releaseMode)
ReleaseByteArrayElements: free the native copy of the array, update changes to Java array as indicated

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
copyBufferAddress - the address of the copy of the array
releaseMode - one of 3 codes to indicate whether to copy back or free the array: releaseMode 0: copy back and free the buffer releaseMode 1: JNI_COMMIT, copy back but do not free the buffer releaseMode 2: JNI_ABORT, free the buffer with copying back

ReleaseCharArrayElements

private static void ReleaseCharArrayElements(JNIEnvironment env,
                                             int arrayJREF,
                                             Address copyBufferAddress,
                                             int releaseMode)
ReleaseCharArrayElements: free the native copy of the array, update changes to Java array as indicated

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
copyBufferAddress - the address of the copy of the array
releaseMode - one of 3 codes to indicate whether to copy back or free the array: releaseMode 0: copy back and free the buffer releaseMode 1: JNI_COMMIT, copy back but do not free the buffer releaseMode 2: JNI_ABORT, free the buffer with copying back

ReleaseShortArrayElements

private static void ReleaseShortArrayElements(JNIEnvironment env,
                                              int arrayJREF,
                                              Address copyBufferAddress,
                                              int releaseMode)
ReleaseShortArrayElements: free the native copy of the array, update changes to Java array as indicated

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
copyBufferAddress - the address of the copy of the array
releaseMode - one of 3 codes to indicate whether to copy back or free the array: releaseMode 0: copy back and free the buffer releaseMode 1: JNI_COMMIT, copy back but do not free the buffer releaseMode 2: JNI_ABORT, free the buffer with copying back

ReleaseIntArrayElements

private static void ReleaseIntArrayElements(JNIEnvironment env,
                                            int arrayJREF,
                                            Address copyBufferAddress,
                                            int releaseMode)
ReleaseIntArrayElements: free the native copy of the array, update changes to Java array as indicated

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
copyBufferAddress - the address of the copy of the array
releaseMode - one of 3 codes to indicate whether to copy back or free the array: releaseMode 0: copy back and free the buffer releaseMode 1: JNI_COMMIT, copy back but do not free the buffer releaseMode 2: JNI_ABORT, free the buffer with copying back

ReleaseLongArrayElements

private static void ReleaseLongArrayElements(JNIEnvironment env,
                                             int arrayJREF,
                                             Address copyBufferAddress,
                                             int releaseMode)
ReleaseLongArrayElements: free the native copy of the array, update changes to Java array as indicated

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
copyBufferAddress - the address of the copy of the array
releaseMode - one of 3 codes to indicate whether to copy back or free the array: releaseMode 0: copy back and free the buffer releaseMode 1: JNI_COMMIT, copy back but do not free the buffer releaseMode 2: JNI_ABORT, free the buffer with copying back

ReleaseFloatArrayElements

private static void ReleaseFloatArrayElements(JNIEnvironment env,
                                              int arrayJREF,
                                              Address copyBufferAddress,
                                              int releaseMode)
ReleaseFloatArrayElements: free the native copy of the array, update changes to Java array as indicated

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
copyBufferAddress - the address of the copy of the array
releaseMode - one of 3 codes to indicate whether to copy back or free the array: releaseMode 0: copy back and free the buffer releaseMode 1: JNI_COMMIT, copy back but do not free the buffer releaseMode 2: JNI_ABORT, free the buffer with copying back

ReleaseDoubleArrayElements

private static void ReleaseDoubleArrayElements(JNIEnvironment env,
                                               int arrayJREF,
                                               Address copyBufferAddress,
                                               int releaseMode)
ReleaseDoubleArrayElements: free the native copy of the array, update changes to Java array as indicated

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
copyBufferAddress - the address of the copy of the array
releaseMode - one of 3 codes to indicate whether to copy back or free the array: releaseMode 0: copy back and free the buffer releaseMode 1: JNI_COMMIT, copy back but do not free the buffer releaseMode 2: JNI_ABORT, free the buffer with copying back

GetBooleanArrayRegion

private static void GetBooleanArrayRegion(JNIEnvironment env,
                                          int arrayJREF,
                                          int startIndex,
                                          int length,
                                          Address bufAddress)
GetBooleanArrayRegion: copy a region of the array into the native buffer

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
startIndex - the starting index to copy
length - the number of elements to copy
bufAddress - the destination address in native to copy to
Throws:
ArrayIndexOutOfBoundsException - if one of the indices in the region is not valid

GetByteArrayRegion

private static void GetByteArrayRegion(JNIEnvironment env,
                                       int arrayJREF,
                                       int startIndex,
                                       int length,
                                       Address bufAddress)
GetByteArrayRegion: copy a region of the array into the native buffer

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
startIndex - the starting index to copy
length - the number of elements to copy
bufAddress - the destination address in native to copy to
Throws:
ArrayIndexOutOfBoundsException - if one of the indices in the region is not valid

GetCharArrayRegion

private static void GetCharArrayRegion(JNIEnvironment env,
                                       int arrayJREF,
                                       int startIndex,
                                       int length,
                                       Address bufAddress)
GetCharArrayRegion: copy a region of the array into the native buffer

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
startIndex - the starting index to copy
length - the number of elements to copy
bufAddress - the destination address in native to copy to
Throws:
ArrayIndexOutOfBoundsException - if one of the indices in the region is not valid

GetShortArrayRegion

private static void GetShortArrayRegion(JNIEnvironment env,
                                        int arrayJREF,
                                        int startIndex,
                                        int length,
                                        Address bufAddress)
GetShortArrayRegion: copy a region of the array into the native buffer

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
startIndex - the starting index to copy
length - the number of elements to copy
bufAddress - the destination address in native to copy to
Throws:
ArrayIndexOutOfBoundsException - if one of the indices in the region is not valid

GetIntArrayRegion

private static void GetIntArrayRegion(JNIEnvironment env,
                                      int arrayJREF,
                                      int startIndex,
                                      int length,
                                      Address bufAddress)
GetIntArrayRegion: copy a region of the array into the native buffer

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
startIndex - the starting index to copy
length - the number of elements to copy
bufAddress - the destination address in native to copy to
Throws:
ArrayIndexOutOfBoundsException - if one of the indices in the region is not valid

GetLongArrayRegion

private static void GetLongArrayRegion(JNIEnvironment env,
                                       int arrayJREF,
                                       int startIndex,
                                       int length,
                                       Address bufAddress)
GetLongArrayRegion: copy a region of the array into the native buffer

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
startIndex - the starting index to copy
length - the number of elements to copy
bufAddress - the destination address in native to copy to
Throws:
ArrayIndexOutOfBoundsException - if one of the indices in the region is not valid

GetFloatArrayRegion

private static void GetFloatArrayRegion(JNIEnvironment env,
                                        int arrayJREF,
                                        int startIndex,
                                        int length,
                                        Address bufAddress)
GetFloatArrayRegion: copy a region of the array into the native buffer

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
startIndex - the starting index to copy
length - the number of elements to copy
bufAddress - the destination address in native to copy to
Throws:
ArrayIndexOutOfBoundsException - if one of the indices in the region is not valid

GetDoubleArrayRegion

private static void GetDoubleArrayRegion(JNIEnvironment env,
                                         int arrayJREF,
                                         int startIndex,
                                         int length,
                                         Address bufAddress)
GetDoubleArrayRegion: copy a region of the array into the native buffer

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the source array
startIndex - the starting index to copy
length - the number of elements to copy
bufAddress - the destination address in native to copy to
Throws:
ArrayIndexOutOfBoundsException - if one of the indices in the region is not valid

SetBooleanArrayRegion

private static void SetBooleanArrayRegion(JNIEnvironment env,
                                          int arrayJREF,
                                          int startIndex,
                                          int length,
                                          Address bufAddress)
SetBooleanArrayRegion: copy a region of the native buffer into the array (1 byte element)

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the destination array
startIndex - the starting index to copy
length - the number of elements to copy
bufAddress - the source address in native to copy from
Throws:
ArrayIndexOutOfBoundsException - if one of the indices in the region is not valid

SetByteArrayRegion

private static void SetByteArrayRegion(JNIEnvironment env,
                                       int arrayJREF,
                                       int startIndex,
                                       int length,
                                       Address bufAddress)
SetByteArrayRegion: copy a region of the native buffer into the array (1 byte element)

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the destination array
startIndex - the starting index to copy
length - the number of elements to copy
bufAddress - the source address in native to copy from
Throws:
ArrayIndexOutOfBoundsException - if one of the indices in the region is not valid

SetCharArrayRegion

private static void SetCharArrayRegion(JNIEnvironment env,
                                       int arrayJREF,
                                       int startIndex,
                                       int length,
                                       Address bufAddress)
SetCharArrayRegion: copy a region of the native buffer into the array (2 byte element)

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the destination array
startIndex - the starting index to copy
length - the number of elements to copy
bufAddress - the source address in native to copy from
Throws:
ArrayIndexOutOfBoundsException - if one of the indices in the region is not valid

SetShortArrayRegion

private static void SetShortArrayRegion(JNIEnvironment env,
                                        int arrayJREF,
                                        int startIndex,
                                        int length,
                                        Address bufAddress)
SetShortArrayRegion: copy a region of the native buffer into the array (2 byte element)

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the destination array
startIndex - the starting index to copy
length - the number of elements to copy
bufAddress - the source address in native to copy from
Throws:
ArrayIndexOutOfBoundsException - if one of the indices in the region is not valid

SetIntArrayRegion

private static void SetIntArrayRegion(JNIEnvironment env,
                                      int arrayJREF,
                                      int startIndex,
                                      int length,
                                      Address bufAddress)
SetIntArrayRegion: copy a region of the native buffer into the array

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the destination array
startIndex - the starting index to copy
length - the number of elements to copy
bufAddress - the source address in native to copy from
Throws:
ArrayIndexOutOfBoundsException - if one of the indices in the region is not valid

SetLongArrayRegion

private static void SetLongArrayRegion(JNIEnvironment env,
                                       int arrayJREF,
                                       int startIndex,
                                       int length,
                                       Address bufAddress)
SetLongArrayRegion: copy a region of the native buffer into the array

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the destination array
startIndex - the starting index to copy
length - the number of elements to copy
bufAddress - the source address in native to copy from
Throws:
ArrayIndexOutOfBoundsException - if one of the indices in the region is not valid

SetFloatArrayRegion

private static void SetFloatArrayRegion(JNIEnvironment env,
                                        int arrayJREF,
                                        int startIndex,
                                        int length,
                                        Address bufAddress)
SetFloatArrayRegion: copy a region of the native buffer into the array

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the destination array
startIndex - the starting index to copy
length - the number of elements to copy
bufAddress - the source address in native to copy from
Throws:
ArrayIndexOutOfBoundsException - if one of the indices in the region is not valid

SetDoubleArrayRegion

private static void SetDoubleArrayRegion(JNIEnvironment env,
                                         int arrayJREF,
                                         int startIndex,
                                         int length,
                                         Address bufAddress)
SetDoubleArrayRegion: copy a region of the native buffer into the array

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the destination array
startIndex - the starting index to copy
length - the number of elements to copy
bufAddress - the source address in native to copy from
Throws:
ArrayIndexOutOfBoundsException - if one of the indices in the region is not valid

RegisterNatives

private static int RegisterNatives(JNIEnvironment env,
                                   int classJREF,
                                   Address methodsAddress,
                                   int nmethods)
RegisterNatives: registers implementation of native methods

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class to register native methods in
methodsAddress - the address of an array of native methods to be registered
nmethods - the number of native methods in the array
Returns:
0 is successful -1 if failed
Throws:
NoSuchMethodError - if a specified method cannot be found or is not native

UnregisterNatives

private static int UnregisterNatives(JNIEnvironment env,
                                     int classJREF)
UnregisterNatives: unregisters native methods

Parameters:
env - A JREF index for the JNI environment object
classJREF - a JREF index for the class to register native methods in
Returns:
0 is successful -1 if failed

MonitorEnter

private static int MonitorEnter(JNIEnvironment env,
                                int objJREF)
MonitorEnter

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object to lock
Returns:
0 if the object is locked successfully, -1 if not

MonitorExit

private static int MonitorExit(JNIEnvironment env,
                               int objJREF)
MonitorExit

Parameters:
env - A JREF index for the JNI environment object
objJREF - a JREF index for the object to unlock
Returns:
0 if the object is unlocked successfully, -1 if not

GetJavaVM

private static int GetJavaVM(JNIEnvironment env,
                             Address StarStarJavaVM)

FromReflectedMethod

private static int FromReflectedMethod(JNIEnvironment env,
                                       int methodJREF)
FromReflectedMethod

Parameters:
env - A JREF index for the JNI environment object
methodJREF - a JREF index for the java.lang.reflect.Method or java.lang.reflect.Constructor object.
Returns:
the jmethodID corresponding to methodJREF

FromReflectedField

private static int FromReflectedField(JNIEnvironment env,
                                      int fieldJREF)
FromReflectedField

Parameters:
env - A JREF index for the JNI environment object
fieldJREF - a JREF index for a java.lang.reflect.Field methodID
Returns:
the jfieldID corresponding to fieldJREF

ToReflectedMethod

private static int ToReflectedMethod(JNIEnvironment env,
                                     int clsJREF,
                                     int methodID,
                                     boolean isStatic)
ToReflectedMethod

Parameters:
env - A JREF index for the JNI environment object
clsJREF - The JREF index of the class from which methodID was derived.
methodID - a jmethodID to turn into a reflected method
isStatic - argument that is not specified in Sun's JNI 1.2 spec, but IS present in the 1.4.2 JDK's implementation! Our implementation will just ignore it, in any case. This is a good example of why the same entity shouldn't get to write both the spec and the reference implementation.
Returns:
a JREF index for the java.lang.reflect.Method or java.lang.reflect.Constructor object associated with methodID.

ToReflectedField

private static int ToReflectedField(JNIEnvironment env,
                                    int clsJREF,
                                    int fieldID,
                                    boolean isStatic)
ToReflectedField

Parameters:
env - A JREF index for the JNI environment object
clsJREF - The JREF index of the class from which fieldID was derived.
fieldID - a jfieldID
isStatic - argument that is not specified in Sun's JNI 1.2 spec, but IS present in the 1.4.2 JDK's implementation! Our implementation will just ignore it, in any case. This is a good example of why the same entity shouldn't get to write both the spec and the reference implementation.
Returns:
a JREF index for the java.lang.reflect.Field object associated with fieldID.

PushLocalFrame

private static int PushLocalFrame(JNIEnvironment env,
                                  int capacity)
Push a local frame for local references. We could implement this more fancily, but it seems that we hardly need to, since we allow an unlimited number of local refs. One could force running out of memory in a long-running loop in JNI, of course.


PopLocalFrame

private static int PopLocalFrame(JNIEnvironment env,
                                 int resultJREF)
Push a local frame for local references. We could implement this more fancily, but it seems that we hardly need to, since we allow an unlimited number of local refs. One could force running out of memory in a long-running loop in JNI, of course, and this might save us from that. Let's hold off until we need it. TODO.

Returns:
a local reference in the old frame that refers to the same object as oldJREF.

NewLocalRef

private static int NewLocalRef(JNIEnvironment env,
                               int oldJREF)
NewLocalRef

Parameters:
env - A JREF index for the JNI environment object
oldJREF - JREF index of an existing reference.
Returns:
a new local reference that refers to the same object as oldJREF. C NULL pointer if the oldJREF refers to null.

EnsureLocalCapacity

private static int EnsureLocalCapacity(JNIEnvironment env,
                                       int capacity)
EnsureLocalCapacity

Parameters:
env - A JREF index for the JNI environment object
capacity - how many more local references do we want to ensure can be created?
Returns:
0 on success. The JNI spec says that on failure this throws OutOfMemoryError and returns a negative number. But we don't have to worry about that at all.

GetStringRegion

private static void GetStringRegion(JNIEnvironment env,
                                    int strJREF,
                                    int start,
                                    int len,
                                    Address buf)
GetStringRegion: Copy a region of Unicode characters from a string to the given buffer.

Parameters:
env - A JREF index for the JNI environment object
strJREF - a JREF index for the String object
start - index to start reading characters from the string
len - how many characters to read
buf - the buffer to copy the region into
Throws:
StringIndexOutOfBoundsException - if asked for an out-of-range region of the string.

GetStringUTFRegion

private static void GetStringUTFRegion(JNIEnvironment env,
                                       int strJREF,
                                       int start,
                                       int len,
                                       Address buf)
GetStringUTFRegion: Copy a region of Unicode characters from a string to the given buffer, as UTF8 characters.

Parameters:
env - A JREF index for the JNI environment object
strJREF - a JREF index for the String object
start - index to start reading characters from the string
len - how many characters to read from the string
buf - the buffer to copy the region into -- assume it's big enough
Throws:
StringIndexOutOfBoundsException - if asked for an out-of-range region of the string.

GetPrimitiveArrayCritical

private static Address GetPrimitiveArrayCritical(JNIEnvironment env,
                                                 int arrayJREF,
                                                 Address isCopyAddress)
GetPrimitiveArrayCritical: return a direct pointer to the primitive array and disable GC so that the array will not be moved. This function is intended to be paired with the ReleasePrimitiveArrayCritical function within a short time so that GC will be reenabled

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the primitive array in Java
isCopyAddress - address of isCopy jboolean (an int)
Returns:
The address of the primitive array, and the jboolean pointed to by isCopyAddress is set to false, indicating that this is not a copy. Address zero (null) on error.
Throws:
OutOfMemoryError - is specified but will not be thrown in this implementation since no copy will be made

ReleasePrimitiveArrayCritical

private static void ReleasePrimitiveArrayCritical(JNIEnvironment env,
                                                  int arrayJREF,
                                                  Address arrayCopyAddress,
                                                  int mode)
ReleasePrimitiveArrayCritical: this function is intended to be paired with the GetPrimitiveArrayCritical function. Since the native code has direct access to the array, no copyback update is necessary; GC is simply reenabled.

Parameters:
env - A JREF index for the JNI environment object
arrayJREF - a JREF index for the primitive array in Java
arrayCopyAddress -
mode - a flag indicating whether to update the Java array with the copy and whether to free the copy. For this implementation, no copy was made so this flag has no effect.

GetStringCritical

private static Address GetStringCritical(JNIEnvironment env,
                                         int strJREF,
                                         Address isCopyAddress)
GetStringCritical: Like GetStringChars and ReleaseStringChars, but in some VM environments the VM may be able to avoid making a copy. Native code must not issue arbitrary JNI calls and must not cause the current thread to block.

Parameters:
env - A JREF index for the JNI environment object
strJREF - a JREF index for the string in Java
isCopyAddress - address of isCopy jboolean (an int)
Returns:
The address of the backing array; address zero (null) on error, and the jboolean pointed to by isCopyAddress is set to false, indicating that this is not a copy.

ReleaseStringCritical

private static void ReleaseStringCritical(JNIEnvironment env,
                                          int strJREF,
                                          Address carray)
ReleaseStringCritical: this function is intended to be paired with the GetStringCritical function. Since the native code has direct access to the string's backing array of characters, no copyback update is necessary; GC is simply reenabled.

Parameters:
env - A JREF index for the JNI environment object
strJREF - a JREF index for the string in Java (ignored)
carray - the pointer returned by GetStringCritical (ignored)

NewWeakGlobalRef

private static int NewWeakGlobalRef(JNIEnvironment env,
                                    int objectJREF)

DeleteWeakGlobalRef

private static void DeleteWeakGlobalRef(JNIEnvironment env,
                                        int refJREF)

ExceptionCheck

private static int ExceptionCheck(JNIEnvironment env)

NewDirectByteBuffer

private static int NewDirectByteBuffer(JNIEnvironment env,
                                       Address address,
                                       long capacity)
These functions are in JNI 1.4


GetDirectBufferAddress

private static Address GetDirectBufferAddress(JNIEnvironment env,
                                              int bufJREF)

GetDirectBufferCapacity

private static long GetDirectBufferCapacity(JNIEnvironment env,
                                            int bufJREF)

reserved0

private static int reserved0(JNIEnvironment env)
Empty Slots


reserved1

private static int reserved1(JNIEnvironment env)

reserved2

private static int reserved2(JNIEnvironment env)

reserved3

private static int reserved3(JNIEnvironment env)