|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object joeq.Allocator.CodeAllocator
public abstract class CodeAllocator
This class provides the abstract interface for code allocators. A code allocator handles the allocation and management of code buffers. It also provides static methods for keeping track of the compiled methods and their address ranges. It also includes an inner class that provides the interface for code buffers.
Nested Class Summary | |
---|---|
static class |
CodeAllocator.InstructionPointer
An object of this class represents a code address. |
static class |
CodeAllocator.x86CodeBuffer
This class provides the interface for x86 code buffers. |
Field Summary | |
---|---|
static jq_Class |
_class
|
static jq_StaticField |
_compiledMethods
|
static jq_StaticField |
_highAddress
|
static jq_StaticField |
_lowAddress
|
static SortedMap |
compiledMethods
Map of compiled methods, sorted by address. |
static boolean |
TRACE
Trace flag. |
Constructor Summary | |
---|---|
CodeAllocator()
|
Method Summary | |
---|---|
abstract CodeAllocator.x86CodeBuffer |
getCodeBuffer(int estimatedSize,
int offset,
int alignment)
Allocate a code buffer of the given estimated size, such that the given offset will have the given alignment. |
static jq_CompiledCode |
getCodeContaining(CodeAddress ip)
Return the compiled code which contains the given code address. |
static Iterator |
getCompiledMethods()
Returns an iterator of the registered jq_CompiledCode objects, in address order. |
static CodeAddress |
getHighAddress()
Returns the highest address of any registered code. |
static CodeAddress |
getLowAddress()
Returns the lowest address of any registered code. |
static int |
getNumberOfCompiledMethods()
Returns the number of registered jq_CompiledCode objects. |
abstract void |
init()
Initialize this code allocator. |
static void |
initializeCompiledMethodMap()
|
abstract void |
patchAbsolute(Address addr1,
Address addr2)
Patch the given address to refer to the other given address, in absolute terms. |
abstract void |
patchRelativeOffset(CodeAddress code,
CodeAddress target)
Patch the given code address to refer to the given code address, in relative terms. |
static void |
registerCode(jq_CompiledCode cc)
Register the given compiled code, so lookups by address will return this code. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean TRACE
public static final SortedMap compiledMethods
public static final jq_Class _class
public static final jq_StaticField _lowAddress
public static final jq_StaticField _highAddress
public static final jq_StaticField _compiledMethods
Constructor Detail |
---|
public CodeAllocator()
Method Detail |
---|
public abstract void init()
public abstract CodeAllocator.x86CodeBuffer getCodeBuffer(int estimatedSize, int offset, int alignment)
estimatedSize
- estimated size, in bytes, of desired code bufferoffset
- desired offset to align toalignment
- desired alignment, or 0 if don't care
public abstract void patchAbsolute(Address addr1, Address addr2)
addr1
- address to patchaddr2
- address to patch topublic abstract void patchRelativeOffset(CodeAddress code, CodeAddress target)
code
- code address to patchtarget
- code address to patch topublic static void initializeCompiledMethodMap()
public static void registerCode(jq_CompiledCode cc)
cc
- compiled code to registerpublic static jq_CompiledCode getCodeContaining(CodeAddress ip)
ip
- code address to check
public static CodeAddress getLowAddress()
public static CodeAddress getHighAddress()
public static Iterator getCompiledMethods()
public static int getNumberOfCompiledMethods()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |