本文整理汇总了Java中org.apache.bcel.generic.LocalVariableGen.getEnd方法的典型用法代码示例。如果您正苦于以下问题:Java LocalVariableGen.getEnd方法的具体用法?Java LocalVariableGen.getEnd怎么用?Java LocalVariableGen.getEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.bcel.generic.LocalVariableGen
的用法示例。
在下文中一共展示了LocalVariableGen.getEnd方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: storesIn
import org.apache.bcel.generic.LocalVariableGen; //导入方法依赖的package包/类
/** Tests whether this spawnable call stores in variables with index index.
*
* @param index The index which is tested.
* @return true if the spawnable call stores in a variable with index
* index; false otherwise.
*/
public boolean storesIn(int index, InstructionHandle ih) {
int insNo = ih.getPosition();
for (LocalVariableGen g : indicesStores) {
if (g.getIndex() == index) {
InstructionHandle end = g.getEnd();
InstructionHandle start = g.getStart();
if (start.getPrev() != null) {
start = start.getPrev();
}
if (insNo >= start.getPosition() && insNo <= end.getPosition()) {
return true;
}
}
}
return false;
}
示例2: getEndExceptionHandler
import org.apache.bcel.generic.LocalVariableGen; //导入方法依赖的package包/类
/** Returns the end of an exception handler.
*
* @param codeException The codeException which end is returned.
* @return The instructionHandle that is the end of the exception handler.
*/
public InstructionHandle getEndExceptionHandler(CodeExceptionGen codeException) {
LocalVariableGen[] localVars = getLocalVariables();
InstructionHandle startHandler = codeException.getHandlerPC();
for (LocalVariableGen localVar : localVars) {
InstructionHandle startScope = localVar.getStart();
InstructionHandle endScope = localVar.getEnd();
if (startScope == startHandler || startScope == startHandler.getNext() ||
startScope == startHandler.getNext().getNext() &&
localVar.getType().equals(codeException.getCatchType()))
return endScope.getPrev();
}
throw new Error("no end exceptionhandler...");
}
示例3: containsLoadWithIndexAfter
import org.apache.bcel.generic.LocalVariableGen; //导入方法依赖的package包/类
private boolean containsLoadWithIndexAfter(InstructionHandle ih, boolean ignoreInstructions, LocalVariableGen lg) {
InstructionHandle start = lg.getStart();
InstructionHandle prev = start.getPrev();
// The initial store is not included in the start/end range, so include the previous
// instruction if it exists.
InstructionHandle end = lg.getEnd();
int startPosition = prev != null ? prev.getPosition() : start.getPosition();
int endPosition = end.getPosition();
for (InstructionContext ic : instructions) {
InstructionHandle current = ic.getInstruction();
if (ignoreInstructions) {
ignoreInstructions = !current.equals(ih);
} else if (current.getPosition() >= startPosition && current.getPosition() <= endPosition
&& methodGen.instructionLoadsTo(current, lg.getIndex())) {
return true;
}
}
return false;
}
示例4: noAliasesLoadWithIndex
import org.apache.bcel.generic.LocalVariableGen; //导入方法依赖的package包/类
private boolean noAliasesLoadWithIndex(InstructionHandle ih, boolean ignoreInstructions, LocalVariableGen lg) {
InstructionHandle start = lg.getStart();
InstructionHandle prev = start.getPrev();
// The initial store is not included in the start/end range, so include the previous
// instruction if it exists.
InstructionHandle end = lg.getEnd();
int startPosition = prev != null ? prev.getPosition() : start.getPosition();
int endPosition = end.getPosition();
for (InstructionContext ic : instructions) {
InstructionHandle current = ic.getInstruction();
if (ignoreInstructions) {
ignoreInstructions = !current.equals(ih);
} else if (current.getPosition() >= startPosition && current.getPosition() <= endPosition
&& methodGen.instructionLoadsTo(current, lg.getIndex())) {
// OK, there is a load, but maybe it does not create an alias?
if (! methodGen.isUsedForArrayLoad(current) && ! methodGen.isUsedForArrayLength(current)
&& ! methodGen.isUsedForArrayStore(current) && ! methodGen.isUsedForPutField(current)
&& ! methodGen.isUsedForGetField(current)) {
return false;
}
}
}
return true;
}