use of org.apache.drill.exec.compile.CheckMethodVisitorFsm in project drill by apache.
the class ScalarReplacementNode method visitEnd.
@Override
public void visitEnd() {
/*
* Note this is a MethodNode, not a MethodVisitor. As a result, calls to the various visitX()
* methods will be building up a method. Then, once we analyze it, we use accept() to visit that
* method and transform it with the InstructionModifier at the bottom.
*/
super.visitEnd();
final LinkedList<ReplacingBasicValue> valueList = new LinkedList<>();
final MethodAnalyzer<BasicValue> analyzer = new MethodAnalyzer<BasicValue>(new ReplacingInterpreter(className, valueList));
Frame<BasicValue>[] frames;
try {
frames = analyzer.analyze(className, this);
} catch (final AnalyzerException e) {
throw new IllegalStateException(e);
}
if (logger.isTraceEnabled()) {
final StringBuilder sb = new StringBuilder();
sb.append("ReplacingBasicValues for " + className + "\n");
for (final ReplacingBasicValue value : valueList) {
value.dump(sb, 2);
sb.append('\n');
}
logger.debug(sb.toString());
}
// wrap the instruction handler so that we can do additional things
final TrackingInstructionList list = new TrackingInstructionList(frames, this.instructions);
this.instructions = list;
MethodVisitor methodVisitor = inner;
if (verifyBytecode) {
methodVisitor = new CheckMethodVisitorFsm(CompilationConfig.ASM_API_VERSION, methodVisitor);
}
final InstructionModifier holderV = new InstructionModifier(this.access, this.name, this.desc, this.signature, this.exceptionsArr, list, methodVisitor);
accept(holderV);
}
Aggregations