Package eu.bandm.tools.lljava.live.impl
Class BaseCompilationContextImpl<C extends CompilationContext<C>>
java.lang.Object
eu.bandm.tools.lljava.live.impl.BaseCompilationContextImpl<C>
- All Implemented Interfaces:
BlockContext<C>,CompilationContext<C>,EnvironmentContext<C>,InstructionsContext<C>,InvocationContext<C>,LabelContext,StateContext<C>,SubMethodsContext<C>,TracingContext,VariableContext
@PropertyDependency("eu.bandm.tools.lljava.live.BaseCompilationContext.dump")
public class BaseCompilationContextImpl<C extends CompilationContext<C>>
extends Object
implements CompilationContext<C>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected classprotected classstatic classprotected classprotected static classNested classes/interfaces inherited from interface eu.bandm.tools.lljava.live.LabelContext
LabelContext.LabelNested classes/interfaces inherited from interface eu.bandm.tools.lljava.live.VariableContext
VariableContext.Variable -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final LLJava.Classprotected final Stringprotected final LLJava.Methodprotected final LLJava.Blockprotected final BaseCompilationContextImpl.Cache<LabelContext.Label, BaseCompilationContextImpl.LabelInfo> protected final LLJava.Blockprotected final Class<?> protected final BaseCompilationContextImpl.Cache<VariableContext.Variable, BaseCompilationContextImpl.VariableInfo> -
Constructor Summary
ConstructorsConstructorDescriptionBaseCompilationContextImpl(String componentClassName) BaseCompilationContextImpl(String componentClassName, Class<?> superclass, BaseCompilationContext.SuperEnvInfo... superEnv) -
Method Summary
Modifier and TypeMethodDescriptionadd()voidaddInterface(Class<?> iface) protected voidaddStatement(LLJava.Statement stmt) and()voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidcmp()cmpGT()cmpLT()byte[]compile()Class<?> Class<?> compileClass(ClassLoader loader) createFactory(ClassLoader loader) createLazyFactory(ClassLoader loader) createLocalVariable(Class<?> type) createVirtualVariable(Class<?> type, GeneratorStep body) Deprecated.createVirtualVariable(Class<?> type, Consumer<? super C> body) div()dup()endBlock()protected voidendBlock(boolean nested) voidvoidfindEnvUnstored(Class<C> type, C value) protected VariableContext.VariablefindState(Class<?> type, CheckedPair_LR<Object, String> key) protected LLJava.BlockgetBlock()Collection<? extends EnvironmentContext.EnvFieldInfo<?>> getParameter(Class<?> type, int index) booleanbooleanhasOutputs(Class<?>... types) voidinitially(GeneratorStep init) voidvoidinstanceOf(Class<?> type) instantiate(ClassLoader loader) instantiateUpTo(ClassLoader loader, Object hole) voidinvokeDynamic(Class<?> factoryType, String factoryName, Class<?> returnType, GeneratorStep body, Class<?>... paramTypes) invokeInterface(Method method) invokeSpecial(Method method) invokeStatic(Method method) voidinvokeSubMethod(Object owner, String name, Class<?> result, GeneratorStep body, Class<?>... paramTypes) Deprecated.voidinvokeSubMethod(Object owner, String name, Class<?> result, Consumer<? super C> body, Class<?>... paramTypes) invokeVirtual(Method method) voidinvokeVirtualSelf(Class<?> returnType, String name, Class<?>... paramTypes) booleanlength()load(double c) load(float c) load(int c) load(long c) protected Class<?> load(ClassLoader loader) voidloadEnvVariable(Object var) loadNull()loadThis()voidmethod(int modifiers, Class<?> result, String name, Class<?>[] paramTypes, GeneratorStep body) mul()neg()newInstance(Class<?> type) voidnewInstance(Constructor<?> constructor, Consumer<? super C> args) voidnewInstance(Constructor constructor, GeneratorStep args) Deprecated.nop()or()pop()protected voidpopFrame()protected voidprotected voidpushFrame(LLJava.Block block, List<VariableContext.Variable> inputs, List<VariableContext.Variable> outputs) protected voidpushFrame(LLJava.Method owner, LLJava.Block block, List<VariableContext.Variable> inputs, List<VariableContext.Variable> outputs) protected LLJava.FieldReferenceref(LLJava.Field field) protected LLJava.FieldReferencerem()return_()self()Must be defined for this class to be instantiable = non-abstract by the bootphase proxy lljava.live.BaseCompilationContext.voidsetTracing(boolean enabled) shl()shr()voidstartBlock(LLJava.Block block) voidstartBlock(LLJava.Method owner, LLJava.Block block) startBlock(List<VariableContext.Variable> inputs, List<VariableContext.Variable> outputs) voidvoidstartMethod(int modifiers, Class<?> result, String name, Class<?>... paramTypes) protected LLJava.MethodstartMethodInternal(int modifiers, Class<?> result, String name, Class<?>... paramTypes) store(VariableContext.Variable t, GeneratorStep body) Deprecated.store(VariableContext.Variable t, Consumer<? super C> body) sub()booleansubtypeOracle(String t, String u) voidvoidswitchUnique(Map<Integer, GeneratorStep> cases, GeneratorStep defaultCase) Deprecated.throw_()toString()ushr()protected VariableContext.Variablevariable(LLJava.Type type, LLJava.FieldReference ref) protected VariableContext.Variablevariable(LLJava.Type type, LLJava.VariableRef ref) xor()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface eu.bandm.tools.lljava.live.BlockContext
block, block, expr, expr, exprInputs, exprInputs, getInput, getOutput, getOutput, loadInput, loadOutput, storeOutput, storeOutput, storeOutput, storeOutputMethods inherited from interface eu.bandm.tools.lljava.live.CompilationContext
eval, eval, eval, eval, getType, list, list, list, loadVarargs, loadVarargs, whileNonZeroMethods inherited from interface eu.bandm.tools.lljava.live.EnvironmentContext
createFactory, findEnvField, instantiate, instantiateUpTo, loadEnv, loadEnv, loadEnvFieldMethods inherited from interface eu.bandm.tools.lljava.live.InstructionsContext
add, binary, binary, constant, constant, constant, constant, constant, constantNull, div, ifElse, ifElse, ifEq, ifEq, ifEq, ifGEq, ifGEq, ifGEq, ifGT, ifGT, ifGT, ifLEq, ifLEq, ifLEq, ifLT, ifLT, ifLT, ifNegative, ifNegative, ifNEq, ifNEq, ifNEq, ifNonNegative, ifNonNegative, ifNonNull, ifNonNull, ifNonPositive, ifNonPositive, ifNonZero, ifNonZero, ifNonZero, ifNull, ifNull, ifPositive, ifPositive, ifZero, ifZero, ifZero, invoke, isEq, isGEq, isGT, isLEq, isLT, isNegative, isNEq, isNonNegative, isNonNull, isNonPositive, isNonZero, isNull, isPositive, isZero, lazyAnd, lazyOr, load, loadPrimitive, move, move, move, move, move, move, move, moveNull, mul, not, query, rem, serve, serving, subMethods inherited from interface eu.bandm.tools.lljava.live.InvocationContext
invoke, invokeMethods inherited from interface eu.bandm.tools.lljava.live.StateContext
initializeState, initializeState, initializeState, loadState, storeState, storeState
-
Field Details
-
componentClassName
-
component
-
constructor
-
environmentInitializer
-
stateInitializer
-
superClass
-
interfaces
-
variables
protected final BaseCompilationContextImpl.Cache<VariableContext.Variable,BaseCompilationContextImpl.VariableInfo> variables -
labels
protected final BaseCompilationContextImpl.Cache<LabelContext.Label,BaseCompilationContextImpl.LabelInfo> labels
-
-
Constructor Details
-
BaseCompilationContextImpl
-
BaseCompilationContextImpl
public BaseCompilationContextImpl(String componentClassName, Class<?> superclass, BaseCompilationContext.SuperEnvInfo... superEnv)
-
-
Method Details
-
self
Must be defined for this class to be instantiable = non-abstract by the bootphase proxy lljava.live.BaseCompilationContext.- Specified by:
selfin interfaceBlockContext<C extends CompilationContext<C>>- Specified by:
selfin interfaceInstructionsContext<C extends CompilationContext<C>>
-
getComponentClassName
- Specified by:
getComponentClassNamein interfaceCompilationContext<C extends CompilationContext<C>>
-
toString
-
addInterface
- Specified by:
addInterfacein interfaceCompilationContext<C extends CompilationContext<C>>
-
addStatement
-
pushFrame
protected void pushFrame(LLJava.Block block, List<VariableContext.Variable> inputs, List<VariableContext.Variable> outputs) -
pushFrame
protected void pushFrame(LLJava.Method owner, LLJava.Block block, List<VariableContext.Variable> inputs, List<VariableContext.Variable> outputs) -
popFrame
protected void popFrame() -
getBlock
-
variable
-
variable
-
getInputs
- Specified by:
getInputsin interfaceBlockContext<C extends CompilationContext<C>>
-
getOutputs
- Specified by:
getOutputsin interfaceBlockContext<C extends CompilationContext<C>>
-
createLocalVariable
- Specified by:
createLocalVariablein interfaceVariableContext
-
createVirtualVariable
@Deprecated public VariableContext.Variable createVirtualVariable(Class<?> type, GeneratorStep body) Deprecated.- Specified by:
createVirtualVariablein interfaceVariableContext
-
createVirtualVariable
-
getParameter
- Specified by:
getParameterin interfaceVariableContext
-
startBlock
-
startBlock
-
startBlock
- Specified by:
startBlockin interfaceBlockContext<C extends CompilationContext<C>>
-
endBlock
- Specified by:
endBlockin interfaceBlockContext<C extends CompilationContext<C>>
-
endBlock
protected void endBlock(boolean nested) -
hasInputs
- Specified by:
hasInputsin interfaceBlockContext<C extends CompilationContext<C>>
-
hasOutputs
- Specified by:
hasOutputsin interfaceBlockContext<C extends CompilationContext<C>>
-
createLabel
- Specified by:
createLabelin interfaceLabelContext
-
neg
- Specified by:
negin interfaceInstructionsContext<C extends CompilationContext<C>>
-
add
- Specified by:
addin interfaceInstructionsContext<C extends CompilationContext<C>>
-
sub
- Specified by:
subin interfaceInstructionsContext<C extends CompilationContext<C>>
-
mul
- Specified by:
mulin interfaceInstructionsContext<C extends CompilationContext<C>>
-
div
- Specified by:
divin interfaceInstructionsContext<C extends CompilationContext<C>>
-
rem
- Specified by:
remin interfaceInstructionsContext<C extends CompilationContext<C>>
-
and
- Specified by:
andin interfaceInstructionsContext<C extends CompilationContext<C>>
-
or
- Specified by:
orin interfaceInstructionsContext<C extends CompilationContext<C>>
-
xor
- Specified by:
xorin interfaceInstructionsContext<C extends CompilationContext<C>>
-
shl
- Specified by:
shlin interfaceInstructionsContext<C extends CompilationContext<C>>
-
shr
- Specified by:
shrin interfaceInstructionsContext<C extends CompilationContext<C>>
-
ushr
- Specified by:
ushrin interfaceInstructionsContext<C extends CompilationContext<C>>
-
cmp
- Specified by:
cmpin interfaceInstructionsContext<C extends CompilationContext<C>>
-
cmpLT
- Specified by:
cmpLTin interfaceInstructionsContext<C extends CompilationContext<C>>
-
cmpGT
- Specified by:
cmpGTin interfaceInstructionsContext<C extends CompilationContext<C>>
-
instanceOf
- Specified by:
instanceOfin interfaceInstructionsContext<C extends CompilationContext<C>>
-
convertTo
- Specified by:
convertToin interfaceInstructionsContext<C extends CompilationContext<C>>
-
newInstance
- Specified by:
newInstancein interfaceInstructionsContext<C extends CompilationContext<C>>
-
load
- Specified by:
loadin interfaceInstructionsContext<C extends CompilationContext<C>>
-
load
- Specified by:
loadin interfaceInstructionsContext<C extends CompilationContext<C>>
-
load
- Specified by:
loadin interfaceInstructionsContext<C extends CompilationContext<C>>
-
load
- Specified by:
loadin interfaceInstructionsContext<C extends CompilationContext<C>>
-
load
- Specified by:
loadin interfaceInstructionsContext<C extends CompilationContext<C>>
-
load
- Specified by:
loadin interfaceInstructionsContext<C extends CompilationContext<C>>
-
newArray
- Specified by:
newArrayin interfaceInstructionsContext<C extends CompilationContext<C>>
-
loadArray
- Specified by:
loadArrayin interfaceInstructionsContext<C extends CompilationContext<C>>
-
storeArray
- Specified by:
storeArrayin interfaceInstructionsContext<C extends CompilationContext<C>>
-
length
- Specified by:
lengthin interfaceInstructionsContext<C extends CompilationContext<C>>
-
dup
- Specified by:
dupin interfaceInstructionsContext<C extends CompilationContext<C>>
-
pop
- Specified by:
popin interfaceInstructionsContext<C extends CompilationContext<C>>
-
nop
- Specified by:
nopin interfaceInstructionsContext<C extends CompilationContext<C>>
-
store
Deprecated.- Specified by:
storein interfaceInstructionsContext<C extends CompilationContext<C>>
-
store
- Specified by:
storein interfaceInstructionsContext<C extends CompilationContext<C>>
-
insert
- Specified by:
insertin interfaceLabelContext
-
branch
- Specified by:
branchin interfaceInstructionsContext<C extends CompilationContext<C>>
-
branchIfZero
- Specified by:
branchIfZeroin interfaceInstructionsContext<C extends CompilationContext<C>>
-
branchIfNonZero
- Specified by:
branchIfNonZeroin interfaceInstructionsContext<C extends CompilationContext<C>>
-
branchIfNull
- Specified by:
branchIfNullin interfaceInstructionsContext<C extends CompilationContext<C>>
-
branchIfNonNull
- Specified by:
branchIfNonNullin interfaceInstructionsContext<C extends CompilationContext<C>>
-
branchIfEq
- Specified by:
branchIfEqin interfaceInstructionsContext<C extends CompilationContext<C>>
-
branchIfNEq
- Specified by:
branchIfNEqin interfaceInstructionsContext<C extends CompilationContext<C>>
-
branchIfGT
- Specified by:
branchIfGTin interfaceInstructionsContext<C extends CompilationContext<C>>
-
branchIfGEq
- Specified by:
branchIfGEqin interfaceInstructionsContext<C extends CompilationContext<C>>
-
branchIfLEq
- Specified by:
branchIfLEqin interfaceInstructionsContext<C extends CompilationContext<C>>
-
branchIfLT
- Specified by:
branchIfLTin interfaceInstructionsContext<C extends CompilationContext<C>>
-
branchIfPositive
- Specified by:
branchIfPositivein interfaceInstructionsContext<C extends CompilationContext<C>>
-
branchIfNonPositive
- Specified by:
branchIfNonPositivein interfaceInstructionsContext<C extends CompilationContext<C>>
-
branchIfNegative
- Specified by:
branchIfNegativein interfaceInstructionsContext<C extends CompilationContext<C>>
-
branchIfNonNegative
- Specified by:
branchIfNonNegativein interfaceInstructionsContext<C extends CompilationContext<C>>
-
invokeInterface
- Specified by:
invokeInterfacein interfaceInvocationContext<C extends CompilationContext<C>>
-
invokeVirtual
- Specified by:
invokeVirtualin interfaceInvocationContext<C extends CompilationContext<C>>
-
invokeSpecial
- Specified by:
invokeSpecialin interfaceInvocationContext<C extends CompilationContext<C>>
-
invokeStatic
- Specified by:
invokeStaticin interfaceInvocationContext<C extends CompilationContext<C>>
-
invokeVirtualSelf
-
newInstance
Deprecated.- Specified by:
newInstancein interfaceInvocationContext<C extends CompilationContext<C>>
-
newInstance
- Specified by:
newInstancein interfaceInvocationContext<C extends CompilationContext<C>>
-
findEnv
- Specified by:
findEnvin interfaceEnvironmentContext<C extends CompilationContext<C>>
-
findEnvUnstored
- Specified by:
findEnvUnstoredin interfaceEnvironmentContext<C extends CompilationContext<C>>
-
loadNull
- Specified by:
loadNullin interfaceInstructionsContext<C extends CompilationContext<C>>
-
loadThis
- Specified by:
loadThisin interfaceInstructionsContext<C extends CompilationContext<C>>
-
ref
-
findState
- Specified by:
findStatein interfaceStateContext<C extends CompilationContext<C>>
-
findState
-
invokeSubMethod
@Deprecated public void invokeSubMethod(Object owner, String name, Class<?> result, GeneratorStep body, Class<?>... paramTypes) Deprecated.- Specified by:
invokeSubMethodin interfaceSubMethodsContext<C extends CompilationContext<C>>
-
invokeSubMethod
public void invokeSubMethod(Object owner, String name, Class<?> result, Consumer<? super C> body, Class<?>... paramTypes) - Specified by:
invokeSubMethodin interfaceSubMethodsContext<C extends CompilationContext<C>>
-
method
public void method(int modifiers, Class<?> result, String name, Class<?>[] paramTypes, GeneratorStep body) -
startMethod
- Specified by:
startMethodin interfaceSubMethodsContext<C extends CompilationContext<C>>
-
startMethodInternal
protected LLJava.Method startMethodInternal(int modifiers, Class<?> result, String name, Class<?>... paramTypes) -
endMethod
public void endMethod()- Specified by:
endMethodin interfaceSubMethodsContext<C extends CompilationContext<C>>
-
postprocess
protected void postprocess() -
compile
public byte[] compile() -
subtypeOracle
- Specified by:
subtypeOraclein interfaceCompilationContext<C extends CompilationContext<C>>
-
getEnvFields
- Specified by:
getEnvFieldsin interfaceEnvironmentContext<C extends CompilationContext<C>>
-
getEnvValues
-
instantiate
- Specified by:
instantiatein interfaceEnvironmentContext<C extends CompilationContext<C>>
-
createFactory
- Specified by:
createFactoryin interfaceEnvironmentContext<C extends CompilationContext<C>>
-
createLazyFactory
-
createLazyFactory
-
compileClass
- Specified by:
compileClassin interfaceCompilationContext<C extends CompilationContext<C>>
-
compileClass
-
load
-
instantiateUpTo
- Specified by:
instantiateUpToin interfaceEnvironmentContext<C extends CompilationContext<C>>
-
initially
- Specified by:
initiallyin interfaceStateContext<C extends CompilationContext<C>>
-
initially
- Specified by:
initiallyin interfaceStateContext<C extends CompilationContext<C>>
-
startInitializer
public void startInitializer() -
endInitializer
public void endInitializer() -
loadEnvVariable
- Specified by:
loadEnvVariablein interfaceEnvironmentContext<C extends CompilationContext<C>>
-
invokeDynamic
public void invokeDynamic(Class<?> factoryType, String factoryName, Class<?> returnType, GeneratorStep body, Class<?>... paramTypes) - Specified by:
invokeDynamicin interfaceInvocationContext<C extends CompilationContext<C>>
-
switchUnique
Deprecated.- Specified by:
switchUniquein interfaceCompilationContext<C extends CompilationContext<C>>- Specified by:
switchUniquein interfaceInstructionsContext<C extends CompilationContext<C>>
-
switchUnique
public void switchUnique(Map<Integer, ? extends Consumer<? super C>> cases, Consumer<? super C> defaultCase) - Specified by:
switchUniquein interfaceInstructionsContext<C extends CompilationContext<C>>
-
throw_
- Specified by:
throw_in interfaceInstructionsContext<C extends CompilationContext<C>>
-
return_
- Specified by:
return_in interfaceInstructionsContext<C extends CompilationContext<C>>
-
get
- Specified by:
getin interfaceInstructionsContext<C extends CompilationContext<C>>
-
put
- Specified by:
putin interfaceInstructionsContext<C extends CompilationContext<C>>
-
ref
-
unbox
-
box
-
isTracing
public boolean isTracing()- Specified by:
isTracingin interfaceTracingContext
-
setTracing
public void setTracing(boolean enabled) - Specified by:
setTracingin interfaceTracingContext
-