Search in sources :

Example 1 with ByteVector

use of org.objectweb.asm.ByteVector in project openj9 by eclipse.

the class NestHostAttribute method write.

public ByteVector write(ClassWriter cw, byte[] code, int len, int maxStack, int maxLocals) {
    int topclass_index = cw.newClass(nestHost);
    ByteVector b = new ByteVector();
    b.putShort(topclass_index);
    return b;
}
Also used : ByteVector(org.objectweb.asm.ByteVector)

Example 2 with ByteVector

use of org.objectweb.asm.ByteVector in project openj9 by eclipse.

the class NestMembersAttribute method write.

public ByteVector write(ClassWriter cw, byte[] code, int len, int maxStack, int maxLocals) {
    ByteVector b = new ByteVector();
    b.putShort(nestMembers.length);
    int nestMemberIndex;
    for (int i = 0; i < nestMembers.length; i++) {
        nestMemberIndex = cw.newClass(nestMembers[i]);
        b.putShort(nestMemberIndex);
    }
    return b;
}
Also used : ByteVector(org.objectweb.asm.ByteVector)

Example 3 with ByteVector

use of org.objectweb.asm.ByteVector in project CodenameOne by codenameone.

the class RetroWeaverAttribute method write.

protected ByteVector write(final ClassWriter cw, final byte[] code, final int len, final int maxStack, final int maxLocals) {
    ByteVector bv = new ByteVector();
    bv.putInt(retroweaverBuildNumber);
    bv.putInt(originalClassVersion);
    bv.putLong(timestamp);
    return bv;
}
Also used : ByteVector(org.objectweb.asm.ByteVector)

Example 4 with ByteVector

use of org.objectweb.asm.ByteVector in project openj9 by eclipse.

the class NestHostAttribute method write.

public ByteVector write(ClassWriter cw, byte[] code, int len, int maxStack, int maxLocals) {
    int topclass_index = cw.newClass(nestHost);
    ByteVector b = new ByteVector();
    b.putShort(topclass_index);
    return b;
}
Also used : ByteVector(org.objectweb.asm.ByteVector)

Example 5 with ByteVector

use of org.objectweb.asm.ByteVector in project soot by Sable.

the class ASMBackendUtils method createASMAttribute.

/**
 * Create an ASM attribute from an Soot attribute
 * @param attr Soot attribute
 * @return ASM attribute
 */
public static org.objectweb.asm.Attribute createASMAttribute(Attribute attr) {
    final Attribute a = attr;
    return new org.objectweb.asm.Attribute(attr.getName()) {

        @Override
        protected ByteVector write(final ClassWriter cw, final byte[] code, final int len, final int maxStack, final int maxLocals) {
            ByteVector result = new ByteVector();
            result.putByteArray(a.getValue(), 0, a.getValue().length);
            return result;
        }
    };
}
Also used : Attribute(soot.tagkit.Attribute) ClassWriter(org.objectweb.asm.ClassWriter) ByteVector(org.objectweb.asm.ByteVector)

Aggregations

ByteVector (org.objectweb.asm.ByteVector)8 ClassWriter (org.objectweb.asm.ClassWriter)1 Attribute (soot.tagkit.Attribute)1