public final class MethodWriter
extends GeneratorAdapter
GeneratorAdapter with some utility methods.
Set of methods used during the writing phase of compilation shared by the nodes of the Painless tree.
| Constructor and Description |
|---|
MethodWriter(int access,
Method method,
ClassVisitor cw,
java.util.BitSet statements,
CompilerSettings settings) |
| Modifier and Type | Method and Description |
|---|---|
void |
box(Type type)
Proxy the box method to use valueOf instead to ensure that the modern boxing methods are used.
|
void |
endMethod() |
static Type |
getType(java.lang.Class<?> clazz) |
void |
invokeDefCall(java.lang.String name,
Type methodType,
int flavor,
java.lang.Object... params)
Writes a dynamic call for a def method.
|
void |
invokeLambdaCall(FunctionRef functionRef) |
void |
invokeMethodCall(PainlessMethod painlessMethod) |
void |
visitEnd() |
void |
writeAppendStrings(java.lang.Class<?> clazz) |
void |
writeBinaryInstruction(Location location,
java.lang.Class<?> clazz,
Operation operation)
Writes a static binary instruction
|
void |
writeCast(PainlessCast cast) |
void |
writeDebugInfo(Location location)
Encodes the offset into the line number table as
offset + 1. |
void |
writeDup(int size,
int xsize) |
void |
writeDynamicBinaryInstruction(Location location,
java.lang.Class<?> returnType,
java.lang.Class<?> lhs,
java.lang.Class<?> rhs,
Operation operation,
int flags)
Writes a dynamic binary instruction: returnType, lhs, and rhs can be different
|
void |
writeLoopCounter(int slot,
int count,
Location location) |
int |
writeNewStrings()
Starts a new string concat.
|
void |
writePop(int size) |
void |
writeStatementOffset(Location location)
Marks a new statement boundary.
|
void |
writeToStrings() |
public MethodWriter(int access,
Method method,
ClassVisitor cw,
java.util.BitSet statements,
CompilerSettings settings)
public void writeStatementOffset(Location location)
This is invoked for each statement boundary (leaf S* nodes).
public void writeDebugInfo(Location location)
offset + 1.
This is invoked before instructions that can hit exceptions.
public void writeLoopCounter(int slot,
int count,
Location location)
public void writeCast(PainlessCast cast)
public void box(Type type)
public static Type getType(java.lang.Class<?> clazz)
public int writeNewStrings()
public void writeAppendStrings(java.lang.Class<?> clazz)
public void writeToStrings()
public void writeDynamicBinaryInstruction(Location location, java.lang.Class<?> returnType, java.lang.Class<?> lhs, java.lang.Class<?> rhs, Operation operation, int flags)
public void writeBinaryInstruction(Location location, java.lang.Class<?> clazz, Operation operation)
public void writeDup(int size,
int xsize)
public void writePop(int size)
public void endMethod()
public void visitEnd()
public void invokeDefCall(java.lang.String name,
Type methodType,
int flavor,
java.lang.Object... params)
name - method namemethodType - callsite signatureflavor - type of callparams - flavor-specific parameterspublic void invokeMethodCall(PainlessMethod painlessMethod)
public void invokeLambdaCall(FunctionRef functionRef)