本文整理了Java中org.objectweb.asm.tree.TryCatchBlockNode.<init>()
方法的一些代码示例,展示了TryCatchBlockNode.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TryCatchBlockNode.<init>()
方法的具体详情如下:
包路径:org.objectweb.asm.tree.TryCatchBlockNode
类名称:TryCatchBlockNode
方法名:<init>
[英]Constructs a new TryCatchBlockNode.
[中]构造一个新的TryCatch BlockNode。
代码示例来源:origin: kilim/kilim
void visitTryCatchBlocks(MethodVisitor mv) {
MethodFlow mf = methodFlow;
ArrayList<BasicBlock> bbs = mf.getBasicBlocks();
ArrayList<Handler> allHandlers = new ArrayList<Handler>(bbs.size() * 2);
for (BasicBlock bb : bbs) {
allHandlers.addAll(bb.handlers);
}
allHandlers = Handler.consolidate(allHandlers);
for (Handler h : allHandlers) {
new TryCatchBlockNode(mf.getLabelAt(h.from), mf.getOrCreateLabelAtPos(h.to+1), h.catchBB.startLabel, h.type).accept(mv);
}
}
代码示例来源:origin: jphp-group/jphp
new TryCatchBlockNode(tryStart, tryEnd, catchStart, Type.getInternalName(BaseBaseException.class))
);
代码示例来源:origin: qmx/jitescript
public CodeBlock visitTryCatchBlock(final LabelNode scopeStart, final LabelNode scopeEnd, final LabelNode handler,
final String exceptionType) {
tryCatchBlockList.add(new TryCatchBlockNode(scopeStart, scopeEnd, handler, exceptionType));
return this;
}
代码示例来源:origin: qmx/jitescript
public CodeBlock trycatch(final LabelNode scopeStart, final LabelNode scopeEnd, final LabelNode handler, final String exceptionType) {
tryCatchBlockList.add(new TryCatchBlockNode(scopeStart, scopeEnd, handler, exceptionType));
return this;
}
代码示例来源:origin: fge/grappa
public CodeBlock trycatch(final LabelNode scopeStart,
final LabelNode scopeEnd, final LabelNode handler,
@Nullable final String exceptionType)
{
tryCatchBlockList.add(new TryCatchBlockNode(scopeStart, scopeEnd,
handler, exceptionType));
return this;
}
代码示例来源:origin: fge/grappa
public CodeBlock visitTryCatchBlock(final LabelNode scopeStart,
final LabelNode scopeEnd, final LabelNode handler,
@Nullable final String exceptionType)
{
tryCatchBlockList.add(new TryCatchBlockNode(scopeStart, scopeEnd,
handler, exceptionType));
return this;
}
代码示例来源:origin: org.multiverse/multiverse-instrumentation
public static List<TryCatchBlockNode> cloneTryCatchBlockNodes(List<TryCatchBlockNode> originalBlocks, CloneMap cloneMap) {
List<TryCatchBlockNode> result = new LinkedList<TryCatchBlockNode>();
for (TryCatchBlockNode originalBlock : originalBlocks) {
TryCatchBlockNode clonedBlock = new TryCatchBlockNode(
cloneMap.get(originalBlock.start),
cloneMap.get(originalBlock.end),
cloneMap.get(originalBlock.handler),
originalBlock.type
);
result.add(clonedBlock);
}
return result;
}
代码示例来源:origin: org.ow2.asm/asm-debug-all
@Override
public void visitTryCatchBlock(final Label start, final Label end,
final Label handler, final String type) {
tryCatchBlocks.add(new TryCatchBlockNode(getLabelNode(start),
getLabelNode(end), getLabelNode(handler), type));
}
代码示例来源:origin: org.ow2.asm/asm-tree
@Override
public void visitTryCatchBlock(
final Label start, final Label end, final Label handler, final String type) {
tryCatchBlocks.add(
new TryCatchBlockNode(getLabelNode(start), getLabelNode(end), getLabelNode(handler), type));
}
代码示例来源:origin: org.multiverse/multiverse-instrumentation
public static List<TryCatchBlockNode> cloneTryCatchBlocks(MethodNode originalMethod, CloneMap cloneMap) {
if (originalMethod.tryCatchBlocks == null) {
return null;
}
List<TryCatchBlockNode> tryCatchBlocks = new LinkedList<TryCatchBlockNode>();
for (TryCatchBlockNode tryCatchBlockNode : (List<TryCatchBlockNode>) originalMethod.tryCatchBlocks) {
TryCatchBlockNode cloned = new TryCatchBlockNode(
cloneMap.get(tryCatchBlockNode.start),
cloneMap.get(tryCatchBlockNode.end),
cloneMap.get(tryCatchBlockNode.handler),
tryCatchBlockNode.type
);
tryCatchBlocks.add(cloned);
}
return tryCatchBlocks;
}
代码示例来源:origin: co.paralleluniverse/quasar
@SuppressWarnings("unchecked")
private void splitTryCatch(FrameInfo fi) {
for (int i = 0; i < mn.tryCatchBlocks.size(); i++) {
TryCatchBlockNode tcb = (TryCatchBlockNode) mn.tryCatchBlocks.get(i);
int start = getLabelIdx(tcb.start);
int end = getLabelIdx(tcb.end);
if (start <= fi.endInstruction && end >= fi.endInstruction) {
//System.out.println("i="+i+" start="+start+" end="+end+" split="+splitIdx+
// " start="+mn.instructions.get(start)+" end="+mn.instructions.get(end));
// need to split try/catch around the suspendable call
if (start == fi.endInstruction) {
tcb.start = fi.createAfterLabel();
} else {
if (end > fi.endInstruction) {
TryCatchBlockNode tcb2 = new TryCatchBlockNode(
fi.createAfterLabel(),
tcb.end, tcb.handler, tcb.type);
mn.tryCatchBlocks.add(i + 1, tcb2);
}
tcb.end = fi.createBeforeLabel();
}
}
}
}
代码示例来源:origin: usethesource/rascal
List<TryCatchBlockNode> buildTryCatchBlocks(IList iList) {
ArrayList<TryCatchBlockNode> al = new ArrayList<TryCatchBlockNode>();
for (IValue v : iList) {
String type = null;
if (iList.length() > 3) {
type = ((IString)((IConstructor)v).get(3)).getValue();
}
al.add(new TryCatchBlockNode(getLabel(((IInteger)((IConstructor)v).get(0)).intValue()),
getLabel(((IInteger)((IConstructor)v).get(1)).intValue()),
getLabel(((IInteger)((IConstructor)v).get(2)).intValue()),
type));
}
return al;
}
代码示例来源:origin: mjanicek/rembulan
suffix.add(resumptionHandler(l_handler_begin));
node.tryCatchBlocks.add(new TryCatchBlockNode(l_entry, l_error_state, l_handler_begin, Type.getInternalName(UnresolvedControlThrowable.class)));
代码示例来源:origin: org.ow2.asm/asm-debug-all
newTryCatchBlocks.add(new TryCatchBlockNode(start, end, handler,
trycatch.type));
代码示例来源:origin: org.ow2.asm/asm-commons
throw new AssertionError("Internal error!");
newTryCatchBlocks.add(new TryCatchBlockNode(start, end, handler, tryCatchBlockNode.type));
代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle
throw new AssertionError("Internal error!");
newTryCatchBlocks.add(new TryCatchBlockNode(start, end, handler, tryCatchBlockNode.type));
代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.framework.extension
throw new AssertionError("Internal error!");
newTryCatchBlocks.add(new TryCatchBlockNode(start, end, handler, tryCatchBlockNode.type));
代码示例来源:origin: com.github.bingoohuang/blackcat-instrument
private void addCatchBlock(LabelNode startNode, LabelNode endNode) {
val insnList = new InsnList();
val handlerNode = new LabelNode();
insnList.add(handlerNode);
int exceptionVariablePosition = getFistAvailablePosition();
insnList.add(new VarInsnNode(ASTORE, exceptionVariablePosition));
methodOffset++;
insnList.add(new VarInsnNode(ALOAD, catVarIndex));
insnList.add(new VarInsnNode(ALOAD, exceptionVariablePosition));
insnList.add(new MethodInsnNode(INVOKEVIRTUAL,
p(Blackcat.class), "uncaught",
sig(void.class, Throwable.class), false));
insnList.add(new VarInsnNode(ALOAD, exceptionVariablePosition));
insnList.add(new InsnNode(ATHROW));
methodNode.tryCatchBlocks.add(new TryCatchBlockNode(
startNode, endNode, handlerNode, "java/lang/Throwable"));
methodNode.instructions.add(insnList);
}
代码示例来源:origin: brutusin/instrumentation
private void addCatchBlock(LabelNode startNode, LabelNode endNode) {
InsnList il = new InsnList();
LabelNode handlerNode = new LabelNode();
il.add(handlerNode);
int exceptionVariablePosition = getFistAvailablePosition();
il.add(new VarInsnNode(Opcodes.ASTORE, exceptionVariablePosition));
this.methodOffset++; // Actualizamos el offset
addGetCallback(il);
il.add(new VarInsnNode(Opcodes.ALOAD, this.methodVarIndex));
il.add(new VarInsnNode(Opcodes.ALOAD, exceptionVariablePosition));
il.add(new VarInsnNode(Opcodes.ALOAD, this.executionIdIndex));
il.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL,
"org/brutusin/instrumentation/Callback", "onThrowableUncatched",
"(Ljava/lang/Object;Ljava/lang/Throwable;Ljava/lang/String;)V", false));
il.add(new VarInsnNode(Opcodes.ALOAD, exceptionVariablePosition));
il.add(new InsnNode(Opcodes.ATHROW));
TryCatchBlockNode blockNode = new TryCatchBlockNode(startNode, endNode, handlerNode, null);
this.mn.tryCatchBlocks.add(blockNode);
this.mn.instructions.add(il);
}
代码示例来源:origin: EvoSuite/evosuite
wrappingMethodNode.tryCatchBlocks.add(new TryCatchBlockNode(l0, l1, l1, "java/lang/Throwable"));
wrappingMethodNode.tryCatchBlocks.add(new TryCatchBlockNode(l0, l1, l2, "java/lang/Throwable"));
内容来源于网络,如有侵权,请联系作者删除!