public abstract class BaseCompilationContext<C extends eu.bandm.tools.lljava.live.CompilationContext<C>> extends Object implements eu.bandm.tools.lljava.live.CompilationContext<C>
Modifier and Type | Class and Description |
---|---|
protected static class |
BaseCompilationContext.Cache<A,B> |
protected class |
BaseCompilationContext.EnvFieldInfo |
protected class |
BaseCompilationContext.FieldInfo |
static class |
BaseCompilationContext.LabelInfo |
protected class |
BaseCompilationContext.StateFieldInfo |
protected static class |
BaseCompilationContext.VariableInfo |
Modifier and Type | Field and Description |
---|---|
protected LLJava.Class |
component |
protected String |
componentClassName |
protected LLJava.Method |
constructor |
protected LLJava.Block |
environmentInitializer |
protected Set<Class<?>> |
interfaces |
protected BaseCompilationContext.Cache<eu.bandm.tools.lljava.live.LabelContext.Label,BaseCompilationContext.LabelInfo> |
labels |
protected LLJava.Block |
stateInitializer |
protected BaseCompilationContext.Cache<eu.bandm.tools.lljava.live.VariableContext.Variable,BaseCompilationContext.VariableInfo> |
variables |
Constructor and Description |
---|
BaseCompilationContext(String componentClassName) |
BaseCompilationContext(String componentClassName,
Class<?> superclass) |
Modifier and Type | Method and Description |
---|---|
void |
add() |
void |
addInterface(Class<?> iface) |
protected void |
addStatement(LLJava.Statement stmt) |
void |
and() |
void |
branch(eu.bandm.tools.lljava.live.LabelContext.Label l) |
void |
branchIfEq(eu.bandm.tools.lljava.live.LabelContext.Label l) |
void |
branchIfGEq(eu.bandm.tools.lljava.live.LabelContext.Label l) |
void |
branchIfGT(eu.bandm.tools.lljava.live.LabelContext.Label l) |
void |
branchIfLEq(eu.bandm.tools.lljava.live.LabelContext.Label l) |
void |
branchIfLT(eu.bandm.tools.lljava.live.LabelContext.Label l) |
void |
branchIfNegative(eu.bandm.tools.lljava.live.LabelContext.Label l) |
void |
branchIfNEq(eu.bandm.tools.lljava.live.LabelContext.Label l) |
void |
branchIfNonNegative(eu.bandm.tools.lljava.live.LabelContext.Label l) |
void |
branchIfNonNull(eu.bandm.tools.lljava.live.LabelContext.Label l) |
void |
branchIfNonPositive(eu.bandm.tools.lljava.live.LabelContext.Label l) |
void |
branchIfNonZero(eu.bandm.tools.lljava.live.LabelContext.Label l) |
void |
branchIfNull(eu.bandm.tools.lljava.live.LabelContext.Label l) |
void |
branchIfPositive(eu.bandm.tools.lljava.live.LabelContext.Label l) |
void |
branchIfZero(eu.bandm.tools.lljava.live.LabelContext.Label l) |
void |
cmp() |
void |
cmpGT() |
void |
cmpLT() |
byte[] |
compile() |
void |
convertTo(Class<?> type) |
eu.bandm.tools.lljava.live.LabelContext.Label |
createLabel() |
eu.bandm.tools.lljava.live.VariableContext.Variable |
createLocalVariable(Class<?> type) |
eu.bandm.tools.lljava.live.VariableContext.Variable |
createVirtualVariable(Class<?> type,
Consumer<? super C> body) |
eu.bandm.tools.lljava.live.VariableContext.Variable |
createVirtualVariable(Class<?> type,
Runnable body)
Deprecated.
|
void |
div() |
void |
dup() |
void |
endBlock() |
protected void |
endBlock(boolean nested) |
void |
endInitializer() |
void |
endMethod() |
<C> eu.bandm.tools.lljava.live.VariableContext.Variable |
findEnv(Class<C> type,
C value) |
protected eu.bandm.tools.lljava.live.VariableContext.Variable |
findState(Class<?> type,
CheckedPair_LR<Object,String> key) |
eu.bandm.tools.lljava.live.VariableContext.Variable |
findState(Class<?> type,
Object owner,
String name) |
protected LLJava.Block |
getBlock() |
String |
getComponentClassName() |
protected Collection<BaseCompilationContext.EnvFieldInfo> |
getEnvFields() |
protected List<Object> |
getEnvValues() |
List<eu.bandm.tools.lljava.live.VariableContext.Variable> |
getInputs() |
List<eu.bandm.tools.lljava.live.VariableContext.Variable> |
getOutputs() |
eu.bandm.tools.lljava.live.VariableContext.Variable |
getParameter(Class<?> type,
int index) |
protected Class<?>[] |
getSuperConstructorParameterTypes() |
boolean |
hasInputs(Class<?>... types) |
boolean |
hasOutputs(Class<?>... types) |
void |
initially(Consumer<? super C> init) |
void |
insert(eu.bandm.tools.lljava.live.LabelContext.Label l) |
void |
instanceOf(Class<?> type) |
Object |
instantiate() |
Object |
instantiate(ClassLoader loader) |
Function<Object,Object> |
instantiateUpTo(ClassLoader loader,
Object hole) |
Function<Object,Object> |
instantiateUpTo(Object hole) |
void |
invokeDynamic(Class<?> factoryType,
String factoryName,
Class<?> returnType,
Runnable body,
Class<?>... paramTypes) |
void |
invokeInterface(Method method) |
void |
invokeSpecial(Method method) |
void |
invokeStatic(Method method) |
void |
invokeSubMethod(Object owner,
String name,
Class<?> result,
Consumer<? super C> body,
Class<?>... paramTypes) |
void |
invokeSubMethod(Object owner,
String name,
Class<?> result,
Runnable body,
Class<?>... paramTypes)
Deprecated.
|
void |
invokeVirtual(Method method) |
void |
invokeVirtualSelf(Class<?> returnType,
String name,
Class<?>... paramTypes) |
boolean |
isTracing() |
void |
length() |
protected Class<?> |
load(ClassLoader loader) |
void |
load(double c) |
void |
load(float c) |
void |
load(int c) |
void |
load(long c) |
void |
load(String s) |
void |
load(eu.bandm.tools.lljava.live.VariableContext.Variable s) |
void |
loadArray() |
void |
loadEnvVariable(Object var) |
void |
loadNull() |
protected void |
loadSuperConstructorArguments() |
void |
loadThis() |
void |
method(int modifiers,
Class<?> result,
String name,
Class<?>[] paramTypes,
Runnable body) |
void |
mul() |
void |
neg() |
void |
newArray(Class<?> type) |
void |
newInstance(Class<?> type) |
void |
newInstance(Constructor constructor,
Consumer<? super C> args) |
void |
newInstance(Constructor constructor,
Runnable args)
Deprecated.
|
void |
nop() |
void |
or() |
void |
pop() |
protected void |
popFrame() |
protected void |
postprocess() |
protected void |
pushFrame(LLJava.Block block,
List<eu.bandm.tools.lljava.live.VariableContext.Variable> inputs,
List<eu.bandm.tools.lljava.live.VariableContext.Variable> outputs) |
protected void |
pushFrame(LLJava.Method owner,
LLJava.Block block,
List<eu.bandm.tools.lljava.live.VariableContext.Variable> inputs,
List<eu.bandm.tools.lljava.live.VariableContext.Variable> outputs) |
protected LLJava.FieldReference |
ref(LLJava.Field field) |
void |
rem() |
void |
return_() |
void |
setTracing(boolean enabled) |
void |
shl() |
void |
shr() |
void |
startBlock(List<eu.bandm.tools.lljava.live.VariableContext.Variable> inputs,
List<eu.bandm.tools.lljava.live.VariableContext.Variable> outputs) |
void |
startBlock(LLJava.Block block) |
void |
startBlock(LLJava.Method owner,
LLJava.Block block) |
void |
startInitializer() |
void |
startMethod(int modifiers,
Class<?> result,
String name,
Class<?>... paramTypes) |
protected LLJava.Method |
startMethodInternal(int modifiers,
Class<?> result,
String name,
Class<?>... paramTypes) |
void |
store(eu.bandm.tools.lljava.live.VariableContext.Variable t,
Consumer<? super C> body) |
void |
store(eu.bandm.tools.lljava.live.VariableContext.Variable t,
Runnable body)
Deprecated.
|
void |
storeArray() |
void |
sub() |
protected boolean |
subtypeOracle(String t,
String u) |
void |
switchUnique(Map<Integer,? extends Consumer<? super C>> cases,
Consumer<? super C> defaultCase) |
void |
switchUnique(Map<Integer,Runnable> cases,
Runnable defaultCase)
Deprecated.
|
void |
throw_() |
String |
toString() |
void |
ushr() |
protected eu.bandm.tools.lljava.live.VariableContext.Variable |
variable(LLJava.Type type,
LLJava.FieldReference ref) |
protected eu.bandm.tools.lljava.live.VariableContext.Variable |
variable(LLJava.Type type,
LLJava.VariableRef ref) |
void |
xor() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
eval, eval, eval, eval, getType, lift, list, list, list, loadVarargs, loadVarargs, whileNonZero
block, block, checkInputs, checkOutputs, expr, expr, exprInputs, exprInputs, getInput, getOutput, getOutput, loadInput, loadOutput, self, storeOutput, storeOutput, storeOutput, storeOutput
constructor, invoke, invoke, method, reflect
initializeState, initializeState, loadState, storeState, storeState
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, ifNonNull, ifNonNull, 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, sub
protected final String componentClassName
protected final LLJava.Class component
protected final LLJava.Method constructor
protected final LLJava.Block environmentInitializer
protected final LLJava.Block stateInitializer
protected final BaseCompilationContext.Cache<eu.bandm.tools.lljava.live.VariableContext.Variable,BaseCompilationContext.VariableInfo> variables
protected final BaseCompilationContext.Cache<eu.bandm.tools.lljava.live.LabelContext.Label,BaseCompilationContext.LabelInfo> labels
public BaseCompilationContext(String componentClassName)
protected Class<?>[] getSuperConstructorParameterTypes()
protected void loadSuperConstructorArguments()
public String getComponentClassName()
public void addInterface(Class<?> iface)
protected void addStatement(LLJava.Statement stmt)
protected void pushFrame(LLJava.Block block, List<eu.bandm.tools.lljava.live.VariableContext.Variable> inputs, List<eu.bandm.tools.lljava.live.VariableContext.Variable> outputs)
protected void pushFrame(LLJava.Method owner, LLJava.Block block, List<eu.bandm.tools.lljava.live.VariableContext.Variable> inputs, List<eu.bandm.tools.lljava.live.VariableContext.Variable> outputs)
protected void popFrame()
protected LLJava.Block getBlock()
protected eu.bandm.tools.lljava.live.VariableContext.Variable variable(LLJava.Type type, LLJava.VariableRef ref)
protected eu.bandm.tools.lljava.live.VariableContext.Variable variable(LLJava.Type type, LLJava.FieldReference ref)
public List<eu.bandm.tools.lljava.live.VariableContext.Variable> getInputs()
public List<eu.bandm.tools.lljava.live.VariableContext.Variable> getOutputs()
public eu.bandm.tools.lljava.live.VariableContext.Variable createLocalVariable(Class<?> type)
createLocalVariable
in interface eu.bandm.tools.lljava.live.VariableContext
@Deprecated public eu.bandm.tools.lljava.live.VariableContext.Variable createVirtualVariable(Class<?> type, Runnable body)
createVirtualVariable
in interface eu.bandm.tools.lljava.live.VariableContext
public eu.bandm.tools.lljava.live.VariableContext.Variable createVirtualVariable(Class<?> type, Consumer<? super C> body)
public eu.bandm.tools.lljava.live.VariableContext.Variable getParameter(Class<?> type, int index)
getParameter
in interface eu.bandm.tools.lljava.live.VariableContext
public void startBlock(LLJava.Method owner, LLJava.Block block)
public void startBlock(LLJava.Block block)
public void startBlock(List<eu.bandm.tools.lljava.live.VariableContext.Variable> inputs, List<eu.bandm.tools.lljava.live.VariableContext.Variable> outputs)
public void endBlock()
protected void endBlock(boolean nested)
public boolean hasInputs(Class<?>... types)
public boolean hasOutputs(Class<?>... types)
public eu.bandm.tools.lljava.live.LabelContext.Label createLabel()
createLabel
in interface eu.bandm.tools.lljava.live.LabelContext
public void neg()
public void add()
public void sub()
public void mul()
public void div()
public void rem()
public void and()
public void or()
public void xor()
public void shl()
public void shr()
public void ushr()
public void cmp()
public void cmpLT()
public void cmpGT()
public void instanceOf(Class<?> type)
public void convertTo(Class<?> type)
public void newInstance(Class<?> type)
public void load(int c)
public void load(float c)
public void load(long c)
public void load(double c)
public void load(String s)
public void load(eu.bandm.tools.lljava.live.VariableContext.Variable s)
public void newArray(Class<?> type)
public void loadArray()
public void storeArray()
public void length()
public void dup()
public void pop()
public void nop()
@Deprecated public void store(eu.bandm.tools.lljava.live.VariableContext.Variable t, Runnable body)
public void store(eu.bandm.tools.lljava.live.VariableContext.Variable t, Consumer<? super C> body)
public void insert(eu.bandm.tools.lljava.live.LabelContext.Label l)
insert
in interface eu.bandm.tools.lljava.live.LabelContext
public void branch(eu.bandm.tools.lljava.live.LabelContext.Label l)
public void branchIfZero(eu.bandm.tools.lljava.live.LabelContext.Label l)
public void branchIfNonZero(eu.bandm.tools.lljava.live.LabelContext.Label l)
public void branchIfNull(eu.bandm.tools.lljava.live.LabelContext.Label l)
public void branchIfNonNull(eu.bandm.tools.lljava.live.LabelContext.Label l)
public void branchIfEq(eu.bandm.tools.lljava.live.LabelContext.Label l)
public void branchIfNEq(eu.bandm.tools.lljava.live.LabelContext.Label l)
public void branchIfGT(eu.bandm.tools.lljava.live.LabelContext.Label l)
public void branchIfGEq(eu.bandm.tools.lljava.live.LabelContext.Label l)
public void branchIfLEq(eu.bandm.tools.lljava.live.LabelContext.Label l)
public void branchIfLT(eu.bandm.tools.lljava.live.LabelContext.Label l)
public void branchIfPositive(eu.bandm.tools.lljava.live.LabelContext.Label l)
public void branchIfNonPositive(eu.bandm.tools.lljava.live.LabelContext.Label l)
public void branchIfNegative(eu.bandm.tools.lljava.live.LabelContext.Label l)
public void branchIfNonNegative(eu.bandm.tools.lljava.live.LabelContext.Label l)
public void invokeInterface(Method method)
public void invokeVirtual(Method method)
public void invokeSpecial(Method method)
public void invokeStatic(Method method)
public void invokeVirtualSelf(Class<?> returnType, String name, Class<?>... paramTypes)
@Deprecated public void newInstance(Constructor constructor, Runnable args)
public void newInstance(Constructor constructor, Consumer<? super C> args)
public <C> eu.bandm.tools.lljava.live.VariableContext.Variable findEnv(Class<C> type, C value)
public void loadNull()
public void loadThis()
protected LLJava.FieldReference ref(LLJava.Field field)
public eu.bandm.tools.lljava.live.VariableContext.Variable findState(Class<?> type, Object owner, String name)
protected eu.bandm.tools.lljava.live.VariableContext.Variable findState(Class<?> type, CheckedPair_LR<Object,String> key)
@Deprecated public void invokeSubMethod(Object owner, String name, Class<?> result, Runnable body, Class<?>... paramTypes)
public void invokeSubMethod(Object owner, String name, Class<?> result, Consumer<? super C> body, Class<?>... paramTypes)
public void method(int modifiers, Class<?> result, String name, Class<?>[] paramTypes, Runnable body)
public void startMethod(int modifiers, Class<?> result, String name, Class<?>... paramTypes)
protected LLJava.Method startMethodInternal(int modifiers, Class<?> result, String name, Class<?>... paramTypes)
public void endMethod()
protected void postprocess()
public byte[] compile()
protected Collection<BaseCompilationContext.EnvFieldInfo> getEnvFields()
public Object instantiate()
public Object instantiate(ClassLoader loader)
protected Class<?> load(ClassLoader loader)
public Function<Object,Object> instantiateUpTo(ClassLoader loader, Object hole)
public void startInitializer()
public void endInitializer()
public void loadEnvVariable(Object var)
public void invokeDynamic(Class<?> factoryType, String factoryName, Class<?> returnType, Runnable body, Class<?>... paramTypes)
@Deprecated public void switchUnique(Map<Integer,Runnable> cases, Runnable defaultCase)
public void switchUnique(Map<Integer,? extends Consumer<? super C>> cases, Consumer<? super C> defaultCase)
public void throw_()
public void return_()
public boolean isTracing()
isTracing
in interface eu.bandm.tools.lljava.live.TracingContext
public void setTracing(boolean enabled)
setTracing
in interface eu.bandm.tools.lljava.live.TracingContext
see also the complete user documentation .