Bootstrap
Class BootstrapCodeAllocator

java.lang.Object
Allocator.CodeAllocator
Bootstrap.BootstrapCodeAllocator
- public class BootstrapCodeAllocator
- extends Allocator.CodeAllocator
BootstrapCodeAllocator
- Version:
- $Id: BootstrapCodeAllocator.java,v 1.13 2003/05/12 10:04:52 joewhaley Exp $
Nested classes inherited from class Allocator.CodeAllocator |
Allocator.CodeAllocator.InstructionPointer, Allocator.CodeAllocator.x86CodeBuffer |
Method Summary |
void |
dump(java.io.DataOutput out)
|
void |
ensureCapacity(int size)
|
java.util.List |
getAllCodeRelocs()
|
java.util.List |
getAllDataRelocs()
|
Allocator.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. |
void |
init()
Initialize this code allocator. |
void |
patchAbsolute(Memory.Address code,
Memory.Address heap)
Patch the given address to refer to the other given address, in
absolute terms. |
void |
patchRelativeOffset(Memory.CodeAddress code,
Memory.CodeAddress target)
Patch the given code address to refer to the given code address, in
relative terms. |
Memory.Address |
peek(Memory.CodeAddress k)
|
byte |
peek1(Memory.CodeAddress k)
|
short |
peek2(Memory.CodeAddress k)
|
int |
peek4(Memory.CodeAddress k)
|
long |
peek8(Memory.CodeAddress k)
|
void |
poke(Memory.CodeAddress k,
Memory.Address v)
|
void |
poke1(Memory.CodeAddress k,
byte v)
|
void |
poke2(Memory.CodeAddress k,
short v)
|
void |
poke4(Memory.CodeAddress k,
int v)
|
void |
poke8(Memory.CodeAddress k,
long v)
|
int |
size()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT
public static final BootstrapCodeAllocator DEFAULT
bundle_shift
private static final int bundle_shift
- See Also:
- Constant Field Values
bundle_size
private static final int bundle_size
- See Also:
- Constant Field Values
bundle_mask
private static final int bundle_mask
- See Also:
- Constant Field Values
bundles
private java.util.Vector bundles
current_bundle
private byte[] current_bundle
bundle_idx
private int bundle_idx
idx
private int idx
all_code_relocs
private java.util.List all_code_relocs
all_data_relocs
private java.util.List all_data_relocs
BootstrapCodeAllocator
public BootstrapCodeAllocator()
- Creates new BootstrapCodeAllocator
init
public void init()
- Description copied from class:
Allocator.CodeAllocator
- Initialize this code allocator. This method is always called before the
code allocator is actually used.
getCodeBuffer
public Allocator.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.
In this allocator, the memory is allocated in chunks, so exceeding the
estimated size doesn't cost extra.
size
public int size()
ensureCapacity
public void ensureCapacity(int size)
getAllCodeRelocs
public java.util.List getAllCodeRelocs()
getAllDataRelocs
public java.util.List getAllDataRelocs()
dump
public void dump(java.io.DataOutput out)
throws java.io.IOException
patchAbsolute
public void patchAbsolute(Memory.Address code,
Memory.Address heap)
- Description copied from class:
Allocator.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.
patchRelativeOffset
public void patchRelativeOffset(Memory.CodeAddress code,
Memory.CodeAddress target)
- Description copied from class:
Allocator.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.
poke
public void poke(Memory.CodeAddress k,
Memory.Address v)
poke1
public void poke1(Memory.CodeAddress k,
byte v)
poke2
public void poke2(Memory.CodeAddress k,
short v)
poke4
public void poke4(Memory.CodeAddress k,
int v)
poke8
public void poke8(Memory.CodeAddress k,
long v)
peek
public Memory.Address peek(Memory.CodeAddress k)
peek1
public byte peek1(Memory.CodeAddress k)
peek2
public short peek2(Memory.CodeAddress k)
peek4
public int peek4(Memory.CodeAddress k)
peek8
public long peek8(Memory.CodeAddress k)