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(org.objectweb.asm.Type type)
Proxy the box method to use valueOf instead to ensure that the modern boxing methods are used.
|
void |
endMethod() |
void |
invokeDefCall(java.lang.String name,
org.objectweb.asm.Type methodType,
int flavor,
java.lang.Object... params)
Writes a dynamic call for a def method.
|
void |
visitEnd() |
void |
writeAppendStrings(Definition.Type type) |
void |
writeBinaryInstruction(Location location,
Definition.Type type,
Operation operation)
Writes a static binary instruction
|
void |
writeBranch(Label tru,
Label fals) |
void |
writeCast(Definition.Cast 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,
Definition.Type returnType,
Definition.Type lhs,
Definition.Type 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(Definition.Cast cast)
public void box(org.objectweb.asm.Type type)
public void writeBranch(Label tru,
Label fals)
public int writeNewStrings()
public void writeAppendStrings(Definition.Type type)
public void writeToStrings()
public void writeDynamicBinaryInstruction(Location location, Definition.Type returnType, Definition.Type lhs, Definition.Type rhs, Operation operation, int flags)
public void writeBinaryInstruction(Location location, Definition.Type type, 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,
org.objectweb.asm.Type methodType,
int flavor,
java.lang.Object... params)
name - method namemethodType - callsite signatureflavor - type of callparams - flavor-specific parameters