Example usage for org.objectweb.asm Opcodes ACC_VOLATILE

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

Introduction

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

Prototype

int ACC_VOLATILE

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

Click Source Link

Usage

From source file:ch.sourcepond.utils.podescoin.internal.Access.java

License:Apache License

public static boolean isVolatile(final int access) {
    return (access & Opcodes.ACC_VOLATILE) != 0;
}

From source file:Client.JClassPatcher.java

License:Open Source License

private String decodeAccess(int access) {
    String res = "";

    if ((access & Opcodes.ACC_PUBLIC) == Opcodes.ACC_PUBLIC)
        res += "public ";
    if ((access & Opcodes.ACC_PRIVATE) == Opcodes.ACC_PRIVATE)
        res += "private ";
    if ((access & Opcodes.ACC_PROTECTED) == Opcodes.ACC_PROTECTED)
        res += "protected ";

    if ((access & Opcodes.ACC_STATIC) == Opcodes.ACC_STATIC)
        res += "static ";
    if ((access & Opcodes.ACC_FINAL) == Opcodes.ACC_FINAL)
        res += "final ";
    if ((access & Opcodes.ACC_VOLATILE) == Opcodes.ACC_VOLATILE)
        res += "protected ";
    if ((access & Opcodes.ACC_SYNCHRONIZED) == Opcodes.ACC_SYNCHRONIZED)
        res += "synchronized ";
    if ((access & Opcodes.ACC_ABSTRACT) == Opcodes.ACC_ABSTRACT)
        res += "abstract ";
    if ((access & Opcodes.ACC_INTERFACE) == Opcodes.ACC_INTERFACE)
        res += "interface ";

    return res;/* w ww  . j a v a 2s  . c o m*/
}

From source file:com.android.build.gradle.internal.incremental.IncrementalSupportVisitor.java

License:Apache License

/**
 * Ensures that the class contains a $change field used for referencing the IncrementalChange
 * dispatcher./*from w  w w  .  j  av  a 2 s.  c  o  m*/
 *
 * <p>Also updates package_private visibility to public so we can call into this class from
 * outside the package.
 */
@Override
public void visit(int version, int access, String name, String signature, String superName,
        String[] interfaces) {
    visitedClassName = name;
    visitedSuperName = superName;

    super.visitField(Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC | Opcodes.ACC_VOLATILE | Opcodes.ACC_SYNTHETIC
            | Opcodes.ACC_TRANSIENT, "$change", getRuntimeTypeName(CHANGE_TYPE), null, null);
    access = transformClassAccessForInstantRun(access);
    super.visit(version, access, name, signature, superName, interfaces);
}

From source file:com.android.build.gradle.internal2.incremental.IncrementalSupportVisitor.java

License:Apache License

/**
 * Ensures that the class contains a $change field used for referencing the IncrementalChange
 * dispatcher./*from w  w w. ja v a  2 s  .c o  m*/
 *
 * <p>Also updates package_private visibility to public so we can call into this class from
 * outside the package.
 *
 * <p>All classes will have a serialVersionUID added (if one does not already exist), as
 * otherwise, serialVersionUID would be different for instrumented and non-instrumented classes.
 * We do this for all classes. Due to incremental changes, there could be a class that starts
 * implementing {@link java.io.Serializable}, thus making all of its subclasses serializable as
 * well. Those subclasses might be used for persistence, and we need to make sure their
 * serialVersionUID are stable across instant run and non-instant run builds.
 */
@Override
public void visit(int version, int access, String name, String signature, String superName,
        String[] interfaces) {
    visitedClassName = name;
    visitedSuperName = superName;

    // TODO: disabled by achellies
    //        addSerialUidIfMissing();
    super.visitField(Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC | Opcodes.ACC_VOLATILE | Opcodes.ACC_SYNTHETIC
            | Opcodes.ACC_TRANSIENT, "$change", getRuntimeTypeName(CHANGE_TYPE), null, null);
    access = transformClassAccessForInstantRun(access);
    super.visit(version, access, name, signature, superName, interfaces);
}

From source file:com.facebook.buck.jvm.java.abi.AbiFilteringClassVisitorTest.java

License:Apache License

@Test
public void testNotConfusedByOtherFieldAccessFlagsIncluding() {
    testIncludesFieldWithAccess(Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC | Opcodes.ACC_VOLATILE);
}

From source file:com.facebook.buck.jvm.java.abi.AbiFilteringClassVisitorTest.java

License:Apache License

@Test
public void testNotConfusedByOtherFieldAccessFlagsExcluding() {
    testExcludesFieldWithAccess(Opcodes.ACC_PRIVATE | Opcodes.ACC_STATIC | Opcodes.ACC_VOLATILE);
}

From source file:com.facebook.buck.jvm.java.abi.AccessFlags.java

License:Apache License

/** Gets the access flag (see JVMS8 4.1, 4.5, 4.6) corresponding to the given modifier. */
private static int modifierToAccessFlag(Modifier modifier) {
    switch (modifier) {
    case PUBLIC://  w ww.  j  av a  2s .c o m
        return Opcodes.ACC_PUBLIC;
    case PROTECTED:
        return Opcodes.ACC_PROTECTED;
    case PRIVATE:
        return Opcodes.ACC_PRIVATE;
    case ABSTRACT:
        return Opcodes.ACC_ABSTRACT;
    case DEFAULT:
        return 0;
    case STATIC:
        return Opcodes.ACC_STATIC;
    case FINAL:
        return Opcodes.ACC_FINAL;
    case TRANSIENT:
        return Opcodes.ACC_TRANSIENT;
    case VOLATILE:
        return Opcodes.ACC_VOLATILE;
    case SYNCHRONIZED:
        return Opcodes.ACC_SYNCHRONIZED;
    case NATIVE:
        return Opcodes.ACC_NATIVE;
    case STRICTFP:
        return Opcodes.ACC_STRICT;
    default:
        throw new IllegalArgumentException(String.format("Unexpected modifier: %s", modifier));
    }
}

From source file:com.facebook.buck.jvm.java.abi.AccessFlagsTest.java

License:Apache License

@Test
public void testVolatileFlag() throws IOException {
    testFieldFlags("volatile", Opcodes.ACC_VOLATILE);
}

From source file:com.gargoylesoftware.js.nashorn.internal.ir.debug.NashornTextifier.java

License:Open Source License

private static void appendAccess(final StringBuilder sb, final int access) {
    if ((access & Opcodes.ACC_PUBLIC) != 0) {
        sb.append("public ");
    }//from   www .ja v  a  2 s. com
    if ((access & Opcodes.ACC_PRIVATE) != 0) {
        sb.append("private ");
    }
    if ((access & Opcodes.ACC_PROTECTED) != 0) {
        sb.append("protected ");
    }
    if ((access & Opcodes.ACC_FINAL) != 0) {
        sb.append("final ");
    }
    if ((access & Opcodes.ACC_STATIC) != 0) {
        sb.append("static ");
    }
    if ((access & Opcodes.ACC_SYNCHRONIZED) != 0) {
        sb.append("synchronized ");
    }
    if ((access & Opcodes.ACC_VOLATILE) != 0) {
        sb.append("volatile ");
    }
    if ((access & Opcodes.ACC_TRANSIENT) != 0) {
        sb.append("transient ");
    }
    if ((access & Opcodes.ACC_ABSTRACT) != 0) {
        sb.append("abstract ");
    }
    if ((access & Opcodes.ACC_STRICT) != 0) {
        sb.append("strictfp ");
    }
    if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
        sb.append("synthetic ");
    }
    if ((access & Opcodes.ACC_MANDATED) != 0) {
        sb.append("mandated ");
    }
    if ((access & Opcodes.ACC_ENUM) != 0) {
        sb.append("enum ");
    }
}

From source file:com.github.jasmo.obfuscate.FullAccessFlags.java

License:Open Source License

private int access(int access) {
    int a = Opcodes.ACC_PUBLIC;
    if ((access & Opcodes.ACC_NATIVE) != 0)
        a |= Opcodes.ACC_NATIVE;// www  .  j av  a  2 s  . co m
    if ((access & Opcodes.ACC_ABSTRACT) != 0)
        a |= Opcodes.ACC_ABSTRACT;
    if ((access & Opcodes.ACC_ANNOTATION) != 0)
        a |= Opcodes.ACC_ANNOTATION;
    if ((access & Opcodes.ACC_BRIDGE) != 0)
        a |= Opcodes.ACC_BRIDGE;
    //if ((access & Opcodes.ACC_DEPRECATED) != 0) a |= Opcodes.ACC_DEPRECATED;
    if ((access & Opcodes.ACC_ENUM) != 0)
        a |= Opcodes.ACC_ENUM;
    if ((access & Opcodes.ACC_FINAL) != 0)
        a |= Opcodes.ACC_FINAL;
    if ((access & Opcodes.ACC_INTERFACE) != 0)
        a |= Opcodes.ACC_INTERFACE;
    if ((access & Opcodes.ACC_MANDATED) != 0)
        a |= Opcodes.ACC_MANDATED;
    if ((access & Opcodes.ACC_MODULE) != 0)
        a |= Opcodes.ACC_MODULE;
    if ((access & Opcodes.ACC_OPEN) != 0)
        a |= Opcodes.ACC_OPEN;
    if ((access & Opcodes.ACC_STATIC) != 0)
        a |= Opcodes.ACC_STATIC;
    if ((access & Opcodes.ACC_STATIC_PHASE) != 0)
        a |= Opcodes.ACC_STATIC_PHASE;
    if ((access & Opcodes.ACC_STRICT) != 0)
        a |= Opcodes.ACC_STRICT;
    if ((access & Opcodes.ACC_SUPER) != 0)
        a |= Opcodes.ACC_SUPER;
    if ((access & Opcodes.ACC_SYNCHRONIZED) != 0)
        a |= Opcodes.ACC_SYNCHRONIZED;
    if ((access & Opcodes.ACC_SYNTHETIC) != 0)
        a |= Opcodes.ACC_SYNTHETIC;
    if ((access & Opcodes.ACC_TRANSIENT) != 0)
        a |= Opcodes.ACC_TRANSIENT;
    if ((access & Opcodes.ACC_TRANSITIVE) != 0)
        a |= Opcodes.ACC_TRANSITIVE;
    if ((access & Opcodes.ACC_VARARGS) != 0)
        a |= Opcodes.ACC_VARARGS;
    if ((access & Opcodes.ACC_VOLATILE) != 0)
        a |= Opcodes.ACC_VOLATILE;
    return a;
}