Allocator
Class RuntimeCodeAllocator

java.lang.Object
Allocator.CodeAllocator
Allocator.RuntimeCodeAllocator
- public class RuntimeCodeAllocator
- extends CodeAllocator
RuntimeCodeAllocator
- Version:
- $Id: RuntimeCodeAllocator.java,v 1.19 2003/05/12 10:04:52 joewhaley Exp $
| 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
heapStart
private Memory.CodeAddress heapStart
- Pointers to the start, current, and end of the heap.
heapCurrent
private Memory.CodeAddress heapCurrent
- Pointers to the start, current, and end of the heap.
heapEnd
private Memory.CodeAddress heapEnd
- Pointers to the start, current, and end of the heap.
heapFirst
private Memory.CodeAddress heapFirst
- Pointer to the first block.
maxFreePrevious
private int maxFreePrevious
- Max memory free in all allocated blocks.
isGenerating
volatile boolean isGenerating
RuntimeCodeAllocator
public RuntimeCodeAllocator()
init
public void init()
throws java.lang.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
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
allocateNewBlock
private void allocateNewBlock(int blockSize)
throws java.lang.OutOfMemoryError
patchAbsolute
public void patchAbsolute(Memory.Address addr1,
Memory.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
patchRelativeOffset
public void patchRelativeOffset(Memory.CodeAddress code,
Memory.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
endian2
public static short endian2(int k)