|
Sun SPOT API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.squawk.NativeUnsafe
public final class NativeUnsafe
A collection of methods for performing peek and poke operations on memory addresses.
Only the public methods of this class which do not override any of the
methods in java.lang.Object will be available in a non-hosted
environment. The translator replaces any calls to these methods to native
method calls.
| Method Summary | |
|---|---|
static char |
charAt(String str,
int index)
Gets character from a string. |
static void |
clearObject(Object base,
int offset)
Clears a pointer value in memory. |
static void |
copyMemory(byte[] buffer,
int memoryOffset,
int bufferOffset,
int length)
Copies a range of memory into a buffer. |
static void |
copyTypes(Address src,
Address dst,
int length)
Block copies the types recorded for a range of memory to another range of memory. |
static Address |
getAddress(Object base,
int offset)
|
static int |
getAsByte(Object base,
int offset)
|
static int |
getAsInt(Object base,
int offset)
|
static int |
getAsShort(Object base,
int offset)
|
static UWord |
getAsUWord(Object base,
int offset)
|
static int |
getByte(Object base,
int offset)
|
static int |
getChar(Object base,
int offset)
|
static int |
getInt(Object base,
int offset)
|
static long |
getLong(Object base,
int offset)
|
static long |
getLongAtWord(Object base,
int offset)
|
static Object |
getObject(Object base,
int offset)
|
static int |
getShort(Object base,
int offset)
|
static byte |
getType(Address ea)
Gets the type of a value at a given address. |
static UWord |
getUWord(Object base,
int offset)
|
static void |
initialize(byte[] buffer,
BitSet oopMap,
boolean append)
Initialize or appends to the contents of memory. |
static void |
setAddress(Object base,
int offset,
Object value)
|
static void |
setArrayTypes(Address ea,
byte componentType,
int componentSize,
int length)
Sets the type of each value in an array. |
static void |
setByte(Object base,
int offset,
int value)
|
static void |
setChar(Object base,
int offset,
int value)
|
static void |
setInt(Object base,
int offset,
int value)
|
static void |
setLong(Object base,
int offset,
long value)
|
static void |
setLongAtWord(Object base,
int offset,
long value)
|
static void |
setMemorySize(int newSize)
Sets the size of used/initialized memory. |
static void |
setObject(Object base,
int offset,
Object value)
|
static void |
setShort(Object base,
int offset,
int value)
|
static void |
setType(Address ea,
byte type,
int size)
Sets the type of a value at a given address. |
static void |
setUWord(Object base,
int offset,
UWord value)
|
static void |
swap(Address address,
int dataSize)
Swaps the endianess of a value. |
static void |
swap2(Address address)
Swaps the endianess of a 2 byte value. |
static void |
swap4(Address address)
Swaps the endianess of a 4 byte value. |
static void |
swap8(Address address)
Swaps the endianess of a 8 byte value. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void setByte(Object base,
int offset,
int value)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.setByte(java.lang.Object, int, int)
public static void setShort(Object base,
int offset,
int value)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.setShort(java.lang.Object, int, int)
public static void setChar(Object base,
int offset,
int value)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.setChar(java.lang.Object, int, int)
public static void setInt(Object base,
int offset,
int value)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.setInt(java.lang.Object, int, int)
public static void setUWord(Object base,
int offset,
UWord value)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.setUWord(java.lang.Object, int, com.sun.squawk.UWord)
public static void setLong(Object base,
int offset,
long value)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.setLong(java.lang.Object, int, long)
public static void setLongAtWord(Object base,
int offset,
long value)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.setLongAtWord(java.lang.Object, int, long)
public static void setAddress(Object base,
int offset,
Object value)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.setAddress(java.lang.Object, int, java.lang.Object)
public static void setObject(Object base,
int offset,
Object value)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.setObject(java.lang.Object, int, java.lang.Object)
public static void setType(Address ea,
byte type,
int size)
throws com.sun.squawk.pragma.NativePragma
VM.usingTypeMap() returns false.
ea - the address of the valuetype - the type of the valuesize - the size (in bytes) of the value
com.sun.squawk.pragma.NativePragma
public static void setArrayTypes(Address ea,
byte componentType,
int componentSize,
int length)
throws com.sun.squawk.pragma.NativePragma
VM.usingTypeMap() returns false.
ea - the address of an arraycomponentType - the component type of the arraycomponentSize - the size (in bytes) of componentTypelength - the length of the array
com.sun.squawk.pragma.NativePragma
public static byte getType(Address ea)
throws com.sun.squawk.pragma.NativePragma
VM.usingTypeMap() returns false.
ea - the address to query
ea
com.sun.squawk.pragma.NativePragma
public static void copyTypes(Address src,
Address dst,
int length)
throws com.sun.squawk.pragma.NativePragma
src - the start address of the source rangedst - the start address of the destination rangelength - the length (in bytes) of the range
com.sun.squawk.pragma.NativePragma
public static int getByte(Object base,
int offset)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.getByte(java.lang.Object, int)
public static int getShort(Object base,
int offset)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.getShort(java.lang.Object, int)
public static int getChar(Object base,
int offset)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.getChar(java.lang.Object, int)
public static int getInt(Object base,
int offset)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.getInt(java.lang.Object, int)
public static UWord getUWord(Object base,
int offset)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.getUWord(java.lang.Object, int)
public static long getLong(Object base,
int offset)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.getLong(java.lang.Object, int)
public static long getLongAtWord(Object base,
int offset)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.getLongAtWord(java.lang.Object, int)
public static Object getObject(Object base,
int offset)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.getObject(java.lang.Object, int)
public static Address getAddress(Object base,
int offset)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.getAddress(java.lang.Object, int)
public static UWord getAsUWord(Object base,
int offset)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.getAsUWord(java.lang.Object, int)
public static int getAsByte(Object base,
int offset)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.getAsByte(java.lang.Object, int)
public static int getAsShort(Object base,
int offset)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.getAsShort(java.lang.Object, int)
public static int getAsInt(Object base,
int offset)
throws com.sun.squawk.pragma.NativePragma
com.sun.squawk.pragma.NativePragmaUnsafe.getAsInt(java.lang.Object, int)
public static char charAt(String str,
int index)
throws com.sun.squawk.pragma.NativePragma
str - the stringindex - the index to the character
com.sun.squawk.pragma.NativePragma
public static void swap(Address address,
int dataSize)
throws com.sun.squawk.pragma.NativePragma
address - the address of the valuedataSize - the size (in bytes) of the value
com.sun.squawk.pragma.NativePragma
public static void swap2(Address address)
throws com.sun.squawk.pragma.NativePragma
address - the address of the value
com.sun.squawk.pragma.NativePragma
public static void swap4(Address address)
throws com.sun.squawk.pragma.NativePragma
address - the address of the value
com.sun.squawk.pragma.NativePragma
public static void swap8(Address address)
throws com.sun.squawk.pragma.NativePragma
address - the address of the value
com.sun.squawk.pragma.NativePragma
public static void clearObject(Object base,
int offset)
throws com.sun.squawk.pragma.HostedPragma
base - the base addressoffset - the offset (in UWords) from base of the pointer to clear
com.sun.squawk.pragma.HostedPragma
public static void initialize(byte[] buffer,
BitSet oopMap,
boolean append)
throws com.sun.squawk.pragma.HostedPragma
buffer - a buffer containing a serialized object memory relative to 0oopMap - an oop map specifying where the pointers in the serialized object memory areappend - specifies if the memory is being appended to
com.sun.squawk.pragma.HostedPragma
public static void setMemorySize(int newSize)
throws com.sun.squawk.pragma.HostedPragma
newSize and greater are zeroed.
newSize - the new size of memory
com.sun.squawk.pragma.HostedPragma
public static void copyMemory(byte[] buffer,
int memoryOffset,
int bufferOffset,
int length)
throws com.sun.squawk.pragma.HostedPragma
buffer - the buffer to copy intomemoryOffset - the offset in memory at which to start copying frombufferOffset - the offset in buffer at which to start copying tolength - the number of bytes to copy
com.sun.squawk.pragma.HostedPragma
|
Sun SPOT API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||