Examples of consumeStack()


Examples of org.apache.bcel.generic.INVOKEVIRTUAL.consumeStack()

            String methodName = inv.getName(cpg);
            String methodSig = inv.getSignature(cpg);

            if (Hierarchy.isMonitorWait(methodName, methodSig) || Hierarchy.isMonitorNotify(methodName, methodSig)) {
                int numConsumed = inv.consumeStack(cpg);
                if (numConsumed == Constants.UNPREDICTABLE) {
                    throw new DataflowAnalysisException("Unpredictable stack consumption", methodGen, handle);
                }

                ValueNumberFrame frame = vnaDataflow.getFactAtLocation(location);
View Full Code Here

Examples of org.apache.bcel.generic.IfInstruction.consumeStack()

            if (i instanceof IfInstruction) {
                IfInstruction ii = (IfInstruction) i;
                InstructionHandle target = ii.getTarget();
                InstructionHandle next = head.getNext();
                if (target.equals(next)) {
                    int consumed = ii.consumeStack(methodGen.getConstantPool());
                    if (consumed != 1 && consumed != 2) {
                        throw new IllegalStateException();
                    }
                    head.swapInstruction(consumed == 1 ? new POP() : new POP2());
                }
View Full Code Here

Examples of org.apache.bcel.generic.Instruction.consumeStack()

                    InstructionHandle lastLogHandle = handle;
                    logger.info(
                        "Found a ReturnInstruction of type: "
                            + inst.toString());
                    int stackSize =
                        inst.consumeStack(cp) - inst.produceStack(cp);
                    while (stackSize != 0) {
                        handle = handle.getPrev();
                        inst = handle.getInstruction();
                        logger.info("prev instruction: " + inst);
                        stackSize += inst.consumeStack(cp)
View Full Code Here

Examples of org.apache.bcel.generic.Instruction.consumeStack()

                        inst.consumeStack(cp) - inst.produceStack(cp);
                    while (stackSize != 0) {
                        handle = handle.getPrev();
                        inst = handle.getInstruction();
                        logger.info("prev instruction: " + inst);
                        stackSize += inst.consumeStack(cp)
                            - inst.produceStack(cp);
                    }

                    InstructionHandle insertHandle =
                        insertExit(mg, il, handle, cp);
View Full Code Here

Examples of org.apache.bcel.generic.Instruction.consumeStack()

    @Override
    public void transferInstruction(InstructionHandle handle, BasicBlock basicBlock, StackDepth fact)
            throws DataflowAnalysisException {
        Instruction ins = handle.getInstruction();
        int produced = ins.produceStack(cpg);
        int consumed = ins.consumeStack(cpg);
        if (produced == Constants.UNPREDICTABLE || consumed == Constants.UNPREDICTABLE) {
            throw new IllegalStateException("Unpredictable stack delta for instruction: " + handle);
        }
        int depth = fact.getDepth();
        depth += (produced - consumed);
View Full Code Here

Examples of org.apache.bcel.generic.Instruction.consumeStack()

            if (!frame.isValid()) {
                continue;
            }

            // Find the ValueNumber of the receiver object
            int numConsumed = ins.consumeStack(cpg);
            MethodGen methodGen = classContext.getMethodGen(method);
            assert methodGen != null;
            if (numConsumed == Constants.UNPREDICTABLE) {
                throw new DataflowAnalysisException("Unpredictable stack consumption", methodGen, handle);
            }
View Full Code Here

Examples of org.apache.bcel.generic.Instruction.consumeStack()

        InstructionHandle handle = loc.getHandle();
        Instruction ins = handle.getInstruction();
        boolean isTest = false;

        ConstantPoolGen cpg = cfg.getMethodGen().getConstantPool();
        if (ins instanceof IfInstruction && ins.consumeStack(cpg) == 2) {
            isTest = true;
        else if (ins instanceof InvokeInstruction && ins.consumeStack(cpg) == 2) {
            InvokeInstruction invoke = (InvokeInstruction) ins;
            isTest = invoke.getMethodName(cpg).equals("equals") &&invoke.getSignature(cpg).equals("(Ljava/lang/Object;)Z") ;
        }
View Full Code Here

Examples of org.apache.bcel.generic.Instruction.consumeStack()

        boolean isTest = false;

        ConstantPoolGen cpg = cfg.getMethodGen().getConstantPool();
        if (ins instanceof IfInstruction && ins.consumeStack(cpg) == 2) {
            isTest = true;
        else if (ins instanceof InvokeInstruction && ins.consumeStack(cpg) == 2) {
            InvokeInstruction invoke = (InvokeInstruction) ins;
            isTest = invoke.getMethodName(cpg).equals("equals") &&invoke.getSignature(cpg).equals("(Ljava/lang/Object;)Z") ;
        }
        if (isTest) {
            ValueNumber top = factAtLocation.getStackValue(0);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.