public abstract class LIRGenerator extends Object implements LIRGeneratorTool
| Modifier and Type | Class and Description |
|---|---|
private class |
LIRGenerator.BlockScopeImpl |
static class |
LIRGenerator.Options |
LIRGeneratorTool.BlockScope, LIRGeneratorTool.SpillMoveFactory| Modifier and Type | Field and Description |
|---|---|
private CallingConvention |
cc |
private AbstractBlockBase<?> |
currentBlock |
private LIRKindTool |
lirKindTool |
private CodeGenProviders |
providers |
private LIRGenerationResult |
res |
| Constructor and Description |
|---|
LIRGenerator(LIRKindTool lirKindTool,
CodeGenProviders providers,
CallingConvention cc,
LIRGenerationResult res) |
| Modifier and Type | Method and Description |
|---|---|
<I extends LIRInstruction> |
append(I op) |
AllocatableValue |
asAllocatable(Value value) |
RegisterAttributes |
attributes(Register register) |
void |
beforeRegisterAllocation()
Called just before register allocation is performed on the LIR owned by this generator.
|
protected abstract boolean |
canInlineConstant(JavaConstant c)
Checks whether the supplied constant can be used without loading it into a register for most
operations, i.e., for commonly used arithmetic, logical, and comparison operations.
|
LIRInstruction |
createBenchmarkCounter(String name,
String group,
Value increment) |
LIRInstruction |
createMultiBenchmarkCounter(String[] names,
String[] groups,
Value[] increments) |
protected abstract Variable |
emitAdd(LIRKind resultKind,
Value a,
Value b,
boolean setFlags) |
Variable |
emitAdd(Value aVal,
Value bVal,
boolean setFlags) |
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) |
Variable |
emitForeignCall(ForeignCallLinkage linkage,
LIRFrameState frameState,
Value... args) |
protected abstract void |
emitForeignCallOp(ForeignCallLinkage linkage,
Value result,
Value[] arguments,
Value[] temps,
LIRFrameState info)
Emits the single call operation at the heart of generating LIR for a
foreign call.
|
void |
emitIncomingValues(Value[] params) |
abstract void |
emitIntegerTestBranch(Value left,
Value right,
LabelRef trueDestination,
LabelRef falseDestination,
double trueSuccessorProbability) |
abstract Variable |
emitIntegerTestMove(Value leftVal,
Value right,
Value trueValue,
Value falseValue) |
abstract void |
emitJump(LabelRef label) |
Value |
emitLoadConstant(LIRKind kind,
Constant constant) |
Variable |
emitMove(Value input) |
abstract void |
emitOverflowCheckBranch(LabelRef overflow,
LabelRef noOverflow,
LIRKind cmpKind,
double overflowProbability) |
void |
emitStrategySwitch(JavaConstant[] keyConstants,
double[] keyProbabilities,
LabelRef[] keyTargets,
LabelRef defaultTarget,
Variable value) |
abstract void |
emitStrategySwitch(SwitchStrategy strategy,
Variable key,
LabelRef[] keyTargets,
LabelRef defaultTarget) |
protected abstract Variable |
emitSub(LIRKind resultKind,
Value a,
Value b,
boolean setFlags) |
Variable |
emitSub(Value aVal,
Value bVal,
boolean setFlags) |
protected abstract void |
emitTableSwitch(int lowKey,
LabelRef defaultTarget,
LabelRef[] targets,
Value key) |
protected LIRKind |
getAddressKind(Value base,
long displacement,
Value index) |
LIRGeneratorTool.BlockScope |
getBlockScope(AbstractBlockBase<?> block) |
CallingConvention |
getCallingConvention() |
CodeCacheProvider |
getCodeCache() |
AbstractBlockBase<?> |
getCurrentBlock() |
ForeignCallsProvider |
getForeignCalls() |
LIRKind |
getLIRKind(Stamp stamp) |
protected LIRKindTool |
getLIRKindTool() |
MetaAccessProvider |
getMetaAccess() |
CodeGenProviders |
getProviders() |
LIRGenerationResult |
getResult() |
boolean |
hasBlockEnd(AbstractBlockBase<?> block) |
Variable |
load(Value value) |
Value |
loadNonConst(Value value) |
boolean |
needOnlyOopMaps()
Determines if only oop maps are required for the code generated from the LIR.
|
Variable |
newVariable(LIRKind lirKind)
Create a new
Variable. |
AllocatableValue |
resultOperandFor(LIRKind kind)
Gets the ABI specific operand used to return a value of a given kind from a method.
|
TargetDescription |
target() |
static AllocatableValue |
toStackKind(AllocatableValue value) |
protected JavaConstant |
zapValueForKind(PlatformKind kind)
Gets a garbage value for a given kind.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitemitAddress, emitArrayEquals, emitAtomicReadAndAdd, emitAtomicReadAndWrite, emitBitCount, emitBitScanForward, emitBitScanReverse, emitByteSwap, emitCompareAndSwap, emitCountLeadingZeros, emitCountTrailingZeros, emitData, emitDeoptimize, emitLoad, emitMembar, emitMove, emitNullCheck, emitReturn, emitStore, emitUnwind, getSpillMoveFactoryemitAnd, emitDiv, emitFloatConvert, emitMathAbs, emitMathSqrt, emitMul, emitMulHigh, emitNarrow, emitNegate, emitNot, emitOr, emitReinterpret, emitRem, emitShl, emitShr, emitSignExtend, emitUDiv, emitUMulHigh, emitURem, emitUShr, emitXor, emitZeroExtendprivate final LIRKindTool lirKindTool
private final CodeGenProviders providers
private final CallingConvention cc
private AbstractBlockBase<?> currentBlock
private LIRGenerationResult res
public LIRGenerator(LIRKindTool lirKindTool, CodeGenProviders providers, CallingConvention cc, LIRGenerationResult res)
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 LIRGeneratorToolprotected LIRKindTool getLIRKindTool()
public Variable newVariable(LIRKind lirKind)
LIRGeneratorToolVariable.newVariable in interface LIRGeneratorToollirKind - 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.getLIRKind() is wrong.Variable.public RegisterAttributes attributes(Register register)
attributes in interface LIRGeneratorToolpublic Variable emitMove(Value input)
emitMove in interface LIRGeneratorToolpublic Value emitLoadConstant(LIRKind kind, Constant constant)
emitLoadConstant in interface LIRGeneratorToolpublic AllocatableValue asAllocatable(Value value)
asAllocatable in interface LIRGeneratorToolpublic Variable load(Value value)
load in interface LIRGeneratorToolprotected abstract boolean canInlineConstant(JavaConstant c)
c - The constant to check.public Value loadNonConst(Value value)
loadNonConst in interface LIRGeneratorToolpublic boolean needOnlyOopMaps()
needOnlyOopMaps in interface LIRGeneratorToolpublic AllocatableValue resultOperandFor(LIRKind kind)
resultOperandFor in interface LIRGeneratorToolkind - the kind of value being returnedkindpublic <I extends LIRInstruction> I append(I op)
append in interface LIRGeneratorToolpublic boolean hasBlockEnd(AbstractBlockBase<?> block)
hasBlockEnd in interface LIRGeneratorToolpublic final LIRGeneratorTool.BlockScope getBlockScope(AbstractBlockBase<?> block)
getBlockScope in interface LIRGeneratorToolpublic void emitIncomingValues(Value[] params)
emitIncomingValues in interface LIRGeneratorToolpublic 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)
emitCompareBranch in interface LIRGeneratorToolpublic abstract void emitOverflowCheckBranch(LabelRef overflow, LabelRef noOverflow, LIRKind cmpKind, double overflowProbability)
emitOverflowCheckBranch in interface LIRGeneratorToolpublic abstract void emitIntegerTestBranch(Value left, Value right, LabelRef trueDestination, LabelRef falseDestination, double trueSuccessorProbability)
emitIntegerTestBranch in interface LIRGeneratorToolpublic 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 abstract void emitForeignCallOp(ForeignCallLinkage linkage, Value result, Value[] arguments, Value[] temps, LIRFrameState info)
public static AllocatableValue toStackKind(AllocatableValue value)
public Variable emitForeignCall(ForeignCallLinkage linkage, LIRFrameState frameState, Value... args)
emitForeignCall in interface LIRGeneratorToolpublic void emitStrategySwitch(JavaConstant[] keyConstants, double[] keyProbabilities, LabelRef[] keyTargets, LabelRef defaultTarget, Variable value)
emitStrategySwitch in interface LIRGeneratorToolpublic abstract void emitStrategySwitch(SwitchStrategy strategy, Variable key, LabelRef[] keyTargets, LabelRef defaultTarget)
emitStrategySwitch in interface LIRGeneratorToolprotected abstract void emitTableSwitch(int lowKey, LabelRef defaultTarget, LabelRef[] targets, Value key)
public CallingConvention getCallingConvention()
getCallingConvention in interface LIRGeneratorToolpublic void beforeRegisterAllocation()
LIRGeneratorToolbeforeRegisterAllocation in interface LIRGeneratorToolprotected JavaConstant zapValueForKind(PlatformKind kind)
public LIRKind getLIRKind(Stamp stamp)
getLIRKind in interface ArithmeticLIRGeneratorprotected 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 BenchmarkCounterFactorypublic LIRInstruction createMultiBenchmarkCounter(String[] names, String[] groups, Value[] increments)
createMultiBenchmarkCounter in interface BenchmarkCounterFactorypublic final Variable emitAdd(Value aVal, Value bVal, boolean setFlags)
emitAdd in interface ArithmeticLIRGenerator