use of org.objectweb.asm.Opcodes.ARETURN in project groovy by apache.
the class RecordTypeASTTransformation method createRecordToString.
private void createRecordToString(ClassNode cNode) {
String desc = BytecodeHelper.getMethodDescriptor(ClassHelper.STRING_TYPE, new ClassNode[] { cNode });
Statement body = stmt(bytecodeX(ClassHelper.STRING_TYPE, mv -> {
mv.visitVarInsn(ALOAD, 0);
mv.visitInvokeDynamicInsn("toString", desc, createBootstrapMethod(), createBootstrapMethodArguments(cNode));
mv.visitInsn(ARETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
}));
addGeneratedMethod(cNode, "toString", PUBLIC_FINAL, ClassHelper.STRING_TYPE, Parameter.EMPTY_ARRAY, ClassNode.EMPTY_ARRAY, body);
}
Aggregations