Package org.robovm.rt
Class VM
java.lang.Object
org.robovm.rt.VM
public final class VM extends Object
- Version:
- $Id$
-
Constructor Summary
Constructors Constructor Description VM() -
Method Summary
Modifier and Type Method Description static longallocateMemory(int size)static longallocateMemoryAtomic(int size)static longallocateMemoryUncollectable(int size)static <T> TallocateObject(Class<T> cls)static voidbindBridgeMethod(Method method, long impl)static StringbootClassPath()Returns the VM's boot class path.static ObjectcastAddressToObject(long address)static StringclassPath()Returns the VM's class path.static voidfree(long address)static longfreeMemoryUncollectable(long address)static voidgenerateHeapDump()static longgetArrayValuesAddress(Object array)static booleangetBoolean(long address)static bytegetByte(long address)static longgetCallbackMethodImpl(Method method)static chargetChar(long address)static longgetClassFieldAddress(long field)static doublegetDouble(long address)static longgetFieldAddress(Field field)static floatgetFloat(long address)static intgetInstanceFieldOffset(long field)static intgetInt(long address)static longgetLong(long address)static ObjectgetObject(long address)static longgetObjectAddress(Object object)static longgetPointer(long address)static byte[]getRuntimeData(String id)Returns runtime data linked into the executable during compilation.static shortgetShort(long address)static Class<?>[]getStackClasses(int skipNum, int maxDepth)Returns the defining classes of the methods in the call stack.static longgetStringUTFChars(String s)static StringimagePath()Returns the path to the executable or dynamic library currently running.static booleanisBridgeMethodBound(Method method)static Class<?>[]listClasses(Class<?> assignableToClass, ClassLoader classLoader)static longmalloc(int size)static voidmemcpy(long s1, long s2, long n)static voidmemmove16(long s1, long s2, long n)static voidmemmove32(long s1, long s2, long n)static voidmemmove64(long s1, long s2, long n)static voidmemmove8(long s1, long s2, long n)static voidmemset(long s, byte c, long n)static boolean[]newBooleanArray(long address, int size)static byte[]newByteArray(long address, int size)static char[]newCharArray(long address, int size)static ByteBuffernewDirectByteBuffer(long address, long capacity)static double[]newDoubleArray(long address, int size)static float[]newFloatArray(long address, int size)static int[]newIntArray(long address, int size)static long[]newLongArray(long address, int size)static short[]newShortArray(long address, int size)static StringnewStringNoCopy(char[] chars, int offset, int length)static StringnewStringUTF(long address)static voidregisterDisappearingLink(long address, Object obj)static StringresourcesPath()Returns the resources path where the apps or frameworks resources are located.static voidsetBoolean(long address, boolean value)static voidsetByte(long address, byte value)static voidsetChar(long address, char value)static voidsetDouble(long address, double value)static voidsetFloat(long address, float value)static voidsetInt(long address, int value)static voidsetLong(long address, long value)static voidsetObject(long address, Object value)static voidsetPointer(long address, long value)static voidsetShort(long address, short value)static String[]staticLibs()Returns the names of any static libraries that have been linked into the executable.static voidunregisterDisappearingLink(long address)static StringvmVersion()Returns the VM's version.
-
Constructor Details
-
VM
public VM()
-
-
Method Details
-
bootClassPath
Returns the VM's boot class path. -
classPath
Returns the VM's class path. -
imagePath
Returns the path to the executable or dynamic library currently running. -
resourcesPath
Returns the resources path where the apps or frameworks resources are located. For executables this is typically the directory where the executable is located. For OS X/iOS frameworks this is typically theResourcesfolder located next to the dynamic library file. -
staticLibs
Returns the names of any static libraries that have been linked into the executable. -
vmVersion
Returns the VM's version. -
getStackClasses
Returns the defining classes of the methods in the call stack. IfskipNumis 0 the first entry in the returned array is the class of the method calling the caller of this method.- Parameters:
skipNum- the number of classes to skip.maxDepth- the max number of classes to return. -1 for the entire stack.- Returns:
- the classes.
-
listClasses
- Parameters:
assignableToClass- optionalClasswhich all returnedClasses must be assignment compatible with. Passnullto return all classes.classLoader- theClassLoaderwhich the returnedClasses must belong to. Passnullfor the bootClassLoader.- Returns:
- the matching classes.
-
getRuntimeData
Returns runtime data linked into the executable during compilation. -
generateHeapDump
public static final void generateHeapDump() -
allocateMemory
public static final long allocateMemory(int size) -
allocateMemoryUncollectable
public static final long allocateMemoryUncollectable(int size) -
allocateMemoryAtomic
public static final long allocateMemoryAtomic(int size) -
freeMemoryUncollectable
public static final long freeMemoryUncollectable(long address) -
registerDisappearingLink
-
unregisterDisappearingLink
public static void unregisterDisappearingLink(long address) -
malloc
public static final long malloc(int size) -
free
public static final void free(long address) -
allocateObject
-
newDirectByteBuffer
-
memcpy
public static final void memcpy(long s1, long s2, long n) -
memmove8
public static final void memmove8(long s1, long s2, long n) -
memmove16
public static final void memmove16(long s1, long s2, long n) -
memmove32
public static final void memmove32(long s1, long s2, long n) -
memmove64
public static final void memmove64(long s1, long s2, long n) -
memset
public static final void memset(long s, byte c, long n) -
getCallbackMethodImpl
-
bindBridgeMethod
-
isBridgeMethodBound
-
getObjectAddress
-
castAddressToObject
-
getFieldAddress
-
getInstanceFieldOffset
public static final int getInstanceFieldOffset(long field) -
getClassFieldAddress
public static final long getClassFieldAddress(long field) -
getObject
-
getDouble
public static final double getDouble(long address) -
getFloat
public static final float getFloat(long address) -
getLong
public static final long getLong(long address) -
getInt
public static final int getInt(long address) -
getChar
public static final char getChar(long address) -
getShort
public static final short getShort(long address) -
getByte
public static final byte getByte(long address) -
getBoolean
public static final boolean getBoolean(long address) -
setObject
-
setDouble
public static final void setDouble(long address, double value) -
setFloat
public static final void setFloat(long address, float value) -
setLong
public static final void setLong(long address, long value) -
setInt
public static final void setInt(long address, int value) -
setChar
public static final void setChar(long address, char value) -
setShort
public static final void setShort(long address, short value) -
setByte
public static final void setByte(long address, byte value) -
setBoolean
public static final void setBoolean(long address, boolean value) -
getPointer
public static final long getPointer(long address) -
setPointer
public static final void setPointer(long address, long value) -
getStringUTFChars
-
newStringUTF
-
newStringNoCopy
-
getArrayValuesAddress
-
newBooleanArray
public static final boolean[] newBooleanArray(long address, int size) -
newByteArray
public static final byte[] newByteArray(long address, int size) -
newCharArray
public static final char[] newCharArray(long address, int size) -
newShortArray
public static final short[] newShortArray(long address, int size) -
newIntArray
public static final int[] newIntArray(long address, int size) -
newLongArray
public static final long[] newLongArray(long address, int size) -
newFloatArray
public static final float[] newFloatArray(long address, int size) -
newDoubleArray
public static final double[] newDoubleArray(long address, int size)
-