joeq.Allocator
Class RuntimeCodeAllocator
java.lang.Object
joeq.Allocator.CodeAllocator
joeq.Allocator.RuntimeCodeAllocator
public class RuntimeCodeAllocator
- extends CodeAllocator
RuntimeCodeAllocator
- Version:
- $Id: RuntimeCodeAllocator.java,v 1.22 2004/09/30 03:35:30 joewhaley Exp $
- Author:
- John Whaley
Field Summary |
static int |
BLOCK_SIZE
Size of blocks allocated from the OS. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BLOCK_SIZE
public static final int BLOCK_SIZE
- Size of blocks allocated from the OS.
- See Also:
- Constant Field Values
RuntimeCodeAllocator
public RuntimeCodeAllocator()
init
public void init()
throws OutOfMemoryError
- Description copied from class:
CodeAllocator
- Initialize this code allocator. This method is always called before the
code allocator is actually used.
- Specified by:
init
in class CodeAllocator
- Throws:
OutOfMemoryError
getCodeBuffer
public 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.
It is legal for code to exceed the estimated size, but the cost may be
high (i.e. it may require recopying of the buffer.)
- Specified by:
getCodeBuffer
in class CodeAllocator
- Parameters:
estimatedSize
- estimated size, in bytes, of desired code bufferoffset
- desired offset to align toalignment
- desired alignment, or 0 if don't care
- Returns:
- the new code buffer
patchAbsolute
public void patchAbsolute(Address addr1,
Address addr2)
- Description copied from class:
CodeAllocator
- Patch the given address to refer to the other given address, in
absolute terms. This is used to patch heap address references in the
code, and code references in the heap.
- Specified by:
patchAbsolute
in class CodeAllocator
- Parameters:
addr1
- address to patchaddr2
- address to patch to
patchRelativeOffset
public void patchRelativeOffset(CodeAddress code,
CodeAddress target)
- Description copied from class:
CodeAllocator
- Patch the given code address to refer to the given code address, in
relative terms. This is used to patch branch targets in the code.
- Specified by:
patchRelativeOffset
in class CodeAllocator
- Parameters:
code
- code address to patchtarget
- code address to patch to
endian2
public static short endian2(int k)
Copyright © 2001-2005 John Whaley. All Rights Reserved.