jdk.internal.org.objectweb.asm.Attribute Java Examples

The following examples show how to use jdk.internal.org.objectweb.asm.Attribute. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MethodNode.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    if (attrs == null) {
        attrs = new ArrayList<Attribute>(1);
    }
    attrs.add(attr);
}
 
Example #2
Source File: CheckClassAdapter.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    checkState();
    if (attr == null) {
        throw new IllegalArgumentException(
                "Invalid attribute (must not be null)");
    }
    super.visitAttribute(attr);
}
 
Example #3
Source File: CheckMethodAdapter.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    checkEndMethod();
    if (attr == null) {
        throw new IllegalArgumentException(
                "Invalid attribute (must not be null)");
    }
    super.visitAttribute(attr);
}
 
Example #4
Source File: Textifier.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitMethodAttribute(final Attribute attr) {
    buf.setLength(0);
    buf.append(tab).append("ATTRIBUTE ");
    appendDescriptor(-1, attr.type);

    if (attr instanceof Textifiable) {
        ((Textifiable) attr).textify(buf, labelNames);
    } else {
        buf.append(" : unknown\n");
    }

    text.add(buf.toString());
}
 
Example #5
Source File: FieldNode.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    if (attrs == null) {
        attrs = new ArrayList<Attribute>(1);
    }
    attrs.add(attr);
}
 
Example #6
Source File: ClassNode.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    if (attrs == null) {
        attrs = new ArrayList<Attribute>(1);
    }
    attrs.add(attr);
}
 
Example #7
Source File: CheckFieldAdapter.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    checkEnd();
    if (attr == null) {
        throw new IllegalArgumentException(
                "Invalid attribute (must not be null)");
    }
    super.visitAttribute(attr);
}
 
Example #8
Source File: ASMifier.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void visitAttribute(final Attribute attr) {
    buf.setLength(0);
    buf.append("// ATTRIBUTE ").append(attr.type).append('\n');
    if (attr instanceof ASMifiable) {
        if (labelNames == null) {
            labelNames = new HashMap<Label, String>();
        }
        buf.append("{\n");
        ((ASMifiable) attr).asmify(buf, "attr", labelNames);
        buf.append(name).append(".visitAttribute(attr);\n");
        buf.append("}\n");
    }
    text.add(buf.toString());
}
 
Example #9
Source File: Textifier.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitMethodAttribute(final Attribute attr) {
    buf.setLength(0);
    buf.append(tab).append("ATTRIBUTE ");
    appendDescriptor(-1, attr.type);

    if (attr instanceof Textifiable) {
        ((Textifiable) attr).textify(buf, labelNames);
    } else {
        buf.append(" : unknown\n");
    }

    text.add(buf.toString());
}
 
Example #10
Source File: Textifier.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitMethodAttribute(final Attribute attr) {
    buf.setLength(0);
    buf.append(tab).append("ATTRIBUTE ");
    appendDescriptor(-1, attr.type);

    if (attr instanceof Textifiable) {
        ((Textifiable) attr).textify(buf, labelNames);
    } else {
        buf.append(" : unknown\n");
    }

    text.add(buf.toString());
}
 
Example #11
Source File: ScriptClassInstrumentor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public FieldVisitor visitField(final int fieldAccess, final String fieldName,
        final String fieldDesc, final String signature, final Object value) {
    final MemberInfo memInfo = scriptClassInfo.find(fieldName, fieldDesc, fieldAccess);
    if (memInfo != null && memInfo.getKind() == Kind.PROPERTY &&
            memInfo.getWhere() != Where.INSTANCE && !memInfo.isStaticFinal()) {
        // non-instance @Property fields - these have to go elsewhere unless 'static final'
        return null;
    }

    final FieldVisitor delegateFV = super.visitField(fieldAccess, fieldName, fieldDesc,
            signature, value);
    return new FieldVisitor(Opcodes.ASM4, delegateFV) {
        @Override
        public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
            if (ScriptClassInfo.annotations.containsKey(desc)) {
                // ignore script field annotations
                return null;
            }

            return fv.visitAnnotation(desc, visible);
        }

        @Override
        public void visitAttribute(final Attribute attr) {
            fv.visitAttribute(attr);
        }

        @Override
        public void visitEnd() {
            fv.visitEnd();
        }
    };
}
 
Example #12
Source File: CheckMethodAdapter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    checkEndMethod();
    if (attr == null) {
        throw new IllegalArgumentException(
                "Invalid attribute (must not be null)");
    }
    super.visitAttribute(attr);
}
 
Example #13
Source File: ScriptClassInstrumentor.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public FieldVisitor visitField(final int fieldAccess, final String fieldName,
        final String fieldDesc, final String signature, final Object value) {
    final MemberInfo memInfo = scriptClassInfo.find(fieldName, fieldDesc, fieldAccess);
    if (memInfo != null && memInfo.getKind() == Kind.PROPERTY &&
            memInfo.getWhere() != Where.INSTANCE && !memInfo.isStaticFinal()) {
        // non-instance @Property fields - these have to go elsewhere unless 'static final'
        return null;
    }

    final FieldVisitor delegateFV = super.visitField(fieldAccess, fieldName, fieldDesc,
            signature, value);
    return new FieldVisitor(Opcodes.ASM4, delegateFV) {
        @Override
        public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
            if (ScriptClassInfo.annotations.containsKey(desc)) {
                // ignore script field annotations
                return null;
            }

            return fv.visitAnnotation(desc, visible);
        }

        @Override
        public void visitAttribute(final Attribute attr) {
            fv.visitAttribute(attr);
        }

        @Override
        public void visitEnd() {
            fv.visitEnd();
        }
    };
}
 
Example #14
Source File: FieldNode.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    if (attrs == null) {
        attrs = new ArrayList<Attribute>(1);
    }
    attrs.add(attr);
}
 
Example #15
Source File: ClassNode.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    if (attrs == null) {
        attrs = new ArrayList<Attribute>(1);
    }
    attrs.add(attr);
}
 
Example #16
Source File: ClassNode.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    if (attrs == null) {
        attrs = new ArrayList<Attribute>(1);
    }
    attrs.add(attr);
}
 
Example #17
Source File: CheckFieldAdapter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    checkEnd();
    if (attr == null) {
        throw new IllegalArgumentException(
                "Invalid attribute (must not be null)");
    }
    super.visitAttribute(attr);
}
 
Example #18
Source File: ASMifier.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void visitAttribute(final Attribute attr) {
    buf.setLength(0);
    buf.append("// ATTRIBUTE ").append(attr.type).append('\n');
    if (attr instanceof ASMifiable) {
        if (labelNames == null) {
            labelNames = new HashMap<Label, String>();
        }
        buf.append("{\n");
        ((ASMifiable) attr).asmify(buf, "attr", labelNames);
        buf.append(name).append(".visitAttribute(attr);\n");
        buf.append("}\n");
    }
    text.add(buf.toString());
}
 
Example #19
Source File: CheckClassAdapter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    checkState();
    if (attr == null) {
        throw new IllegalArgumentException(
                "Invalid attribute (must not be null)");
    }
    super.visitAttribute(attr);
}
 
Example #20
Source File: CheckMethodAdapter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    checkEndMethod();
    if (attr == null) {
        throw new IllegalArgumentException(
                "Invalid attribute (must not be null)");
    }
    super.visitAttribute(attr);
}
 
Example #21
Source File: Textifier.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitMethodAttribute(final Attribute attr) {
    buf.setLength(0);
    buf.append(tab).append("ATTRIBUTE ");
    appendDescriptor(-1, attr.type);

    if (attr instanceof Textifiable) {
        ((Textifiable) attr).textify(buf, labelNames);
    } else {
        buf.append(" : unknown\n");
    }

    text.add(buf.toString());
}
 
Example #22
Source File: Textifier.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Prints a disassembled view of the given attribute.
 *
 * @param attr
 *            an attribute.
 */
public void visitAttribute(final Attribute attr) {
    buf.setLength(0);
    buf.append(tab).append("ATTRIBUTE ");
    appendDescriptor(-1, attr.type);

    if (attr instanceof Textifiable) {
        ((Textifiable) attr).textify(buf, null);
    } else {
        buf.append(" : unknown\n");
    }

    text.add(buf.toString());
}
 
Example #23
Source File: CheckMethodAdapter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    checkEndMethod();
    if (attr == null) {
        throw new IllegalArgumentException(
                "Invalid attribute (must not be null)");
    }
    super.visitAttribute(attr);
}
 
Example #24
Source File: ScriptClassInstrumentor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public FieldVisitor visitField(final int fieldAccess, final String fieldName,
        final String fieldDesc, final String signature, final Object value) {
    final MemberInfo memInfo = scriptClassInfo.find(fieldName, fieldDesc, fieldAccess);
    if (memInfo != null && memInfo.getKind() == Kind.PROPERTY &&
            memInfo.getWhere() != Where.INSTANCE && !memInfo.isStaticFinal()) {
        // non-instance @Property fields - these have to go elsewhere unless 'static final'
        return null;
    }

    final FieldVisitor delegateFV = super.visitField(fieldAccess, fieldName, fieldDesc,
            signature, value);
    return new FieldVisitor(Opcodes.ASM4, delegateFV) {
        @Override
        public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
            if (ScriptClassInfo.annotations.containsKey(desc)) {
                // ignore script field annotations
                return null;
            }

            return fv.visitAnnotation(desc, visible);
        }

        @Override
        public void visitAttribute(final Attribute attr) {
            fv.visitAttribute(attr);
        }

        @Override
        public void visitEnd() {
            fv.visitEnd();
        }
    };
}
 
Example #25
Source File: FieldNode.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    if (attrs == null) {
        attrs = new ArrayList<Attribute>(1);
    }
    attrs.add(attr);
}
 
Example #26
Source File: ClassNode.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    if (attrs == null) {
        attrs = new ArrayList<Attribute>(1);
    }
    attrs.add(attr);
}
 
Example #27
Source File: MethodNode.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    if (attrs == null) {
        attrs = new ArrayList<Attribute>(1);
    }
    attrs.add(attr);
}
 
Example #28
Source File: CheckFieldAdapter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    checkEnd();
    if (attr == null) {
        throw new IllegalArgumentException(
                "Invalid attribute (must not be null)");
    }
    super.visitAttribute(attr);
}
 
Example #29
Source File: ASMifier.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void visitAttribute(final Attribute attr) {
    buf.setLength(0);
    buf.append("// ATTRIBUTE ").append(attr.type).append('\n');
    if (attr instanceof ASMifiable) {
        if (labelNames == null) {
            labelNames = new HashMap<Label, String>();
        }
        buf.append("{\n");
        ((ASMifiable) attr).asmify(buf, "attr", labelNames);
        buf.append(name).append(".visitAttribute(attr);\n");
        buf.append("}\n");
    }
    text.add(buf.toString());
}
 
Example #30
Source File: CheckClassAdapter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visitAttribute(final Attribute attr) {
    checkState();
    if (attr == null) {
        throw new IllegalArgumentException(
                "Invalid attribute (must not be null)");
    }
    super.visitAttribute(attr);
}