Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.LocalVariableInstruction


        if (ins instanceof StoreInstruction) {
            // Local is stored: any live stores on paths leading
            // to this instruction are now dead

            LocalVariableInstruction store = (LocalVariableInstruction) ins;
            int local = store.getIndex();
            fact.clear(local);
            fact.set(local + killedByStoreOffset);
        }

        if (ins instanceof LoadInstruction || ins instanceof IINC || ins instanceof RET) {
View Full Code Here


                    ins2[i] instanceof LocalVariableInstruction)){
                if(!ins1[i].equals(ins2[i]))
                    return false;
            }
            else{
                LocalVariableInstruction lvi1 =
                        (LocalVariableInstruction)ins1[i];
                LocalVariableInstruction lvi2 =
                        (LocalVariableInstruction)ins2[i];
                int lvindex1 = lvi1.getIndex();
                int lvindex2 = lvi2.getIndex();
                // Indexes get replaced with their index in the newLocalVars
                // array. That way, the same local vars are matched, even if
                // they have a different index.
                int nlvindex1 = -1;
                int nlvindex2 = -1;
                for(int f = 0; f < newLocalVars.length; f++){
                    if(newLocalVars[f] == lvindex1){
                        nlvindex1 = f;
                        break;
                    }
                }
                for(int f = 0; f < other.newLocalVars.length; f++){
                    if(other.newLocalVars[f] == lvindex2){
                        nlvindex2 = f;
                        break;
                    }
                }
                if(nlvindex1 != nlvindex2)
                    return false;
                lvi1.setIndex(nlvindex1);
                lvi2.setIndex(nlvindex2);
                boolean eq = lvi1.toString().equals(lvi2.toString());
                lvi1.setIndex(lvindex1);
                lvi2.setIndex(lvindex2);
                if(!eq)
                    return false;
            }
        }
        return true;
View Full Code Here

    public static void shiftLocalVariables(InstructionList il, int[] from,
            int[] to){
       
        for(InstructionHandle ih : il.getInstructionHandles()){
            if(ih.getInstruction() instanceof LocalVariableInstruction){
                LocalVariableInstruction lvi =
                        (LocalVariableInstruction)ih.getInstruction();
                for(int i = 0; i < from.length; i++){
                    if(lvi.getIndex() == from[i]){
                        lvi.setIndex(to[i]);
                        break;
                    }
                }
            }
        }
View Full Code Here

TOP

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

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.