当前位置: 首页>>代码示例>>Java>>正文


Java MethodGen.getMaxLocals方法代码示例

本文整理汇总了Java中org.apache.bcel.generic.MethodGen.getMaxLocals方法的典型用法代码示例。如果您正苦于以下问题:Java MethodGen.getMaxLocals方法的具体用法?Java MethodGen.getMaxLocals怎么用?Java MethodGen.getMaxLocals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.bcel.generic.MethodGen的用法示例。


在下文中一共展示了MethodGen.getMaxLocals方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SpawnTableEntry

import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
SpawnTableEntry(SpawnTableEntry orig, MethodGen mg, MethodGen origM) {
    isLocalUsed = new boolean[origM.getMaxLocals()];

    hasInlet = orig.hasInlet;
    if (hasInlet) {
	/* copy and rewite exception table */
	CodeExceptionGen origE[] = origM.getExceptionHandlers();
	CodeExceptionGen newE[] = mg.getExceptionHandlers();

	catchBlocks = new ArrayList<CodeExceptionGen>();

	for (int i = 0; i < orig.catchBlocks.size(); i++) {
	    CodeExceptionGen origCatch = orig.catchBlocks.get(i);
	    for (int j = 0; j < origE.length; j++) {
		if (origCatch == origE[j]) {
		    catchBlocks.add(newE[j]);
		    break;
		}
	    }
	}
    }
}
 
开发者ID:pieterhijma,项目名称:cashmere,代码行数:23,代码来源:MethodTable.java

示例2: ValueNumberAnalysis

import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
public ValueNumberAnalysis(MethodGen methodGen, DepthFirstSearch dfs,
						   LoadedFieldSet loadedFieldSet,
                           RepositoryLookupFailureCallback lookupFailureCallback) {

	super(dfs);
	this.methodGen = methodGen;
	this.factory = new ValueNumberFactory();
	this.cache = new ValueNumberCache();
	this.visitor = new ValueNumberFrameModelingVisitor(methodGen, factory, cache,
			loadedFieldSet,
	        lookupFailureCallback);

	int numLocals = methodGen.getMaxLocals();
	this.entryLocalValueList = new ValueNumber[numLocals];
	for (int i = 0; i < numLocals; ++i)
		this.entryLocalValueList[i] = factory.createFreshValue();

	this.exceptionHandlerValueNumberMap = new IdentityHashMap<BasicBlock, ValueNumber>();

	// For non-static methods, keep track of which value represents the
	// "this" reference
	if (!methodGen.isStatic())
		this.thisValue = entryLocalValueList[0];

	this.factAtLocationMap = new HashMap<Location, ValueNumberFrame>();
	this.factAfterLocationMap = new HashMap<Location, ValueNumberFrame>();
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:28,代码来源:ValueNumberAnalysis.java

示例3: insertAllDeleteLocalRecords

import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
void insertAllDeleteLocalRecords(MethodGen m) {
    int maxLocals = m.getMaxLocals();
    InstructionList il = m.getInstructionList();

    for (InstructionHandle i = il.getStart(); i != null; i = i.getNext()) {
        Instruction ins = i.getInstruction();
        if (ins instanceof ReturnInstruction) {
            i = insertDeleteLocalRecord(m, il, i, maxLocals);
        }
    }
}
 
开发者ID:pieterhijma,项目名称:cashmere,代码行数:12,代码来源:Cashmerec.java

示例4: removeUnusedLocals

import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
void removeUnusedLocals(Method mOrig, MethodGen m) {
    InstructionList il = m.getInstructionList();
    InstructionHandle[] ins = il.getInstructionHandles();
    for (int i = 0; i < ins.length; i++) {
        Instruction in = ins[i].getInstruction();

        if (in instanceof LocalVariableInstruction) {
            LocalVariableInstruction curr = (LocalVariableInstruction) in;
            if (mtab.getLocal(m, curr, ins[i].getPosition()) != null
                && curr.getIndex() < m.getMaxLocals() - 5
                && !mtab.isLocalUsedInInlet(mOrig, curr.getIndex())) {
                if (curr instanceof IINC) {
                    ins[i].setInstruction(new NOP());
                } else if (curr instanceof LSTORE || curr instanceof DSTORE) {
                    ins[i].setInstruction(new POP2());
                } else if (curr instanceof StoreInstruction) {
                    ins[i].setInstruction(new POP());
                } else if (curr instanceof ALOAD) {
                    ins[i].setInstruction(new ACONST_NULL());
                } else if (curr instanceof FLOAD) {
                    ins[i].setInstruction(new FCONST((float) 0.0));
                } else if (curr instanceof ILOAD) {
                    ins[i].setInstruction(new ICONST(0));
                } else if (curr instanceof DLOAD) {
                    ins[i].setInstruction(new DCONST(0.0));
                } else if (curr instanceof LLOAD) {
                    ins[i].setInstruction(new LCONST(0L));
                } else {
                    System.out.println("unhandled ins in "
                        + "removeUnusedLocals: " + curr);
                    System.exit(1);
                }
            }
        }
    }
}
 
开发者ID:pieterhijma,项目名称:cashmere,代码行数:37,代码来源:Cashmerec.java

示例5: ValueNumberAnalysis

import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
public ValueNumberAnalysis(MethodGen methodGen, DepthFirstSearch dfs, LoadedFieldSet loadedFieldSet,
        RepositoryLookupFailureCallback lookupFailureCallback) {

    super(dfs);
    this.methodGen = methodGen;
    this.factory = new ValueNumberFactory();
    ValueNumberCache cache = new ValueNumberCache();
    this.visitor = new ValueNumberFrameModelingVisitor(methodGen, factory, cache, loadedFieldSet, lookupFailureCallback);

    int numLocals = methodGen.getMaxLocals();
    this.entryLocalValueList = new ValueNumber[numLocals];
    for (int i = 0; i < numLocals; ++i)
        this.entryLocalValueList[i] = factory.createFreshValue();

    this.exceptionHandlerValueNumberMap = new IdentityHashMap<BasicBlock, ValueNumber>();

    // For non-static methods, keep track of which value represents the
    // "this" reference
    if (!methodGen.isStatic())
        this.thisValue = entryLocalValueList[0];

    this.factAtLocationMap = new HashMap<Location, ValueNumberFrame>();
    this.factAfterLocationMap = new HashMap<Location, ValueNumberFrame>();
    if (DEBUG)
        System.out.println("VNA Analysis " + methodGen.getClassName() + "." + methodGen.getName() + " : "
                + methodGen.getSignature());

}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:29,代码来源:ValueNumberAnalysis.java

示例6: LiveLocalStoreAnalysis

import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
public LiveLocalStoreAnalysis(MethodGen methodGen, ReverseDepthFirstSearch rdfs) {
	super(rdfs);
	this.topBit = methodGen.getMaxLocals() * 2;
	this.killedByStoreOffset = methodGen.getMaxLocals();
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:6,代码来源:LiveLocalStoreAnalysis.java

示例7: realMaxLocals

import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
static int realMaxLocals(MethodGen m) {
m.setMaxLocals();
return m.getMaxLocals();
   }
 
开发者ID:pieterhijma,项目名称:cashmere,代码行数:5,代码来源:MethodTable.java

示例8: LiveLocalStoreAnalysis

import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
public LiveLocalStoreAnalysis(MethodGen methodGen, ReverseDepthFirstSearch rdfs, DepthFirstSearch dfs) {
    super(rdfs, dfs);
    this.topBit = methodGen.getMaxLocals() * 2;
    this.killedByStoreOffset = methodGen.getMaxLocals();
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:6,代码来源:LiveLocalStoreAnalysis.java


注:本文中的org.apache.bcel.generic.MethodGen.getMaxLocals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。