Example usage for org.objectweb.asm Opcodes FSTORE

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

Introduction

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

Prototype

int FSTORE

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

Click Source Link

Usage

From source file:serianalyzer.JVMImpl.java

License:Open Source License

/**
 * @param opcode/*from   w  ww. ja v  a2 s  .c o m*/
 * @param var
 * @param s
 */
static void handleVarInsn(int opcode, int var, JVMStackState s) {
    Set<BaseType> v;
    switch (opcode) {
    case Opcodes.LLOAD:
    case Opcodes.ILOAD:
    case Opcodes.FLOAD:
    case Opcodes.DLOAD:
    case Opcodes.ALOAD:
        v = s.getVariable(var);
        if (log.isTraceEnabled()) {
            log.trace("LOAD " + opcode + "@" + var + ":" + v); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        }
        if (v == null || v.isEmpty()) {
            s.push(new BasicVariable(toType(opcode), "unknown " + var, true)); //$NON-NLS-1$
        } else if (v.size() == 1) {
            s.push(v.iterator().next());
        } else {
            Set<BaseType> alts = new HashSet<>();
            for (BaseType o : v) {
                if (o instanceof MultiAlternatives && !((MultiAlternatives) o).getAlternatives().isEmpty()) {
                    alts.addAll(((MultiAlternatives) o).getAlternatives());
                } else {
                    alts.add(o);
                }
            }
            s.push(new MultiAlternatives(alts));
        }
        break;
    case Opcodes.LSTORE:
    case Opcodes.ISTORE:
    case Opcodes.FSTORE:
    case Opcodes.DSTORE:
    case Opcodes.ASTORE:
        s.getVariable(var).add(s.pop());
        break;
    case Opcodes.RET:
        break;
    default:
        log.warn("Unimplemented opcode " + opcode); //$NON-NLS-1$
    }
}

From source file:v6.java.preverifier.PreverifierMethodNode.java

License:Open Source License

/**
 * Return a boolean indicating whether the specified opcode is
 * a floating point Opcodes.//  www. j a  v  a2s  .c o  m
 * 
 * @param opcode
 * @return
 */
private boolean isFloatingPointOpcode(int opcode) {
    boolean isFloatingPointOpcode = false;

    switch (opcode) {
    case Opcodes.FCONST_0:
    case Opcodes.FCONST_1:
    case Opcodes.FCONST_2:
    case Opcodes.DCONST_0:
    case Opcodes.DCONST_1:
    case Opcodes.FLOAD:
    case Opcodes.DLOAD:
    case Opcodes.FSTORE:
    case Opcodes.DSTORE:
    case Opcodes.FALOAD:
    case Opcodes.DALOAD:
    case Opcodes.FASTORE:
    case Opcodes.DASTORE:
    case Opcodes.FADD:
    case Opcodes.DADD:
    case Opcodes.FSUB:
    case Opcodes.DSUB:
    case Opcodes.FMUL:
    case Opcodes.DMUL:
    case Opcodes.FDIV:
    case Opcodes.DDIV:
    case Opcodes.FREM:
    case Opcodes.DREM:
    case Opcodes.FNEG:
    case Opcodes.DNEG:
    case Opcodes.FCMPG:
    case Opcodes.FCMPL:
    case Opcodes.DCMPG:
    case Opcodes.DCMPL:
    case Opcodes.I2F:
    case Opcodes.F2I:
    case Opcodes.I2D:
    case Opcodes.D2I:
    case Opcodes.L2F:
    case Opcodes.L2D:
    case Opcodes.F2L:
    case Opcodes.D2L:
    case Opcodes.F2D:
    case Opcodes.D2F:
    case Opcodes.FRETURN:
    case Opcodes.DRETURN:
        isFloatingPointOpcode = true;
        break;
    }

    return isFloatingPointOpcode;
}