public class CompilationResultBuilder extends Object
CompilationResult
as its code is being assembled.CompilationResultBuilderFactory
Modifier and Type | Class and Description |
---|---|
private static class |
CompilationResultBuilder.ExceptionInfo |
Modifier and Type | Field and Description |
---|---|
private Consumer<LIRInstruction> |
afterOp |
Assembler |
asm |
private Consumer<LIRInstruction> |
beforeOp |
CodeCacheProvider |
codeCache |
CompilationResult |
compilationResult |
private int |
currentBlockIndex
The index of the block currently being emitted.
|
private IdentityHashMap<Constant,DataSection.Data> |
dataCache |
private List<CompilationResultBuilder.ExceptionInfo> |
exceptionInfoList |
ForeignCallsProvider |
foreignCalls |
FrameContext |
frameContext
The object that emits code for managing a method's frame.
|
FrameMap |
frameMap |
private LIR |
lir
The LIR for which code is being generated.
|
static OptionValue<Boolean> |
PrintLIRWithAssembly |
TargetDescription |
target |
Constructor and Description |
---|
CompilationResultBuilder(CodeCacheProvider codeCache,
ForeignCallsProvider foreignCalls,
FrameMap frameMap,
Assembler asm,
FrameContext frameContext,
CompilationResult compilationResult) |
Modifier and Type | Method and Description |
---|---|
AbstractAddress |
asAddress(Value value) |
AbstractAddress |
asByteAddr(Value value) |
AbstractAddress |
asDoubleAddr(Value value) |
double |
asDoubleConst(Value value)
Returns the double value of any constant that can be represented by a 64-bit float value.
|
AbstractAddress |
asDoubleConstRef(Value value)
Returns the address of a double constant that is embedded as a data reference into the code.
|
AbstractAddress |
asDoubleConstRef(Value value,
int alignment) |
AbstractAddress |
asFloatAddr(Value value) |
float |
asFloatConst(Value value)
Returns the float value of any constant that can be represented by a 32-bit float value.
|
AbstractAddress |
asFloatConstRef(Value value)
Returns the address of a float constant that is embedded as a data reference into the code.
|
AbstractAddress |
asFloatConstRef(Value value,
int alignment) |
AbstractAddress |
asIntAddr(Value value) |
int |
asIntConst(Value value)
Returns the integer value of any constant that can be represented by a 32-bit integer value,
including long constants that fit into the 32-bit range.
|
AbstractAddress |
asLongAddr(Value value) |
long |
asLongConst(Value value)
Returns the long value of any constant that can be represented by a 64-bit long value.
|
AbstractAddress |
asLongConstRef(Value value)
Returns the address of a long constant that is embedded as a data reference into the code.
|
AbstractAddress |
asObjectAddr(Value value) |
AbstractAddress |
asObjectConstRef(Value value)
Returns the address of an object constant that is embedded as a data reference into the code.
|
AbstractAddress |
asShortAddr(Value value) |
void |
blockComment(String s) |
void |
emit(LIR lir)
Emits code for
lir in its code emitting order. |
private void |
emitBlock(AbstractBlockBase<?> block) |
private static void |
emitOp(CompilationResultBuilder crb,
LIRInstruction op) |
void |
finish()
Sets the code and
exception handler fields of
the compilation result.
|
boolean |
isSuccessorEdge(LabelRef edge)
Determines if a given edge from the block currently being emitted goes to its lexical
successor.
|
AbstractAddress |
recordDataReferenceInCode(byte[] data,
int alignment) |
AbstractAddress |
recordDataReferenceInCode(Constant constant,
int alignment) |
private AbstractAddress |
recordDataSectionReference(DataSection.Data data) |
void |
recordDirectCall(int posBefore,
int posAfter,
InvokeTarget callTarget,
LIRFrameState info) |
void |
recordExceptionHandlers(int pcOffset,
LIRFrameState info) |
void |
recordImplicitException(int pcOffset,
LIRFrameState info) |
void |
recordIndirectCall(int posBefore,
int posAfter,
InvokeTarget callTarget,
LIRFrameState info) |
void |
recordInfopoint(int pos,
DebugInfo debugInfo,
InfopointReason reason) |
void |
recordInfopoint(int pos,
LIRFrameState info,
InfopointReason reason) |
void |
recordInlineDataInCode(Constant data) |
CompilationResult.Mark |
recordMark(Object id) |
void |
reset() |
void |
setOpCallback(Consumer<LIRInstruction> beforeOp,
Consumer<LIRInstruction> afterOp) |
void |
setTotalFrameSize(int frameSize) |
public static final OptionValue<Boolean> PrintLIRWithAssembly
public final CompilationResult compilationResult
public final TargetDescription target
public final CodeCacheProvider codeCache
public final ForeignCallsProvider foreignCalls
private int currentBlockIndex
public final FrameContext frameContext
private List<CompilationResultBuilder.ExceptionInfo> exceptionInfoList
private final IdentityHashMap<Constant,DataSection.Data> dataCache
private Consumer<LIRInstruction> beforeOp
private Consumer<LIRInstruction> afterOp
public CompilationResultBuilder(CodeCacheProvider codeCache, ForeignCallsProvider foreignCalls, FrameMap frameMap, Assembler asm, FrameContext frameContext, CompilationResult compilationResult)
public void setTotalFrameSize(int frameSize)
public CompilationResult.Mark recordMark(Object id)
public void blockComment(String s)
public void finish()
public void recordExceptionHandlers(int pcOffset, LIRFrameState info)
public void recordImplicitException(int pcOffset, LIRFrameState info)
public void recordDirectCall(int posBefore, int posAfter, InvokeTarget callTarget, LIRFrameState info)
public void recordIndirectCall(int posBefore, int posAfter, InvokeTarget callTarget, LIRFrameState info)
public void recordInfopoint(int pos, LIRFrameState info, InfopointReason reason)
public void recordInfopoint(int pos, DebugInfo debugInfo, InfopointReason reason)
public void recordInlineDataInCode(Constant data)
private AbstractAddress recordDataSectionReference(DataSection.Data data)
public AbstractAddress recordDataReferenceInCode(Constant constant, int alignment)
public AbstractAddress recordDataReferenceInCode(byte[] data, int alignment)
public int asIntConst(Value value)
public float asFloatConst(Value value)
public long asLongConst(Value value)
public double asDoubleConst(Value value)
public AbstractAddress asFloatConstRef(Value value)
public AbstractAddress asFloatConstRef(Value value, int alignment)
public AbstractAddress asDoubleConstRef(Value value)
public AbstractAddress asDoubleConstRef(Value value, int alignment)
public AbstractAddress asLongConstRef(Value value)
public AbstractAddress asObjectConstRef(Value value)
public AbstractAddress asByteAddr(Value value)
public AbstractAddress asShortAddr(Value value)
public AbstractAddress asIntAddr(Value value)
public AbstractAddress asLongAddr(Value value)
public AbstractAddress asObjectAddr(Value value)
public AbstractAddress asFloatAddr(Value value)
public AbstractAddress asDoubleAddr(Value value)
public AbstractAddress asAddress(Value value)
public boolean isSuccessorEdge(LabelRef edge)
public void emit(LIR lir)
lir
in its code emitting order.private void emitBlock(AbstractBlockBase<?> block)
private static void emitOp(CompilationResultBuilder crb, LIRInstruction op)
public void reset()
public void setOpCallback(Consumer<LIRInstruction> beforeOp, Consumer<LIRInstruction> afterOp)