Package org.apache.bcel.generic

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


                        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

    @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

            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

        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

        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.