Example usage for org.objectweb.asm Opcodes V1_1

List of usage examples for org.objectweb.asm Opcodes V1_1

Introduction

In this page you can find the example usage for org.objectweb.asm Opcodes V1_1.

Prototype

int V1_1

To view the source code for org.objectweb.asm Opcodes V1_1.

Click Source Link

Usage

From source file:lapin.comp.asm.ASMByteCodeGenerator.java

License:Open Source License

private void initASMObject(Env env) {
    ArrayList al = new ArrayList();
    for (Object l = ciList; !Lists.isEnd(l); l = Lists.cdr(l)) {
        CallableInfo ci = (CallableInfo) Lists.car(l);
        if (ci.mi.implCallable())
            al.add(toInternalName(ci.interfaceName));
    }/*from   ww w. ja v  a2 s. c  om*/
    String[] ifNames = new String[al.size()];
    al.toArray(ifNames);
    // ClassWriter
    _cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
    _cw.visit(Opcodes.V1_1, Opcodes.ACC_PUBLIC, toInternalName(super.classInfo.classname()), null,
            "lapin/function/CompiledExpr", ifNames);
}

From source file:org.eclipselabs.nullness.NullnessCompiler.java

License:Open Source License

private int getClassWriterFlags(int version) {
    return version >= Opcodes.V1_6 && version != Opcodes.V1_1 ? ClassWriter.COMPUTE_FRAMES
            : ClassWriter.COMPUTE_MAXS;/*from   w  w  w .j  a  v a 2s  . c o m*/
}

From source file:org.jacoco.core.internal.analysis.ContentTypeDetector.java

License:Open Source License

private static int determineType(final InputStream in) throws IOException {
    switch (readInt(in)) {
    case ZIPFILE:
        return ZIPFILE;
    case CLASSFILE:
        // also verify version to distinguish from Mach Object files:
        switch (readInt(in)) {
        case Opcodes.V1_1:
        case Opcodes.V1_2:
        case Opcodes.V1_3:
        case Opcodes.V1_4:
        case Opcodes.V1_5:
        case Opcodes.V1_6:
        case Opcodes.V1_7:
            return CLASSFILE;
        }/*  w  ww  .java 2  s.  c o  m*/
    }
    return UNKNOWN;
}

From source file:org.jacoco.core.internal.ContentTypeDetector.java

License:Open Source License

private static int determineType(final InputStream in) throws IOException {
    final int header = readInt(in);
    switch (header) {
    case ZIPFILE:
        return ZIPFILE;
    case PACK200FILE:
        return PACK200FILE;
    case CLASSFILE:
        // also verify version to distinguish from Mach Object files:
        switch (readInt(in)) {
        case Opcodes.V1_1:
        case Opcodes.V1_2:
        case Opcodes.V1_3:
        case Opcodes.V1_4:
        case Opcodes.V1_5:
        case Opcodes.V1_6:
        case Opcodes.V1_7:
            return CLASSFILE;
        }//from ww w.  j av a2s .co  m
    }
    if ((header & 0xffff0000) == GZFILE) {
        return GZFILE;
    }
    return UNKNOWN;
}

From source file:org.jacoco.core.internal.instr.ProbeArrayStrategyFactoryTest.java

License:Open Source License

@Test
public void testClass1() {
    final IProbeArrayStrategy strategy = test(Opcodes.V1_1, 0, false, true, true);
    assertEquals(ClassFieldProbeArrayStrategy.class, strategy.getClass());
    assertDataField(InstrSupport.DATAFIELD_ACC);
    assertInitMethod(false);//from w ww .j a  v  a2s .  c  om
}

From source file:scouter.agent.AgentTransformer.java

License:Apache License

private ClassWriter getClassWriter(final ClassDesc classDesc) {
    ClassWriter cw;//  ww w .  j av a  2s .c o  m
    switch (classDesc.version) {
    case Opcodes.V1_1:
    case Opcodes.V1_2:
    case Opcodes.V1_3:
    case Opcodes.V1_4:
    case Opcodes.V1_5:
    case Opcodes.V1_6:
        cw = new ScouterClassWriter(ClassWriter.COMPUTE_MAXS);
        break;
    default:
        cw = new ScouterClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
    }
    return cw;
}

From source file:se.eris.asm.AsmUtilsTest.java

License:Apache License

@Test
void asmOpcodeToJavaVersion() {
    assertEquals(1, AsmUtils.asmOpcodeToJavaVersion(Opcodes.V1_1));
    assertEquals(5, AsmUtils.asmOpcodeToJavaVersion(Opcodes.V1_5));
    assertEquals(6, AsmUtils.asmOpcodeToJavaVersion(Opcodes.V1_6));
    assertEquals(7, AsmUtils.asmOpcodeToJavaVersion(Opcodes.V1_7));
    assertEquals(8, AsmUtils.asmOpcodeToJavaVersion(Opcodes.V1_8));

    assertEquals(9, AsmUtils.asmOpcodeToJavaVersion(Opcodes.V9));
    assertEquals(10, AsmUtils.asmOpcodeToJavaVersion(Opcodes.V10));
    assertEquals(11, AsmUtils.asmOpcodeToJavaVersion(Opcodes.V11));
}