Example usage for org.objectweb.asm.commons LocalVariablesSorter visitMaxs

List of usage examples for org.objectweb.asm.commons LocalVariablesSorter visitMaxs

Introduction

In this page you can find the example usage for org.objectweb.asm.commons LocalVariablesSorter visitMaxs.

Prototype

@Override
    public void visitMaxs(final int maxStack, final int maxLocals) 

Source Link

Usage

From source file:rubah.bytecode.transformers.AddTraverseMethod.java

License:Open Source License

private void generateTraverseMethod() {
    LocalVariablesSorter mv = new LocalVariablesSorter(TRAVERSE_METHOD_ACC_FLAGS, TRAVERSE_METHOD_DESC,
            this.visitMethod(this.getTraverseMethodAccess(), this.getTraverseMethodName(), TRAVERSE_METHOD_DESC,
                    null, null));//from  ww  w  .j a  v  a  2 s  . co  m
    mv.visitCode();

    if (isAllowed(this.thisClass.getFqn())) {
        this.generateTraverseMethodPreamble(mv);

        if (!this.fields.isEmpty()) {
            for (Pair<String, String> field : this.fields) {
                this.generateFieldAccess(mv, field);
            }
        }
    }
    mv.visitInsn(RETURN);
    mv.visitMaxs(0, 0);
    mv.visitEnd();
}