Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.Instruction


    private ExceptionSet computeThrownExceptionTypes(BasicBlock basicBlock) throws
    DataflowAnalysisException {

        ExceptionSet exceptionTypeSet = exceptionSetFactory.createExceptionSet();
        InstructionHandle pei = basicBlock.getExceptionThrower();
        Instruction ins = pei.getInstruction();

        // Get the exceptions that BCEL knows about.
        // Note that all of these are unchecked.
        ExceptionThrower exceptionThrower = (ExceptionThrower) ins;
        Class<?>[] exceptionList = exceptionThrower.getExceptions();
View Full Code Here


    private static Map<InstructionHandle, Call> buildCallMap(CFG cfg, ConstantPoolGen cpg) {
        Map<InstructionHandle, Call> callMap = new HashMap<InstructionHandle, Call>();

        for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
            InstructionHandle handle = i.next().getHandle();
            Instruction ins = handle.getInstruction();

            if (ins instanceof InvokeInstruction) {
                InvokeInstruction inv = (InvokeInstruction) ins;
                Call call = new Call(inv.getClassName(cpg), inv.getName(cpg), inv.getSignature(cpg));
                callMap.put(handle, call);
View Full Code Here

    public boolean isStreamOpen(BasicBlock basicBlock, InstructionHandle handle, ConstantPoolGen cpg, ResourceValueFrame frame) {
        if (isOpenOnCreation) {
            return false;
        }

        Instruction ins = handle.getInstruction();
        if (!(ins instanceof INVOKESPECIAL)) {
            return false;
        }

        // Does this instruction open the stream?
View Full Code Here

                && matchMethod(inv, cpg, this.getResourceClass(), "<init>");
    }

    public static boolean mightCloseStream(BasicBlock basicBlock, InstructionHandle handle, ConstantPoolGen cpg) {

        Instruction ins = handle.getInstruction();

        if ((ins instanceof INVOKEVIRTUAL) || (ins instanceof INVOKEINTERFACE)) {
            // Does this instruction close the stream?
            InvokeInstruction inv = (InvokeInstruction) ins;
View Full Code Here

            RepositoryLookupFailureCallback lookupFailureCallback) {
        if (!mightCloseStream(basicBlock, handle, cpg)) {
            return false;
        }

        Instruction ins = handle.getInstruction();

        if ((ins instanceof INVOKEVIRTUAL) || (ins instanceof INVOKEINTERFACE)) {
            // Does this instruction close the stream?
            InvokeInstruction inv = (InvokeInstruction) ins;
View Full Code Here

    @Override
    public MatchResult match(InstructionHandle handle, ConstantPoolGen cpg, ValueNumberFrame before, ValueNumberFrame after,
            BindingSet bindingSet) throws DataflowAnalysisException {

        // Instruction must be IFNULL or IFNONNULL.
        Instruction ins = handle.getInstruction();
        if (!(ins instanceof IFNULL || ins instanceof IFNONNULL)) {
            return null;
        }

        // Ensure reference used is consistent with previous uses of
View Full Code Here

    @Override
    public Stream createStream(Location location, ObjectType type, ConstantPoolGen cpg,
            RepositoryLookupFailureCallback lookupFailureCallback) {

        try {
            Instruction ins = location.getHandle().getInstruction();

            if (ins.getOpcode() != Constants.NEW) {
                return null;
            }

            if (Hierarchy.isSubtype(type, baseClassType)) {
                boolean isUninteresting = false;
View Full Code Here

        }

        for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
            Location location = i.next();
            InstructionHandle handle = location.getHandle();
            Instruction ins = handle.getInstruction();

            if (!(ins instanceof INVOKEINTERFACE)) {
                continue;
            }
View Full Code Here

        String sourceFile = classContext.getJavaClass().getSourceFileName();

        for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
            Location location = i.next();

            Instruction ins = location.getHandle().getInstruction();
            if (!(ins instanceof InvokeInstruction)) {
                continue;
            }
            InvokeInstruction iins = (InvokeInstruction) ins;
View Full Code Here

        PointerEqualityCheckState state = PointerEqualityCheckState.INIT;
        int target = Integer.MAX_VALUE;
        Location test = null;

        for (Location loc : cfg.orderedLocations()) {
            Instruction ins = loc.getHandle().getInstruction();
            switch (state) {
            case INIT:
                assert ins instanceof org.apache.bcel.generic.NOP;
                state = PointerEqualityCheckState.START;
                break;
View Full Code Here

TOP

Related Classes of org.apache.bcel.generic.Instruction

Copyright © 2018 www.massapicom. 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.