|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object joeq.Allocator.HeapAllocator
public abstract class HeapAllocator
HeapAllocator
Nested Class Summary | |
---|---|
static class |
HeapAllocator.HeapPointer
An object of this class represents a pointer to a heap address. |
Field Summary | |
---|---|
static jq_Class |
_class
|
static jq_StaticMethod |
_clsinitAndAllocateObject
|
static jq_StaticField |
_data_segment_end
|
static jq_StaticField |
_data_segment_start
|
static HeapAddress |
data_segment_end
|
static HeapAddress |
data_segment_start
|
static boolean |
TRACE
|
Constructor Summary | |
---|---|
HeapAllocator()
|
Method Summary | |
---|---|
abstract Object |
allocateArray(int length,
int size,
Object vtable)
Allocate an array with the default alignment. |
abstract Object |
allocateArrayAlign8(int length,
int size,
Object vtable)
Allocate an array such that the elements are 8-byte aligned. |
abstract Object |
allocateObject(int size,
Object vtable)
Allocate an object with the default alignment. |
abstract Object |
allocateObjectAlign8(int size,
Object vtable)
Allocate an object such that the first field is 8-byte aligned. |
static boolean |
checkObjectReferences(Object o,
int depth)
Check if the object references are legal up to a given depth. |
static Object |
clone(Object o)
Clone the given object. |
static Object |
clsinitAndAllocateObject(jq_Type t)
Initialize class t and return a new uninitialized object of that type. |
abstract void |
collect()
Initiate a garbage collection. |
abstract int |
freeMemory()
Returns an estimate of the amount of free memory available. |
static boolean |
getGCBit(Object o)
|
static int[] |
getScalarObjectReferenceOffsets(Object o)
|
abstract void |
init()
Perform initialization for this allocator. |
static void |
initializeDataSegment()
|
static boolean |
isInDataSegment(Address a)
|
abstract boolean |
isInHeap(Address a)
Returns whether the given address falls within the boundaries of this heap. |
static boolean |
isObjectAssignableType(Address a,
jq_Reference t)
Return true if the given address is null or looks like it points to an object whose type is assignable to the given reference type. |
static boolean |
isObjectExactType(Address a,
jq_Reference t)
Return true if the given address looks like it points to an object whose type is exactly the given reference type. |
static boolean |
isValidArray(Address a)
Returns true if the given address looks like it points to an array. |
static boolean |
isValidArray(Address a,
int depth)
Returns true if the given address looks like it points to an array. |
static boolean |
isValidArrayType(Address typeAddress)
Given an address, return true if it looks like it points to a jq_Array object. |
static boolean |
isValidArrayVTable(Address a)
Return true if the given address looks like it points to a vtable for an array object. |
static boolean |
isValidHeapAddress(Address a)
|
static boolean |
isValidObject(Address a)
Returns true if the given address looks like it points to an object. |
static boolean |
isValidObject(Address a,
int depth)
Returns true if the given address looks like it points to an object. |
static boolean |
isValidReferenceType(Address typeAddress)
Given an address, return true if it looks like it points to a jq_Class or jq_Array object. |
static boolean |
isValidVTable(Address a)
Return true if the given address looks like it points to a vtable. |
static void |
outOfMemory()
Called in an out of memory situation. |
abstract void |
processObjectReference(Address a)
Process a reference to a heap object during garbage collection. |
abstract void |
processPossibleObjectReference(Address a)
Process a possible reference to a heap object during garbage collection. |
static void |
setGCBit(Object o,
boolean b)
|
abstract int |
totalMemory()
Returns an estimate of the total memory allocated (both used and unused). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean TRACE
public static HeapAddress data_segment_start
public static HeapAddress data_segment_end
public static final jq_Class _class
public static final jq_StaticMethod _clsinitAndAllocateObject
public static final jq_StaticField _data_segment_start
public static final jq_StaticField _data_segment_end
Constructor Detail |
---|
public HeapAllocator()
Method Detail |
---|
public abstract void init() throws OutOfMemoryError
OutOfMemoryError
- if there is not enough memory for initializationpublic abstract Object allocateObject(int size, Object vtable) throws OutOfMemoryError
size
- size of object to allocate (including object header), in bytesvtable
- vtable pointer for new object
OutOfMemoryError
- if there is insufficient memory to perform the operationpublic abstract Object allocateObjectAlign8(int size, Object vtable) throws OutOfMemoryError
size
- size of object to allocate (including object header), in bytesvtable
- vtable pointer for new object
OutOfMemoryError
- if there is insufficient memory to perform the operationpublic abstract Object allocateArray(int length, int size, Object vtable) throws OutOfMemoryError, NegativeArraySizeException
length
- length of new arraysize
- size of array to allocate (including array header), in bytesvtable
- vtable pointer for new array
NegativeArraySizeException
- if length is negative
OutOfMemoryError
- if there is insufficient memory to perform the operationpublic abstract Object allocateArrayAlign8(int length, int size, Object vtable) throws OutOfMemoryError, NegativeArraySizeException
length
- length of new arraysize
- size of array to allocate (including array header), in bytesvtable
- vtable pointer for new array
NegativeArraySizeException
- if length is negative
OutOfMemoryError
- if there is insufficient memory to perform the operationpublic abstract int freeMemory()
public abstract int totalMemory()
public abstract boolean isInHeap(Address a)
public abstract void collect()
public abstract void processObjectReference(Address a)
public abstract void processPossibleObjectReference(Address a)
public static Object clsinitAndAllocateObject(jq_Type t) throws VerifyError
t
- type to initialize and create object of
VerifyError
- if t is not a class typepublic static Object clone(Object o) throws OutOfMemoryError
o
- object to clone
OutOfMemoryError
- if there is not enough memory to perform operationpublic static void outOfMemory() throws OutOfMemoryError
OutOfMemoryError
- always thrownpublic static void initializeDataSegment()
public static final boolean isInDataSegment(Address a)
public static boolean isValidHeapAddress(Address a)
public static boolean getGCBit(Object o)
public static void setGCBit(Object o, boolean b)
public static int[] getScalarObjectReferenceOffsets(Object o)
public static boolean checkObjectReferences(Object o, int depth)
o
- depth
-
public static boolean isValidObject(Address a)
a
-
public static boolean isValidObject(Address a, int depth)
a
- depth
-
public static boolean isValidArray(Address a)
a
-
public static boolean isValidArray(Address a, int depth)
a
- depth
-
public static boolean isValidVTable(Address a)
a
-
public static boolean isValidArrayVTable(Address a)
a
-
public static boolean isObjectExactType(Address a, jq_Reference t)
a
- t
-
public static boolean isObjectAssignableType(Address a, jq_Reference t)
a
- t
-
public static boolean isValidReferenceType(Address typeAddress)
typeAddress
-
public static boolean isValidArrayType(Address typeAddress)
typeAddress
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |