本文整理汇总了Java中jdk.internal.org.objectweb.asm.Label类的典型用法代码示例。如果您正苦于以下问题:Java Label类的具体用法?Java Label怎么用?Java Label使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Label类属于jdk.internal.org.objectweb.asm包,在下文中一共展示了Label类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitTryCatchBlock
import jdk.internal.org.objectweb.asm.Label; //导入依赖的package包/类
@Override
public void visitTryCatchBlock(final Label start, final Label end,
final Label handler, final String type) {
buf.setLength(0);
declareLabel(start);
declareLabel(end);
declareLabel(handler);
buf.append(name).append(".visitTryCatchBlock(");
appendLabel(start);
buf.append(", ");
appendLabel(end);
buf.append(", ");
appendLabel(handler);
buf.append(", ");
appendConstant(type);
buf.append(");\n");
text.add(buf.toString());
}
示例2: read
import jdk.internal.org.objectweb.asm.Label; //导入依赖的package包/类
@Override
protected Attribute read(ClassReader cr,
int off,
int len,
char[] buf,
int codeOff,
Label[] labels)
{
// package count
int package_count = cr.readUnsignedShort(off);
off += 2;
// packages
Set<String> packages = new HashSet<>();
for (int i=0; i<package_count; i++) {
String pkg = cr.readPackage(off, buf).replace('/', '.');
packages.add(pkg);
off += 2;
}
return new ModulePackagesAttribute(packages);
}
示例3: appendOpcode
import jdk.internal.org.objectweb.asm.Label; //导入依赖的package包/类
private StringBuilder appendOpcode(final StringBuilder sb, final int opcode) {
final Label next = getNextLabel();
if (next instanceof NashornLabel) {
final int bci = next.getOffset();
if (bci != -1) {
final String bcis = "" + bci;
for (int i = 0; i < 5 - bcis.length(); i++) {
sb.append(' ');
}
sb.append(bcis);
sb.append(' ');
} else {
sb.append(" ");
}
}
return sb.append(tab2).append(OPCODES[opcode].toLowerCase());
}
示例4: visitLocalVariable
import jdk.internal.org.objectweb.asm.Label; //导入依赖的package包/类
@Override
public void visitLocalVariable(final String name, final String desc,
final String signature, final Label start, final Label end,
final int index) {
buf.setLength(0);
buf.append(this.name).append(".visitLocalVariable(");
appendConstant(name);
buf.append(", ");
appendConstant(desc);
buf.append(", ");
appendConstant(signature);
buf.append(", ");
appendLabel(start);
buf.append(", ");
appendLabel(end);
buf.append(", ").append(index).append(");\n");
text.add(buf.toString());
}
示例5: visitLocalVariable
import jdk.internal.org.objectweb.asm.Label; //导入依赖的package包/类
@Override
public void visitLocalVariable(final String name, final String desc,
final String signature, final Label start, final Label end,
final int index) {
checkStartCode();
checkEndCode();
checkUnqualifiedName(version, name, "name");
checkDesc(desc, false);
checkLabel(start, true, "start label");
checkLabel(end, true, "end label");
checkUnsignedShort(index, "Invalid variable index");
int s = labels.get(start).intValue();
int e = labels.get(end).intValue();
if (e < s) {
throw new IllegalArgumentException(
"Invalid start and end labels (end must be greater than start)");
}
super.visitLocalVariable(name, desc, signature, start, end, index);
}
示例6: visitTableSwitchInsn
import jdk.internal.org.objectweb.asm.Label; //导入依赖的package包/类
@Override
public void visitTableSwitchInsn(final int min, final int max,
final Label dflt, final Label... labels) {
checkStartCode();
checkEndCode();
if (max < min) {
throw new IllegalArgumentException("Max = " + max
+ " must be greater than or equal to min = " + min);
}
checkLabel(dflt, false, "default label");
checkNonDebugLabel(dflt);
if (labels == null || labels.length != max - min + 1) {
throw new IllegalArgumentException(
"There must be max - min + 1 labels");
}
for (int i = 0; i < labels.length; ++i) {
checkLabel(labels[i], false, "label at index " + i);
checkNonDebugLabel(labels[i]);
}
super.visitTableSwitchInsn(min, max, dflt, labels);
for (int i = 0; i < labels.length; ++i) {
usedLabels.add(labels[i]);
}
++insnCount;
}
示例7: visitMaxs
import jdk.internal.org.objectweb.asm.Label; //导入依赖的package包/类
@Override
public void visitMaxs(final int maxStack, final int maxLocals) {
checkStartCode();
checkEndCode();
endCode = true;
for (Label l : usedLabels) {
if (labels.get(l) == null) {
throw new IllegalStateException("Undefined label used");
}
}
for (int i = 0; i < handlers.size();) {
Integer start = labels.get(handlers.get(i++));
Integer end = labels.get(handlers.get(i++));
if (start == null || end == null) {
throw new IllegalStateException(
"Undefined try catch block labels");
}
if (end.intValue() <= start.intValue()) {
throw new IllegalStateException(
"Emty try catch block handler range");
}
}
checkUnsignedShort(maxStack, "Invalid max stack");
checkUnsignedShort(maxLocals, "Invalid max locals");
super.visitMaxs(maxStack, maxLocals);
}
示例8: visitTryCatchBlock
import jdk.internal.org.objectweb.asm.Label; //导入依赖的package包/类
@Override
public void visitTryCatchBlock(final Label start, final Label end,
final Label handler, final String type) {
checkStartCode();
checkEndCode();
checkLabel(start, false, "start label");
checkLabel(end, false, "end label");
checkLabel(handler, false, "handler label");
checkNonDebugLabel(start);
checkNonDebugLabel(end);
checkNonDebugLabel(handler);
if (labels.get(start) != null || labels.get(end) != null
|| labels.get(handler) != null) {
throw new IllegalStateException(
"Try catch blocks must be visited before their labels");
}
if (type != null) {
checkInternalName(type, "type");
}
super.visitTryCatchBlock(start, end, handler, type);
handlers.add(start);
handlers.add(end);
}
示例9: visitLookupSwitchInsn
import jdk.internal.org.objectweb.asm.Label; //导入依赖的package包/类
@Override
public void visitLookupSwitchInsn(final Label dflt, final int[] keys,
final Label[] labels) {
buf.setLength(0);
for (int i = 0; i < labels.length; ++i) {
declareLabel(labels[i]);
}
declareLabel(dflt);
buf.append(name).append(".visitLookupSwitchInsn(");
appendLabel(dflt);
buf.append(", new int[] {");
for (int i = 0; i < keys.length; ++i) {
buf.append(i == 0 ? " " : ", ").append(keys[i]);
}
buf.append(" }, new Label[] {");
for (int i = 0; i < labels.length; ++i) {
buf.append(i == 0 ? " " : ", ");
appendLabel(labels[i]);
}
buf.append(" });\n");
text.add(buf.toString());
}
示例10: visitLabel
import jdk.internal.org.objectweb.asm.Label; //导入依赖的package包/类
@Override
public void visitLabel(final Label label) {
buf.setLength(0);
buf.append(ltab);
appendLabel(label);
buf.append('\n');
text.add(buf.toString());
}
示例11: visitLocalVariableAnnotation
import jdk.internal.org.objectweb.asm.Label; //导入依赖的package包/类
@Override
public AnnotationVisitor visitLocalVariableAnnotation(int typeRef,
TypePath typePath, Label[] start, Label[] end, int[] index,
String desc, boolean visible) {
AnnotationVisitor av = super.visitLocalVariableAnnotation(typeRef,
typePath, start, end, index, remapper.mapDesc(desc), visible);
return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
}
示例12: visitLocalVariable
import jdk.internal.org.objectweb.asm.Label; //导入依赖的package包/类
@Override
public void visitLocalVariable(final String name, final String desc,
final String signature, final Label start, final Label end,
final int index) {
int newIndex = remap(index, Type.getType(desc));
mv.visitLocalVariable(name, desc, signature, start, end, newIndex);
}
示例13: visitLabel
import jdk.internal.org.objectweb.asm.Label; //导入依赖的package包/类
@Override
public void visitLabel(final Label label) {
if (mv != null) {
mv.visitLabel(label);
}
if (labels == null) {
labels = new ArrayList<Label>(3);
}
labels.add(label);
}
示例14: visitJumpInsn
import jdk.internal.org.objectweb.asm.Label; //导入依赖的package包/类
@Override
public void visitJumpInsn(final int opcode, final Label label) {
mv.visitJumpInsn(opcode, label);
if (constructor) {
switch (opcode) {
case IFEQ:
case IFNE:
case IFLT:
case IFGE:
case IFGT:
case IFLE:
case IFNULL:
case IFNONNULL:
popValue();
break;
case IF_ICMPEQ:
case IF_ICMPNE:
case IF_ICMPLT:
case IF_ICMPGE:
case IF_ICMPGT:
case IF_ICMPLE:
case IF_ACMPEQ:
case IF_ACMPNE:
popValue();
popValue();
break;
case JSR:
pushValue(OTHER);
break;
}
addBranch(label);
}
}
示例15: visitJumpInsn
import jdk.internal.org.objectweb.asm.Label; //导入依赖的package包/类
@Override
public void visitJumpInsn(final int opcode, final Label label) {
if (mv != null) {
mv.visitJumpInsn(opcode, label);
}
execute(opcode, 0, null);
if (opcode == Opcodes.GOTO) {
this.locals = null;
this.stack = null;
}
}