Search in sources :

Example 1 with StaticOperandStack

use of org.freud.analysed.classbytecode.method.instruction.StaticOperandStack in project freud by LMAX-Exchange.

the class AsmMethod method visitFrame.

public void visitFrame(final int type, final int nLocal, final Object[] local, final int nStack, final Object[] stack) {
    final FrameType frameType = FrameType.getFrameType(type);
    switch(frameType) {
        case F_SAME:
            currentOperandStack = AbstractOperandStack.EMPTY_STACK;
            break;
        case F_SAME1:
            currentOperandStack = new StaticOperandStack(getTypeFromFrame(stack[0]), AbstractOperandStack.EMPTY_STACK, null);
            break;
        case F_APPEND:
            currentOperandStack = AbstractOperandStack.EMPTY_STACK;
            for (int i = 0; i < nLocal; i++) {
                currentLocals.add(getTypeFromFrame(local[i]));
            }
            break;
        case F_CHOP:
            currentOperandStack = AbstractOperandStack.EMPTY_STACK;
            currentLocals = currentLocals.subList(0, currentLocals.size() - nLocal);
            break;
        case F_FULL:
            currentLocals = new ArrayList<String>();
            for (int i = 0; i < nLocal; i++) {
                currentLocals.add(getTypeFromFrame(local[i]));
            }
            currentOperandStack = AbstractOperandStack.EMPTY_STACK;
            for (int i = 0; i < nStack; i++) {
                currentOperandStack = new StaticOperandStack(getTypeFromFrame(stack[i]), currentOperandStack, null);
            }
            break;
        case F_NEW:
            break;
    }
}
Also used : StaticOperandStack(org.freud.analysed.classbytecode.method.instruction.StaticOperandStack)

Example 2 with StaticOperandStack

use of org.freud.analysed.classbytecode.method.instruction.StaticOperandStack in project freud by LMAX-Exchange.

the class AsmMethod method visitLabel.

public void visitLabel(final org.objectweb.asm.Label asmLabel) {
    final Label label = declareLabel(asmLabel);
    label.declare(instructionList.size());
    final String handledType = label.getHandledType();
    if (handledType != null) {
        currentOperandStack = new StaticOperandStack(handledType, currentOperandStack, null);
    }
}
Also used : StaticOperandStack(org.freud.analysed.classbytecode.method.instruction.StaticOperandStack) Label(org.freud.analysed.classbytecode.method.instruction.Label)

Aggregations

StaticOperandStack (org.freud.analysed.classbytecode.method.instruction.StaticOperandStack)2 Label (org.freud.analysed.classbytecode.method.instruction.Label)1