Java 类org.objectweb.asm.ByteVector 实例源码

项目:JAADAS    文件:ASMBackendUtils.java   
/**
 * 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;
        }
    };
}
项目:javify    文件:StackMapTableAttribute.java   
private void writeTypeInfos(
    ByteVector bv,
    ClassWriter cw,
    List info,
    int start,
    int end)
{
    for (int j = start; j < end; j++) {
        StackMapType typeInfo = (StackMapType) info.get(j);
        bv.putByte(typeInfo.getType());

        switch (typeInfo.getType()) {
            case StackMapType.ITEM_Object: //
                bv.putShort(cw.newClass(typeInfo.getObject()));
                break;

            case StackMapType.ITEM_Uninitialized: //
                bv.putShort(typeInfo.getLabel().getOffset());
                break;

        }
    }
}
项目:javify    文件:StackMapAttribute.java   
private void writeTypeInfo(ByteVector bv, ClassWriter cw, List info, int max)
{
    if (max > StackMapAttribute.MAX_SIZE) {
        bv.putInt(info.size());
    } else {
        bv.putShort(info.size());
    }
    for (int j = 0; j < info.size(); j++) {
        StackMapType typeInfo = (StackMapType) info.get(j);
        bv.putByte(typeInfo.getType());
        switch (typeInfo.getType()) {
            case StackMapType.ITEM_Object: //
                bv.putShort(cw.newClass(typeInfo.getObject()));
                break;

            case StackMapType.ITEM_Uninitialized: //
                bv.putShort(typeInfo.getLabel().getOffset());
                break;

        }
    }
}
项目:javify    文件:StackMapAttribute.java   
protected ByteVector write(
    ClassWriter cw,
    byte[] code,
    int len,
    int maxStack,
    int maxLocals)
{
    ByteVector bv = new ByteVector();
    if (code != null && code.length > MAX_SIZE) { // TODO verify value
        bv.putInt(frames.size());
    } else {
        bv.putShort(frames.size());
    }
    for (int i = 0; i < frames.size(); i++) {
        writeFrame((StackMapFrame) frames.get(i),
                cw,
                maxStack,
                maxLocals,
                bv);
    }
    return bv;
}
项目:jvm-stm    文件:StackMapTableAttribute.java   
private void writeTypeInfos(
    ByteVector bv,
    ClassWriter cw,
    List info,
    int start,
    int end)
{
    for (int j = start; j < end; j++) {
        StackMapType typeInfo = (StackMapType) info.get(j);
        bv.putByte(typeInfo.getType());

        switch (typeInfo.getType()) {
            case StackMapType.ITEM_Object: //
                bv.putShort(cw.newClass(typeInfo.getObject()));
                break;

            case StackMapType.ITEM_Uninitialized: //
                bv.putShort(typeInfo.getLabel().getOffset());
                break;

        }
    }
}
项目:jvm-stm    文件:StackMapAttribute.java   
private void writeTypeInfo(ByteVector bv, ClassWriter cw, List info, int max)
{
    if (max > StackMapAttribute.MAX_SIZE) {
        bv.putInt(info.size());
    } else {
        bv.putShort(info.size());
    }
    for (int j = 0; j < info.size(); j++) {
        StackMapType typeInfo = (StackMapType) info.get(j);
        bv.putByte(typeInfo.getType());
        switch (typeInfo.getType()) {
            case StackMapType.ITEM_Object: //
                bv.putShort(cw.newClass(typeInfo.getObject()));
                break;

            case StackMapType.ITEM_Uninitialized: //
                bv.putShort(typeInfo.getLabel().getOffset());
                break;

        }
    }
}
项目:jvm-stm    文件:StackMapAttribute.java   
protected ByteVector write(
    ClassWriter cw,
    byte[] code,
    int len,
    int maxStack,
    int maxLocals)
{
    ByteVector bv = new ByteVector();
    if (code != null && code.length > MAX_SIZE) { // TODO verify value
        bv.putInt(frames.size());
    } else {
        bv.putShort(frames.size());
    }
    for (int i = 0; i < frames.size(); i++) {
        writeFrame((StackMapFrame) frames.get(i),
                cw,
                maxStack,
                maxLocals,
                bv);
    }
    return bv;
}
项目:annotation-tools    文件:StackMapTableAttribute.java   
private void writeTypeInfos(
    ByteVector bv,
    ClassWriter cw,
    List info,
    int start,
    int end)
{
    for (int j = start; j < end; j++) {
        StackMapType typeInfo = (StackMapType) info.get(j);
        bv.putByte(typeInfo.getType());

        switch (typeInfo.getType()) {
            case StackMapType.ITEM_Object: //
                bv.putShort(cw.newClass(typeInfo.getObject()));
                break;

            case StackMapType.ITEM_Uninitialized: //
                bv.putShort(typeInfo.getLabel().getOffset());
                break;

        }
    }
}
项目:annotation-tools    文件:StackMapAttribute.java   
private void writeTypeInfo(ByteVector bv, ClassWriter cw, List info, int max)
{
    if (max > StackMapAttribute.MAX_SIZE) {
        bv.putInt(info.size());
    } else {
        bv.putShort(info.size());
    }
    for (int j = 0; j < info.size(); j++) {
        StackMapType typeInfo = (StackMapType) info.get(j);
        bv.putByte(typeInfo.getType());
        switch (typeInfo.getType()) {
            case StackMapType.ITEM_Object: //
                bv.putShort(cw.newClass(typeInfo.getObject()));
                break;

            case StackMapType.ITEM_Uninitialized: //
                bv.putShort(typeInfo.getLabel().getOffset());
                break;

        }
    }
}
项目:annotation-tools    文件:StackMapAttribute.java   
protected ByteVector write(
    ClassWriter cw,
    byte[] code,
    int len,
    int maxStack,
    int maxLocals)
{
    ByteVector bv = new ByteVector();
    if (code != null && code.length > MAX_SIZE) { // TODO verify value
        bv.putInt(frames.size());
    } else {
        bv.putShort(frames.size());
    }
    for (int i = 0; i < frames.size(); i++) {
        writeFrame((StackMapFrame) frames.get(i),
                cw,
                maxStack,
                maxLocals,
                bv);
    }
    return bv;
}
项目:JamVM-PH    文件:StackMapTableAttribute.java   
private void writeTypeInfos(
    ByteVector bv,
    ClassWriter cw,
    List info,
    int start,
    int end)
{
    for (int j = start; j < end; j++) {
        StackMapType typeInfo = (StackMapType) info.get(j);
        bv.putByte(typeInfo.getType());

        switch (typeInfo.getType()) {
            case StackMapType.ITEM_Object: //
                bv.putShort(cw.newClass(typeInfo.getObject()));
                break;

            case StackMapType.ITEM_Uninitialized: //
                bv.putShort(typeInfo.getLabel().getOffset());
                break;

        }
    }
}
项目:JamVM-PH    文件:StackMapAttribute.java   
private void writeTypeInfo(ByteVector bv, ClassWriter cw, List info, int max)
{
    if (max > StackMapAttribute.MAX_SIZE) {
        bv.putInt(info.size());
    } else {
        bv.putShort(info.size());
    }
    for (int j = 0; j < info.size(); j++) {
        StackMapType typeInfo = (StackMapType) info.get(j);
        bv.putByte(typeInfo.getType());
        switch (typeInfo.getType()) {
            case StackMapType.ITEM_Object: //
                bv.putShort(cw.newClass(typeInfo.getObject()));
                break;

            case StackMapType.ITEM_Uninitialized: //
                bv.putShort(typeInfo.getLabel().getOffset());
                break;

        }
    }
}
项目:JamVM-PH    文件:StackMapAttribute.java   
protected ByteVector write(
    ClassWriter cw,
    byte[] code,
    int len,
    int maxStack,
    int maxLocals)
{
    ByteVector bv = new ByteVector();
    if (code != null && code.length > MAX_SIZE) { // TODO verify value
        bv.putInt(frames.size());
    } else {
        bv.putShort(frames.size());
    }
    for (int i = 0; i < frames.size(); i++) {
        writeFrame((StackMapFrame) frames.get(i),
                cw,
                maxStack,
                maxLocals,
                bv);
    }
    return bv;
}
项目:classpath    文件:StackMapTableAttribute.java   
private void writeTypeInfos(
    ByteVector bv,
    ClassWriter cw,
    List info,
    int start,
    int end)
{
    for (int j = start; j < end; j++) {
        StackMapType typeInfo = (StackMapType) info.get(j);
        bv.putByte(typeInfo.getType());

        switch (typeInfo.getType()) {
            case StackMapType.ITEM_Object: //
                bv.putShort(cw.newClass(typeInfo.getObject()));
                break;

            case StackMapType.ITEM_Uninitialized: //
                bv.putShort(typeInfo.getLabel().getOffset());
                break;

        }
    }
}
项目:classpath    文件:StackMapAttribute.java   
private void writeTypeInfo(ByteVector bv, ClassWriter cw, List info, int max)
{
    if (max > StackMapAttribute.MAX_SIZE) {
        bv.putInt(info.size());
    } else {
        bv.putShort(info.size());
    }
    for (int j = 0; j < info.size(); j++) {
        StackMapType typeInfo = (StackMapType) info.get(j);
        bv.putByte(typeInfo.getType());
        switch (typeInfo.getType()) {
            case StackMapType.ITEM_Object: //
                bv.putShort(cw.newClass(typeInfo.getObject()));
                break;

            case StackMapType.ITEM_Uninitialized: //
                bv.putShort(typeInfo.getLabel().getOffset());
                break;

        }
    }
}
项目:classpath    文件:StackMapAttribute.java   
protected ByteVector write(
    ClassWriter cw,
    byte[] code,
    int len,
    int maxStack,
    int maxLocals)
{
    ByteVector bv = new ByteVector();
    if (code != null && code.length > MAX_SIZE) { // TODO verify value
        bv.putInt(frames.size());
    } else {
        bv.putShort(frames.size());
    }
    for (int i = 0; i < frames.size(); i++) {
        writeFrame((StackMapFrame) frames.get(i),
                cw,
                maxStack,
                maxLocals,
                bv);
    }
    return bv;
}
项目:javify    文件:StackMapTableAttribute.java   
private void writeSize(int delta, ByteVector bv, boolean isExt) {
    if (isExt) {
        bv.putInt(delta);
    } else {
        bv.putShort(delta);
    }
}
项目:javify    文件:StackMapAttribute.java   
private void writeFrame(
    StackMapFrame frame,
    ClassWriter cw,
    int maxStack,
    int maxLocals,
    ByteVector bv)
{
    bv.putShort(frame.label.getOffset());
    writeTypeInfo(bv, cw, frame.locals, maxLocals);
    writeTypeInfo(bv, cw, frame.stack, maxStack);
}
项目:jcarder    文件:InstrumentedAttribute.java   
protected ByteVector write(ClassWriter arg0,
                           byte[] arg1,
                           int arg2,
                           int arg3,
                           int arg4) {
    return new ByteVector();
}
项目:jvm-stm    文件:StackMapTableAttribute.java   
private void writeSize(int delta, ByteVector bv, boolean isExt) {
    if (isExt) {
        bv.putInt(delta);
    } else {
        bv.putShort(delta);
    }
}
项目:jvm-stm    文件:StackMapAttribute.java   
private void writeFrame(
    StackMapFrame frame,
    ClassWriter cw,
    int maxStack,
    int maxLocals,
    ByteVector bv)
{
    bv.putShort(frame.label.getOffset());
    writeTypeInfo(bv, cw, frame.locals, maxLocals);
    writeTypeInfo(bv, cw, frame.stack, maxStack);
}
项目:annotation-tools    文件:StackMapTableAttribute.java   
private void writeSize(int delta, ByteVector bv, boolean isExt) {
    if (isExt) {
        bv.putInt(delta);
    } else {
        bv.putShort(delta);
    }
}
项目:annotation-tools    文件:StackMapAttribute.java   
private void writeFrame(
    StackMapFrame frame,
    ClassWriter cw,
    int maxStack,
    int maxLocals,
    ByteVector bv)
{
    bv.putShort(frame.label.getOffset());
    writeTypeInfo(bv, cw, frame.locals, maxLocals);
    writeTypeInfo(bv, cw, frame.stack, maxStack);
}
项目:CodenameOne    文件:RetroWeaverAttribute.java   
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;
}
项目:cn1    文件:RetroWeaverAttribute.java   
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;
}
项目:JamVM-PH    文件:StackMapTableAttribute.java   
private void writeSize(int delta, ByteVector bv, boolean isExt) {
    if (isExt) {
        bv.putInt(delta);
    } else {
        bv.putShort(delta);
    }
}
项目:JamVM-PH    文件:StackMapAttribute.java   
private void writeFrame(
    StackMapFrame frame,
    ClassWriter cw,
    int maxStack,
    int maxLocals,
    ByteVector bv)
{
    bv.putShort(frame.label.getOffset());
    writeTypeInfo(bv, cw, frame.locals, maxLocals);
    writeTypeInfo(bv, cw, frame.stack, maxStack);
}
项目:classpath    文件:StackMapTableAttribute.java   
private void writeSize(int delta, ByteVector bv, boolean isExt) {
    if (isExt) {
        bv.putInt(delta);
    } else {
        bv.putShort(delta);
    }
}
项目:classpath    文件:StackMapAttribute.java   
private void writeFrame(
    StackMapFrame frame,
    ClassWriter cw,
    int maxStack,
    int maxLocals,
    ByteVector bv)
{
    bv.putShort(frame.label.getOffset());
    writeTypeInfo(bv, cw, frame.locals, maxLocals);
    writeTypeInfo(bv, cw, frame.stack, maxStack);
}
项目:objectweb-asm-4.0    文件:JasminifierClassAdapterTest.java   
@Override
protected ByteVector write(
    final ClassWriter cw,
    final byte[] code,
    final int len,
    final int maxStack,
    final int maxLocals)
{
    return new ByteVector();
}
项目:objectweb-asm-4.0    文件:JasminifierClassAdapterTest.java   
@Override
protected ByteVector write(
    final ClassWriter cw,
    final byte[] code,
    final int len,
    final int maxStack,
    final int maxLocals)
{
    return new ByteVector();
}
项目:objectweb-asm-4.0    文件:Attributes.java   
@Override
protected ByteVector write(
    final ClassWriter cw,
    final byte[] code,
    final int len,
    final int maxStack,
    final int maxLocals)
{
    return new ByteVector().putShort(cw.newUTF8(comment));
}
项目:objectweb-asm-4.0    文件:CodeComment.java   
@Override
protected ByteVector write(
    final ClassWriter cw,
    final byte[] code,
    final int len,
    final int maxStack,
    final int maxLocals)
{
    return new ByteVector();
}
项目:objectweb-asm-4.0    文件:Comment.java   
@Override
protected ByteVector write(
    final ClassWriter cw,
    final byte[] code,
    final int len,
    final int maxStack,
    final int maxLocals)
{
    return new ByteVector();
}
项目:Simulare    文件:TransformMojo.java   
@Override
protected ByteVector write(ClassWriter cw, byte[] code, int len, int maxStack, int maxLocals)
{
    return new ByteVector( 0 );
}
项目:asm-legacy-svn-clone    文件:JasminifierClassAdapterTest.java   
@Override
protected ByteVector write(final ClassWriter cw, final byte[] code,
        final int len, final int maxStack, final int maxLocals) {
    return new ByteVector();
}
项目:asm-legacy-svn-clone    文件:JasminifierClassAdapterTest.java   
@Override
protected ByteVector write(final ClassWriter cw, final byte[] code,
        final int len, final int maxStack, final int maxLocals) {
    return new ByteVector();
}
项目:asm-legacy-svn-clone    文件:Attributes.java   
@Override
protected ByteVector write(final ClassWriter cw, final byte[] code,
        final int len, final int maxStack, final int maxLocals) {
    return new ByteVector().putShort(cw.newUTF8(comment));
}
项目:asm-legacy-svn-clone    文件:CodeComment.java   
@Override
protected ByteVector write(final ClassWriter cw, final byte[] code,
        final int len, final int maxStack, final int maxLocals) {
    return new ByteVector();
}
项目:asm-legacy-svn-clone    文件:Comment.java   
@Override
protected ByteVector write(final ClassWriter cw, final byte[] code,
        final int len, final int maxStack, final int maxLocals) {
    return new ByteVector();
}