aicas logoJamaica 3.2 release 62

com.aicas.jamaica.lang
Class JitVmInterface

java.lang.Object
  extended by com.aicas.jamaica.lang.JitVmInterface

public abstract class JitVmInterface
extends Object

JitCompilerVMInterface defines the native VM interface needed for the Jamaica just-in-time compiler.


Method Summary
static long adrOfMemberDescriptor(Member m)
          Obtain the memory address of the descriptor of a member
static long adrOfObject(Object o)
          Obtain the memory address of an object
static byte[] byteCode(Member m)
          Obtain the byte code for a given method or constructor.
static int byteCodeSize(Member m)
          Obtain the byte code size for a given method or constructor.
static Class cPoolClass(Class cl, int index)
          Obtain the CPool Class entry at the given index.
static double cPoolDouble(Class cl, int index)
          Obtain the CPool Double entry at the given index.
static Field cPoolField(Class cl, int index)
          Obtain the CPool Field entry at the given index.
static float cPoolFloat(Class cl, int index)
          Obtain the CPool Float entry at the given index.
static int cPoolInteger(Class cl, int index)
          Obtain the CPool Integer entry at the given index.
static long cPoolLong(Class cl, int index)
          Obtain the CPool Long entry at the given index.
static Member cPoolMethod(Class cl, int index)
          Obtain the CPool Method/Constructor entry at the given index.
static String cPoolString(Class cl, int index)
          Obtain the CPool String entry at the given index.
static int cPoolTag(Class cl, int index)
          Obtain the CPool tag at the given index.
static byte[] cPoolUtf8(Class cl, int index)
          Obtain the CPool Utf8 entry at the given index.
static int[] exceptionTable(Member m)
          Obtain the exception table for a given method or constructor.
static int fieldOffset(Field field)
          Obtain the offset of a given instance Field
static int gcenvGreyList2Offset()
          Obtain the offset of the greyList2 field in the GCEnv structure.
static int gcenvWhiteOffset()
          Obtain the offset of the white field in the GCEnv structure.
static boolean hasReverseStub(Member m)
          Check if a reverse stub exists for the given method's signature
static int interfaceId(Class cl)
          Obtain the id of a given interface class.
static int methodOffset(Method method)
          Obtain the offset of a given virtual or interface Method
static Member nativeGetMember(Object ref)
          Create a java.lang.reflect.Member (Method or Constructor) for a given method descriptor.
static long nativeGetMethodAddress(Object ref)
          Get the native address of method
static Object nativeGetPreemptedMethod()
          Find the preempeted thread by the JitProfiler thread
static long nativeRoutineAllocJavaObject()
          Obtain the address of a helper routine jamaicaInterpreter_allocJavaObject
static long nativeRoutineAllocMultiArray()
          Obtain the address of a helper routine jamaicaInterpreter_allocMultiArray
static long nativeRoutineAllocSimpleArray()
          Obtain the address of a helper routine jamaicaInterpreter_allocSimpleArray
static long nativeRoutineCallFromCompiled()
          Obtain the address of a helper routine call_from_compiled.
static long nativeRoutineCheckAssign()
          Obtain the address of a helper routine checkAssign.
static long nativeRoutineCheckAssignment()
          Obtain the address of a helper routine checkassignment.
static long nativeRoutineCleanSavedRefs()
          Obtain the address of a helper routine cleanSavedRefs
static long nativeRoutineClearRefsOnExc()
          Obtain the address of a helper routine clearRefsOnExc
static long nativeRoutineCompatibleClass()
          Obtain the address of a helper routine compatibleClass.
static long nativeRoutineCreateJBIFrame()
          Obtain the address of a helper routine createJBIFrame
static long nativeRoutineDiv64()
          Obtain the address of a helper routine div64
static long nativeRoutineDoubleToInt()
          Obtain the address of a helper routine doubleToInt
static long nativeRoutineDoubleToLong()
          Obtain the address of a helper routine doubleToLong
static long nativeRoutineInitializeClass()
          Obtain the address of a helper routine init_class
static long nativeRoutineLoadBooleanArray()
          Obtain the address of a helper routine loadBooleanArray.
static long nativeRoutineMod64()
          Obtain the address of a helper routine mod64
static long nativeRoutineModDouble()
          Obtain the address of a helper routine modDouble
static long nativeRoutineMonitorEnter()
          Obtain the address of a helper routine jamaicaMonitor_enter
static long nativeRoutineMonitorExit()
          Obtain the address of a helper routine jamaicaMonitor_exit
static long nativeRoutinePrint()
          Obtain the address of a helper routine that prints a C string.
static long nativeRoutinePrintInt32()
          Obtain the address of a helper routine that prints a 32 bit integer value.
static long nativeRoutinePropagateException()
          Obtain the address of a helper routine propagateException.
static long nativeRoutineRemoveJBIFrame()
          Obtain the address of a helper routine removeJBIFrame
static long nativeRoutineSetJump()
          Obtain the address of a helper routine setjmp.
static long nativeRoutineStoreBooleanArray()
          Obtain the address of a helper routine storeBooleanArray.
static long nativeRoutineSyncPointFull()
          Obtain the address of a helper routine syncPointFull.
static long nativeRoutineTAE()
          Obtain the address of a helper routine tAE (throw ArithmeticException)
static long nativeRoutineTAIOOBE()
          Obtain the address of a helper routine tAIOOBE (throw ArrayIndexOutOfBoundsException)
static long nativeRoutineTASE()
          Obtain the address of a helper routine tASE (throw ArrayStoreException)
static long nativeRoutineTCCE()
          Obtain the address of a helper routine tCCE (throw ClassCastException)
static long nativeRoutineThrowFromCompiled()
          Obtain the address of a helper routine jamaica_throw_from_compiled
static long nativeRoutineTNASE()
          Obtain the address of a helper routine tNASE (throw NegativeArraySizeException)
static long nativeRoutineTNPE()
          Obtain the address of a helper routine tNPE (throw NullPointerException)
static long nativeRoutineTSIOOBE()
          Obtain the address of a helper routine tSIOOBE (throw StringIndexOutOfBoundsException)
static long nativeRoutineTSOE()
          Obtain the address of a helper routine tSOE
static void registerCode(Member m, byte[] code, int[] code_relocs, byte[] stub, int[] stub_relocs)
          Register compiled code for a given method or constructor.
static void registerReverseStub(byte[] revStub, int id)
          Register a new reverse (compiled -> interpreted) stub method for the given signature id.
static int sizeOfJumpBuffer()
          Obtain the size of the longjump-buffer
static int threadCalledMethodOffset()
          Obtain the offset of the called method field in the thread structure.
static int threadCStackLimitOffset()
          Obtain the offset of the C stack limit field in the thread structure.
static int threadFrameOffset()
          Obtain the offset of the frame field in the thread structure.
static int threadJavaStackSizeOffset()
          Obtain the offset of the javaStackSize field in the thread structure.
static int threadJavaThreadOffset()
          Obtain the offset of the javaThread field in the thread structure.
static int threadMutatorContLocalsIndexOffset()
          Obtain the offset of the mutator's cont locals index field in the thread structure.
static int threadMutatorContLocalsOffset()
          Obtain the offset of the mutator's cont locals field in the thread structure.
static int threadMutatorGCEnvOffset()
          Obtain the offset of the mutuator's gcenv field in the thread structure.
static int threadRescheduleOffset()
          Obtain the offset of the reschedule field in the thread structure.
static int threadStackOffset()
          Obtain the offset of the Java stack in the thread structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerCode

public static void registerCode(Member m,
                                byte[] code,
                                int[] code_relocs,
                                byte[] stub,
                                int[] stub_relocs)
Register compiled code for a given method or constructor.

Parameters:
m - the method or constructor that was compiled
code - the compiled code using JBI calling conventions
code_relocs - offsets in code that require relocation
stub - the interpreted -> compiled stub method for context switches from interpreter to this compiled method.
stub_relocs - offsets in stub that require relocation

registerReverseStub

public static void registerReverseStub(byte[] revStub,
                                       int id)
Register a new reverse (compiled -> interpreted) stub method for the given signature id.

Parameters:
revStub - the code of the reverse stub
id - the id of the signature of the methods to use this reverse stub for

byteCode

public static byte[] byteCode(Member m)
Obtain the byte code for a given method or constructor.

Parameters:
m - the method or constructor
Returns:
the byte code instructions of this method or null if not present (since m is native, abstract, or compiled).

byteCodeSize

public static int byteCodeSize(Member m)
Obtain the byte code size for a given method or constructor.

Parameters:
m - the method or constructor
Returns:
the number of bytes in the byte code of this method or 0 if not present (since m is native, abstract, or compiled).

exceptionTable

public static int[] exceptionTable(Member m)
Obtain the exception table for a given method or constructor.

Parameters:
m - the method or constructor
Returns:
the exception table, null in case the method or constructor does not catch any exceptions.

cPoolUtf8

public static byte[] cPoolUtf8(Class cl,
                               int index)
Obtain the CPool Utf8 entry at the given index.

Parameters:
cl - the class whose CPool we want to access
index - the cpool index
Returns:
the Utf8 string at the given index

cPoolInteger

public static int cPoolInteger(Class cl,
                               int index)
Obtain the CPool Integer entry at the given index.

Parameters:
cl - the class whose CPool we want to access
index - the cpool index
Returns:
the integer at the given index

cPoolFloat

public static float cPoolFloat(Class cl,
                               int index)
Obtain the CPool Float entry at the given index.

Parameters:
cl - the class whose CPool we want to access
index - the cpool index
Returns:
the float at the given index

cPoolLong

public static long cPoolLong(Class cl,
                             int index)
Obtain the CPool Long entry at the given index.

Parameters:
cl - the class whose CPool we want to access
index - the cpool index
Returns:
the long at the given index

cPoolDouble

public static double cPoolDouble(Class cl,
                                 int index)
Obtain the CPool Double entry at the given index.

Parameters:
cl - the class whose CPool we want to access
index - the cpool index
Returns:
the double at the given index

cPoolClass

public static Class cPoolClass(Class cl,
                               int index)
Obtain the CPool Class entry at the given index.

Parameters:
cl - the class whose CPool we want to access
index - the cpool index
Returns:
the class at the given index

cPoolString

public static String cPoolString(Class cl,
                                 int index)
Obtain the CPool String entry at the given index.

Parameters:
cl - the class whose CPool we want to access
index - the cpool index
Returns:
the string at the given index

cPoolField

public static Field cPoolField(Class cl,
                               int index)
Obtain the CPool Field entry at the given index.

Parameters:
cl - the class whose CPool we want to access
index - the cpool index
Returns:
the Field at the given index

cPoolMethod

public static Member cPoolMethod(Class cl,
                                 int index)
Obtain the CPool Method/Constructor entry at the given index.

Parameters:
cl - the class whose CPool we want to access
index - the cpool index
Returns:
the Method/Constructor at the given index

cPoolTag

public static int cPoolTag(Class cl,
                           int index)
Obtain the CPool tag at the given index.

Parameters:
cl - the class whose CPool we want to access
index - the cpool index
Returns:
the tag of this CPool entry

fieldOffset

public static int fieldOffset(Field field)
Obtain the offset of a given instance Field

Parameters:
field - the instance field whose offset we want to access
Returns:
the field offset

methodOffset

public static int methodOffset(Method method)
Obtain the offset of a given virtual or interface Method

Parameters:
method - the virtual or interface method whose offset we want to access
Returns:
the method offset, -1 if the method is not a virtual or interface method.

interfaceId

public static int interfaceId(Class cl)
Obtain the id of a given interface class.

Parameters:
cl - the interface class whose id we want to determine
Returns:
the interface id of cl

adrOfMemberDescriptor

public static long adrOfMemberDescriptor(Member m)
Obtain the memory address of the descriptor of a member

Parameters:
m - the method or field
Returns:
the address of the desriptor

adrOfObject

public static long adrOfObject(Object o)
Obtain the memory address of an object

Parameters:
o - the object
Returns:
the address of the object

hasReverseStub

public static boolean hasReverseStub(Member m)
Check if a reverse stub exists for the given method's signature

Parameters:
m - a method or constructor
Returns:
true iff a reverse stub exists for m's signature

nativeRoutinePrintInt32

public static long nativeRoutinePrintInt32()
Obtain the address of a helper routine that prints a 32 bit integer value.

Returns:
the address of the print routine

nativeRoutinePrint

public static long nativeRoutinePrint()
Obtain the address of a helper routine that prints a C string.

Returns:
the address of the print routine

nativeRoutineSetJump

public static long nativeRoutineSetJump()
Obtain the address of a helper routine setjmp. Note that the address of setjmp cannot be determined on all systems, so the result will be 0 if setjmp is not known.

Returns:
the address of the setjmp routine or 0.

nativeRoutineCleanSavedRefs

public static long nativeRoutineCleanSavedRefs()
Obtain the address of a helper routine cleanSavedRefs

Returns:
the address of the cleanSavedRefs routine

nativeRoutineClearRefsOnExc

public static long nativeRoutineClearRefsOnExc()
Obtain the address of a helper routine clearRefsOnExc

Returns:
the address of the clearRefsOnExc routine

nativeRoutineCreateJBIFrame

public static long nativeRoutineCreateJBIFrame()
Obtain the address of a helper routine createJBIFrame

Returns:
the address of the createJBIFrame routine

nativeRoutineRemoveJBIFrame

public static long nativeRoutineRemoveJBIFrame()
Obtain the address of a helper routine removeJBIFrame

Returns:
the address of the removeJBIFrame routine

nativeRoutineCallFromCompiled

public static long nativeRoutineCallFromCompiled()
Obtain the address of a helper routine call_from_compiled.

Returns:
the address of the call_from_compiled routine

nativeRoutineSyncPointFull

public static long nativeRoutineSyncPointFull()
Obtain the address of a helper routine syncPointFull.

Returns:
the address of the syncPointFull routine

nativeRoutineTSOE

public static long nativeRoutineTSOE()
Obtain the address of a helper routine tSOE

Returns:
the address of the tSOE routine

nativeRoutineInitializeClass

public static long nativeRoutineInitializeClass()
Obtain the address of a helper routine init_class

Returns:
the address of the init_class routine

nativeRoutineAllocJavaObject

public static long nativeRoutineAllocJavaObject()
Obtain the address of a helper routine jamaicaInterpreter_allocJavaObject

Returns:
the address of the routine

nativeRoutineAllocSimpleArray

public static long nativeRoutineAllocSimpleArray()
Obtain the address of a helper routine jamaicaInterpreter_allocSimpleArray

Returns:
the address of the routine

nativeRoutineAllocMultiArray

public static long nativeRoutineAllocMultiArray()
Obtain the address of a helper routine jamaicaInterpreter_allocMultiArray

Returns:
the address of the routine

nativeRoutineThrowFromCompiled

public static long nativeRoutineThrowFromCompiled()
Obtain the address of a helper routine jamaica_throw_from_compiled

Returns:
the address of the routine

nativeRoutineMonitorEnter

public static long nativeRoutineMonitorEnter()
Obtain the address of a helper routine jamaicaMonitor_enter

Returns:
the address of the routine

nativeRoutineMonitorExit

public static long nativeRoutineMonitorExit()
Obtain the address of a helper routine jamaicaMonitor_exit

Returns:
the address of the routine

nativeRoutineTAE

public static long nativeRoutineTAE()
Obtain the address of a helper routine tAE (throw ArithmeticException)

Returns:
the address of the routine

nativeRoutineTNPE

public static long nativeRoutineTNPE()
Obtain the address of a helper routine tNPE (throw NullPointerException)

Returns:
the address of the routine

nativeRoutineTSIOOBE

public static long nativeRoutineTSIOOBE()
Obtain the address of a helper routine tSIOOBE (throw StringIndexOutOfBoundsException)

Returns:
the address of the routine

nativeRoutineTAIOOBE

public static long nativeRoutineTAIOOBE()
Obtain the address of a helper routine tAIOOBE (throw ArrayIndexOutOfBoundsException)

Returns:
the address of the routine

nativeRoutineTNASE

public static long nativeRoutineTNASE()
Obtain the address of a helper routine tNASE (throw NegativeArraySizeException)

Returns:
the address of the routine

nativeRoutineTCCE

public static long nativeRoutineTCCE()
Obtain the address of a helper routine tCCE (throw ClassCastException)

Returns:
the address of the routine

nativeRoutineTASE

public static long nativeRoutineTASE()
Obtain the address of a helper routine tASE (throw ArrayStoreException)

Returns:
the address of the routine

nativeRoutineCheckAssign

public static long nativeRoutineCheckAssign()
Obtain the address of a helper routine checkAssign.

Returns:
the address of the routine

nativeRoutineCheckAssignment

public static long nativeRoutineCheckAssignment()
Obtain the address of a helper routine checkassignment.

Returns:
the address of the routine

nativeRoutineLoadBooleanArray

public static long nativeRoutineLoadBooleanArray()
Obtain the address of a helper routine loadBooleanArray.

Returns:
the address of the routine

nativeRoutineStoreBooleanArray

public static long nativeRoutineStoreBooleanArray()
Obtain the address of a helper routine storeBooleanArray.

Returns:
the address of the routine

nativeRoutineCompatibleClass

public static long nativeRoutineCompatibleClass()
Obtain the address of a helper routine compatibleClass.

Returns:
the address of the routine

nativeRoutinePropagateException

public static long nativeRoutinePropagateException()
Obtain the address of a helper routine propagateException.

Returns:
the address of the routine

nativeRoutineDiv64

public static long nativeRoutineDiv64()
Obtain the address of a helper routine div64

Returns:
the address of the routine

nativeRoutineMod64

public static long nativeRoutineMod64()
Obtain the address of a helper routine mod64

Returns:
the address of the routine

nativeRoutineModDouble

public static long nativeRoutineModDouble()
Obtain the address of a helper routine modDouble

Returns:
the address of the routine

nativeRoutineDoubleToInt

public static long nativeRoutineDoubleToInt()
Obtain the address of a helper routine doubleToInt

Returns:
the address of the routine

nativeRoutineDoubleToLong

public static long nativeRoutineDoubleToLong()
Obtain the address of a helper routine doubleToLong

Returns:
the address of the routine

sizeOfJumpBuffer

public static int sizeOfJumpBuffer()
Obtain the size of the longjump-buffer

Returns:
sizeof(jamaica_native_longjump)

threadStackOffset

public static int threadStackOffset()
Obtain the offset of the Java stack in the thread structure.

Returns:
offset of Java stack reference

threadCStackLimitOffset

public static int threadCStackLimitOffset()
Obtain the offset of the C stack limit field in the thread structure.

Returns:
offset of C stack limit field

threadFrameOffset

public static int threadFrameOffset()
Obtain the offset of the frame field in the thread structure.

Returns:
offset of frame field

threadJavaStackSizeOffset

public static int threadJavaStackSizeOffset()
Obtain the offset of the javaStackSize field in the thread structure.

Returns:
offset of javaStackSize field

threadMutatorGCEnvOffset

public static int threadMutatorGCEnvOffset()
Obtain the offset of the mutuator's gcenv field in the thread structure.

Returns:
offset of m.gcenv field

threadMutatorContLocalsOffset

public static int threadMutatorContLocalsOffset()
Obtain the offset of the mutator's cont locals field in the thread structure.

Returns:
offset of m.cont_locals field

threadMutatorContLocalsIndexOffset

public static int threadMutatorContLocalsIndexOffset()
Obtain the offset of the mutator's cont locals index field in the thread structure.

Returns:
offset of m.cont_locals_index field

threadCalledMethodOffset

public static int threadCalledMethodOffset()
Obtain the offset of the called method field in the thread structure.

Returns:
offset of calledMethod field

threadRescheduleOffset

public static int threadRescheduleOffset()
Obtain the offset of the reschedule field in the thread structure.

Returns:
offset of reschedule

threadJavaThreadOffset

public static int threadJavaThreadOffset()
Obtain the offset of the javaThread field in the thread structure.

Returns:
offset of javaThread field

gcenvGreyList2Offset

public static int gcenvGreyList2Offset()
Obtain the offset of the greyList2 field in the GCEnv structure.

Returns:
offset of greyList2

gcenvWhiteOffset

public static int gcenvWhiteOffset()
Obtain the offset of the white field in the GCEnv structure.

Returns:
offset of white, or -1 if this field is not present (in safety critical Jamaica)

nativeGetPreemptedMethod

public static Object nativeGetPreemptedMethod()
Find the preempeted thread by the JitProfiler thread

Returns:
reference to method descriptor

nativeGetMethodAddress

public static long nativeGetMethodAddress(Object ref)
Get the native address of method

Parameters:
ref - the JamaicaVM internal method descriptor
Returns:
address of method descriptor

nativeGetMember

public static Member nativeGetMember(Object ref)
Create a java.lang.reflect.Member (Method or Constructor) for a given method descriptor.

Parameters:
ref - the JamaicaVM internal method descriptor
Returns:
an instance of Method or Constructor that represents the same method.

aicas logoJamaica 3.2 release 62

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2008 aicas GmbH. All Rights Reserved.