public abstract class LIRGenerator extends Object implements LIRGeneratorTool
| Modifier and Type | Class and Description |
|---|---|
static class |
LIRGenerator.Options |
static class |
LIRGenerator.VariableProvider
Hide
LIRGenerator.VariableProvider.nextVariable() from other users. |
LIRGeneratorTool.BlockScope, LIRGeneratorTool.CharsetNameDiagnosticLIRGeneratorTool.ZapRegistersAfterInstruction, DiagnosticLIRGeneratorTool.ZapStackArgumentSpaceBeforeInstruction| Modifier and Type | Field and Description |
|---|---|
protected ArithmeticLIRGenerator |
arithmeticLIRGen |
| Constructor and Description |
|---|
LIRGenerator(LIRKindTool lirKindTool,
ArithmeticLIRGenerator arithmeticLIRGen,
MoveFactory moveFactory,
CodeGenProviders providers,
LIRGenerationResult res) |
| Modifier and Type | Method and Description |
|---|---|
<I extends LIRInstruction> |
append(I op) |
AllocatableValue |
asAllocatable(Value value)
Returns an
AllocatableValue holding the value by moving it if necessary. |
RegisterAttributes |
attributes(Register register) |
void |
beforeRegisterAllocation()
Called just before register allocation is performed on the LIR owned by this generator.
|
boolean |
canInlineConstant(Constant constant) |
LIRInstruction |
createBenchmarkCounter(String name,
String group,
Value increment) |
LIRInstruction |
createMultiBenchmarkCounter(String[] names,
String[] groups,
Value[] increments) |
abstract LIRInstruction |
createZapArgumentSpace(StackSlot[] zappedStack,
JavaConstant[] zapValues) |
LIRInstruction |
createZapRegisters()
Creates an instruction that fills all
allocatable registers with a known garbage value. |
LIRInstruction |
createZapRegisters(Register[] zappedRegisters)
Creates an instruction that fills a given set of registers with a
known garbage value. |
abstract LIRInstruction |
createZapRegisters(Register[] zappedRegisters,
JavaConstant[] zapValues)
Creates an instruction that fills a given set of registers with a known garbage value.
|
void |
emitBlackhole(Value operand) |
abstract void |
emitCompareBranch(PlatformKind cmpKind,
Value left,
Value right,
Condition cond,
boolean unorderedIsTrue,
LabelRef trueDestination,
LabelRef falseDestination,
double trueDestinationProbability) |
abstract Variable |
emitConditionalMove(PlatformKind cmpKind,
Value leftVal,
Value right,
Condition cond,
boolean unorderedIsTrue,
Value trueValue,
Value falseValue) |
Value |
emitConstant(LIRKind kind,
Constant constant) |
Variable |
emitForeignCall(ForeignCallLinkage linkage,
LIRFrameState frameState,
Value... args) |
protected abstract void |
emitForeignCallOp(ForeignCallLinkage linkage,
Value targetAddress,
Value result,
Value[] arguments,
Value[] temps,
LIRFrameState info)
Emits the single call operation at the heart of generating LIR for a
foreign call.
|
protected abstract void |
emitHashTableSwitch(JavaConstant[] keys,
LabelRef defaultTarget,
LabelRef[] targets,
AllocatableValue value,
Value hash) |
void |
emitIncomingValues(Value[] params) |
protected Value |
emitIndirectForeignCallAddress(ForeignCallLinkage linkage)
Loads the target address for indirect foreign calls.
|
abstract void |
emitIntegerTestBranch(Value left,
Value right,
LabelRef trueDestination,
LabelRef falseDestination,
double trueSuccessorProbability) |
abstract Variable |
emitIntegerTestMove(Value leftVal,
Value right,
Value trueValue,
Value falseValue) |
Value |
emitJavaConstant(JavaConstant constant) |
abstract void |
emitJump(LabelRef label) |
AllocatableValue |
emitLoadConstant(<any> kind,
Constant constant) |
void |
emitMove(AllocatableValue dst,
Value src) |
Variable |
emitMove(Value input) |
void |
emitMoveConstant(AllocatableValue dst,
Constant src) |
abstract void |
emitOverflowCheckBranch(LabelRef overflow,
LabelRef noOverflow,
LIRKind cmpKind,
double overflowProbability) |
protected abstract void |
emitRangeTableSwitch(int lowKey,
LabelRef defaultTarget,
LabelRef[] targets,
AllocatableValue key) |
Variable |
emitReadRegister(Register register,
<any> kind) |
void |
emitStrategySwitch(JavaConstant[] keyConstants,
double[] keyProbabilities,
LabelRef[] keyTargets,
LabelRef defaultTarget,
AllocatableValue value) |
abstract void |
emitStrategySwitch(SwitchStrategy strategy,
AllocatableValue key,
LabelRef[] keyTargets,
LabelRef defaultTarget) |
void |
emitWriteRegister(Register dst,
Value src,
<any> kind) |
protected LIRKind |
getAddressKind(Value base,
long displacement,
Value index) |
ArithmeticLIRGeneratorTool |
getArithmetic() |
LIRGeneratorTool.BlockScope |
getBlockScope(AbstractBlockBase<?> block) |
CodeCacheProvider |
getCodeCache() |
AbstractBlockBase<?> |
getCurrentBlock() |
ForeignCallsProvider |
getForeignCalls() |
LIRKind |
getLIRKind(Stamp stamp) |
LIRKindTool |
getLIRKindTool() |
DebugCloseable |
getMatchScope(AbstractBlockBase<?> block) |
MetaAccessProvider |
getMetaAccess() |
MoveFactory |
getMoveFactory() |
CodeGenProviders |
getProviders() |
RegisterConfig |
getRegisterConfig() |
LIRGenerationResult |
getResult() |
MoveFactory |
getSpillMoveFactory()
Get a special
MoveFactory for spill moves. |
LIRKind |
getValueKind(JavaKind javaKind) |
boolean |
hasBlockEnd(AbstractBlockBase<?> block) |
boolean |
mayEmbedConstantLoad(Constant constant) |
boolean |
needOnlyOopMaps()
Determines if only oop maps are required for the code generated from the LIR.
|
Variable |
newVariable(<any> valueKind)
Create a new
Variable. |
AllocatableValue |
resultOperandFor(JavaKind javaKind,
<any> valueKind)
Gets the ABI specific operand used to return a value of a given kind from a method.
|
void |
setSourcePosition(NodeSourcePosition position) |
TargetDescription |
target() |
LIRInstruction |
zapArgumentSpace() |
protected abstract JavaConstant |
zapValueForKind(PlatformKind kind)
Gets a garbage value for a given kind.
|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddressAsAllocatableInteger, allocateStackMemory, emitAddress, emitArrayCompareTo, emitArrayCopyWithConversion, emitArrayCopyWithConversion, emitArrayEquals, emitArrayEquals, emitArrayEquals, emitArrayEquals, emitArrayEquals, emitArrayEquals, emitArrayIndexOf, emitArrayRegionCompareTo, emitArrayRegionCompareTo, emitAtomicReadAndAdd, emitAtomicReadAndWrite, emitByteSwap, emitCacheWriteback, emitCacheWritebackSync, emitCalcStringAttributes, emitCompress, emitConvertNullToZero, emitConvertNullToZero, emitConvertZeroToNull, emitDeoptimize, emitEncodeArray, emitHasNegatives, emitLogicCompareAndSwap, emitMembar, emitNullCheck, emitPause, emitPrefetchAllocate, emitReadCallerStackPointer, emitReadReturnAddress, emitReturn, emitSpeculationFence, emitStringLatin1Inflate, emitStringUTF16Compress, emitTimeStampWithProcid, emitUncompress, emitUnwind, emitValueCompareAndSwap, emitZeroMemory, getMaxVectorSize, toRegisterKindprotected final ArithmeticLIRGenerator arithmeticLIRGen
public LIRGenerator(LIRKindTool lirKindTool, ArithmeticLIRGenerator arithmeticLIRGen, MoveFactory moveFactory, CodeGenProviders providers, LIRGenerationResult res)
public ArithmeticLIRGeneratorTool getArithmetic()
getArithmetic in interface LIRGeneratorToolpublic MoveFactory getMoveFactory()
getMoveFactory in interface LIRGeneratorToolpublic MoveFactory getSpillMoveFactory()
LIRGeneratorToolMoveFactory for spill moves.
The instructions returned by this factory must only depend on the input values. References to
values that require interaction with register allocation are strictly forbidden.getSpillMoveFactory in interface LIRGeneratorToolpublic LIRKind getValueKind(JavaKind javaKind)
public TargetDescription target()
target in interface LIRGeneratorToolpublic CodeGenProviders getProviders()
getProviders in interface LIRGeneratorToolpublic MetaAccessProvider getMetaAccess()
getMetaAccess in interface LIRGeneratorToolpublic CodeCacheProvider getCodeCache()
getCodeCache in interface LIRGeneratorToolpublic ForeignCallsProvider getForeignCalls()
getForeignCalls in interface LIRGeneratorToolpublic LIRKindTool getLIRKindTool()
public Variable newVariable(<any> valueKind)
LIRGeneratorToolVariable.newVariable in interface LIRGeneratorToolvalueKind - The type of the value that will be stored in this Variable. See
LIRKind for documentation on what to pass here. Note that in most cases,
simply passing Value.getValueKind() is wrong.Variable.public RegisterConfig getRegisterConfig()
getRegisterConfig in interface LIRGeneratorToolpublic RegisterAttributes attributes(Register register)
public Variable emitMove(Value input)
emitMove in interface LIRGeneratorToolpublic void emitMove(AllocatableValue dst,
Value src)
emitMove in interface LIRGeneratorToolpublic Variable emitReadRegister(Register register, <any> kind)
emitReadRegister in interface LIRGeneratorToolpublic void emitWriteRegister(Register dst,
Value src,
<any> kind)
emitWriteRegister in interface LIRGeneratorToolpublic void emitMoveConstant(AllocatableValue dst,
Constant src)
emitMoveConstant in interface LIRGeneratorToolpublic boolean canInlineConstant(Constant constant)
canInlineConstant in interface LIRGeneratorToolpublic boolean mayEmbedConstantLoad(Constant constant)
mayEmbedConstantLoad in interface LIRGeneratorToolpublic Value emitConstant(LIRKind kind, Constant constant)
emitConstant in interface LIRGeneratorToolpublic Value emitJavaConstant(JavaConstant constant)
emitJavaConstant in interface LIRGeneratorToolpublic AllocatableValue emitLoadConstant(<any> kind,
Constant constant)
emitLoadConstant in interface LIRGeneratorToolpublic AllocatableValue asAllocatable(Value value)
LIRGeneratorToolAllocatableValue holding the value by moving it if necessary. If
value is already an AllocatableValue, returns it unchanged.asAllocatable in interface LIRGeneratorToolpublic boolean needOnlyOopMaps()
public AllocatableValue resultOperandFor(JavaKind javaKind,
<any> valueKind)
javaKind - the kind of value being returnedvalueKind - the backend type of the value being returnedkindpublic void setSourcePosition(NodeSourcePosition position)
public <I extends LIRInstruction> I append(I op)
append in interface LIRGeneratorToolpublic boolean hasBlockEnd(AbstractBlockBase<?> block)
public final LIRGeneratorTool.BlockScope getBlockScope(AbstractBlockBase<?> block)
public final DebugCloseable getMatchScope(AbstractBlockBase<?> block)
public void emitIncomingValues(Value[] params)
public abstract void emitJump(LabelRef label)
emitJump in interface LIRGeneratorToolpublic abstract void emitCompareBranch(PlatformKind cmpKind,
Value left,
Value right,
Condition cond,
boolean unorderedIsTrue,
LabelRef trueDestination,
LabelRef falseDestination,
double trueDestinationProbability)
public abstract void emitOverflowCheckBranch(LabelRef overflow, LabelRef noOverflow, LIRKind cmpKind, double overflowProbability)
public abstract void emitIntegerTestBranch(Value left,
Value right,
LabelRef trueDestination,
LabelRef falseDestination,
double trueSuccessorProbability)
public abstract Variable emitConditionalMove(PlatformKind cmpKind, Value leftVal, Value right, Condition cond, boolean unorderedIsTrue, Value trueValue, Value falseValue)
emitConditionalMove in interface LIRGeneratorToolpublic abstract Variable emitIntegerTestMove(Value leftVal, Value right, Value trueValue, Value falseValue)
emitIntegerTestMove in interface LIRGeneratorToolprotected Value emitIndirectForeignCallAddress(ForeignCallLinkage linkage)
protected abstract void emitForeignCallOp(ForeignCallLinkage linkage, Value targetAddress, Value result, Value[] arguments, Value[] temps, LIRFrameState info)
public Variable emitForeignCall(ForeignCallLinkage linkage, LIRFrameState frameState, Value... args)
emitForeignCall in interface LIRGeneratorToolpublic void emitStrategySwitch(JavaConstant[] keyConstants,
double[] keyProbabilities,
LabelRef[] keyTargets,
LabelRef defaultTarget,
AllocatableValue value)
public abstract void emitStrategySwitch(SwitchStrategy strategy, AllocatableValue key, LabelRef[] keyTargets, LabelRef defaultTarget)
protected abstract void emitRangeTableSwitch(int lowKey,
LabelRef defaultTarget,
LabelRef[] targets,
AllocatableValue key)
protected abstract void emitHashTableSwitch(JavaConstant[] keys,
LabelRef defaultTarget,
LabelRef[] targets,
AllocatableValue value,
Value hash)
public void beforeRegisterAllocation()
protected abstract JavaConstant zapValueForKind(PlatformKind kind)
public LIRKind getLIRKind(Stamp stamp)
getLIRKind in interface LIRGeneratorToolprotected LIRKind getAddressKind(Value base, long displacement, Value index)
public AbstractBlockBase<?> getCurrentBlock()
getCurrentBlock in interface LIRGeneratorToolpublic LIRGenerationResult getResult()
getResult in interface LIRGeneratorToolpublic void emitBlackhole(Value operand)
emitBlackhole in interface LIRGeneratorToolpublic LIRInstruction createBenchmarkCounter(String name, String group, Value increment)
createBenchmarkCounter in interface DiagnosticLIRGeneratorToolpublic LIRInstruction createMultiBenchmarkCounter(String[] names, String[] groups, Value[] increments)
createMultiBenchmarkCounter in interface DiagnosticLIRGeneratorToolpublic abstract LIRInstruction createZapRegisters(Register[] zappedRegisters, JavaConstant[] zapValues)
DiagnosticLIRGeneratorToolcreateZapRegisters in interface DiagnosticLIRGeneratorToolzappedRegisters - registers to be zappedzapValues - values used for zappingDiagnosticLIRGeneratorTool.createZapRegisters()public LIRInstruction createZapRegisters()
DiagnosticLIRGeneratorToolallocatable registers with a known garbage value.createZapRegisters in interface DiagnosticLIRGeneratorToolDiagnosticLIRGeneratorTool.createZapRegisters(Register[], JavaConstant[])public LIRInstruction createZapRegisters(Register[] zappedRegisters)
DiagnosticLIRGeneratorToolknown garbage value.createZapRegisters in interface DiagnosticLIRGeneratorToolzappedRegisters - registers to be zappedDiagnosticLIRGeneratorTool.createZapRegisters()public abstract LIRInstruction createZapArgumentSpace(StackSlot[] zappedStack, JavaConstant[] zapValues)
createZapArgumentSpace in interface DiagnosticLIRGeneratorToolpublic LIRInstruction zapArgumentSpace()
zapArgumentSpace in interface DiagnosticLIRGeneratorTool