本文整理了Java中org.objectweb.asm.Label.put()
方法的一些代码示例,展示了Label.put()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.put()
方法的具体详情如下:
包路径:org.objectweb.asm.Label
类名称:Label
方法名:put
[英]Puts a reference to this label in the bytecode of a method. If the bytecode offset of the label is known, the relative bytecode offset between the label and the instruction referencing it is computed and written directly. Otherwise, a null relative offset is written and a new forward reference is declared for this label.
[中]在方法的字节码中放置对此标签的引用。如果标签的字节码偏移量已知,则直接计算并写入标签和引用标签的指令之间的相对字节码偏移量。否则,将写入空相对偏移量,并为此标签声明新的正向引用。
代码示例来源:origin: org.ow2.asm/asm
@Override
public void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels) {
lastBytecodeOffset = code.length;
// Add the instruction to the bytecode of the method.
code.putByte(Opcodes.LOOKUPSWITCH).putByteArray(null, 0, (4 - code.length % 4) % 4);
dflt.put(code, lastBytecodeOffset, true);
code.putInt(labels.length);
for (int i = 0; i < labels.length; ++i) {
code.putInt(keys[i]);
labels[i].put(code, lastBytecodeOffset, true);
}
// If needed, update the maximum stack size and number of locals, and stack map frames.
visitSwitchInsn(dflt, labels);
}
代码示例来源:origin: org.ow2.asm/asm
@Override
public void visitTableSwitchInsn(
final int min, final int max, final Label dflt, final Label... labels) {
lastBytecodeOffset = code.length;
// Add the instruction to the bytecode of the method.
code.putByte(Opcodes.TABLESWITCH).putByteArray(null, 0, (4 - code.length % 4) % 4);
dflt.put(code, lastBytecodeOffset, true);
code.putInt(min).putInt(max);
for (Label label : labels) {
label.put(code, lastBytecodeOffset, true);
}
// If needed, update the maximum stack size and number of locals, and stack map frames.
visitSwitchInsn(dflt, labels);
}
代码示例来源:origin: org.ow2.asm/asm
label.put(code, code.length - 1, true);
} else if (baseOpcode != opcode) {
label.put(code, code.length - 1, true);
} else {
label.put(code, code.length - 1, false);
代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.framework.extension
@Override
public void visitTableSwitchInsn(
final int min, final int max, final Label dflt, final Label... labels) {
lastBytecodeOffset = code.length;
// Add the instruction to the bytecode of the method.
code.putByte(Opcodes.TABLESWITCH).putByteArray(null, 0, (4 - code.length % 4) % 4);
dflt.put(code, lastBytecodeOffset, true);
code.putInt(min).putInt(max);
for (Label label : labels) {
label.put(code, lastBytecodeOffset, true);
}
// If needed, update the maximum stack size and number of locals, and stack map frames.
visitSwitchInsn(dflt, labels);
}
代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.framework.extension
@Override
public void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels) {
lastBytecodeOffset = code.length;
// Add the instruction to the bytecode of the method.
code.putByte(Opcodes.LOOKUPSWITCH).putByteArray(null, 0, (4 - code.length % 4) % 4);
dflt.put(code, lastBytecodeOffset, true);
code.putInt(labels.length);
for (int i = 0; i < labels.length; ++i) {
code.putInt(keys[i]);
labels[i].put(code, lastBytecodeOffset, true);
}
// If needed, update the maximum stack size and number of locals, and stack map frames.
visitSwitchInsn(dflt, labels);
}
代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle
@Override
public void visitTableSwitchInsn(
final int min, final int max, final Label dflt, final Label... labels) {
lastBytecodeOffset = code.length;
// Add the instruction to the bytecode of the method.
code.putByte(Opcodes.TABLESWITCH).putByteArray(null, 0, (4 - code.length % 4) % 4);
dflt.put(code, lastBytecodeOffset, true);
code.putInt(min).putInt(max);
for (Label label : labels) {
label.put(code, lastBytecodeOffset, true);
}
// If needed, update the maximum stack size and number of locals, and stack map frames.
visitSwitchInsn(dflt, labels);
}
代码示例来源:origin: com.bladejava/blade-asm
@Override
public void visitTableSwitchInsn(
final int min, final int max, final Label dflt, final Label... labels) {
lastBytecodeOffset = code.length;
// Add the instruction to the bytecode of the method.
code.putByte(Opcodes.TABLESWITCH).putByteArray(null, 0, (4 - code.length % 4) % 4);
dflt.put(code, lastBytecodeOffset, true);
code.putInt(min).putInt(max);
for (Label label : labels) {
label.put(code, lastBytecodeOffset, true);
}
// If needed, update the maximum stack size and number of locals, and stack map frames.
visitSwitchInsn(dflt, labels);
}
代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle
@Override
public void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels) {
lastBytecodeOffset = code.length;
// Add the instruction to the bytecode of the method.
code.putByte(Opcodes.LOOKUPSWITCH).putByteArray(null, 0, (4 - code.length % 4) % 4);
dflt.put(code, lastBytecodeOffset, true);
code.putInt(labels.length);
for (int i = 0; i < labels.length; ++i) {
code.putInt(keys[i]);
labels[i].put(code, lastBytecodeOffset, true);
}
// If needed, update the maximum stack size and number of locals, and stack map frames.
visitSwitchInsn(dflt, labels);
}
代码示例来源:origin: com.bladejava/blade-asm
@Override
public void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels) {
lastBytecodeOffset = code.length;
// Add the instruction to the bytecode of the method.
code.putByte(Opcodes.LOOKUPSWITCH).putByteArray(null, 0, (4 - code.length % 4) % 4);
dflt.put(code, lastBytecodeOffset, true);
code.putInt(labels.length);
for (int i = 0; i < labels.length; ++i) {
code.putInt(keys[i]);
labels[i].put(code, lastBytecodeOffset, true);
}
// If needed, update the maximum stack size and number of locals, and stack map frames.
visitSwitchInsn(dflt, labels);
}
代码示例来源:origin: com.bladejava/blade-core
@Override
public void visitTableSwitchInsn(final int min, final int max,
final Label dflt, final Label... labels) {
lastCodeOffset = code.length;
// adds the instruction to the bytecode of the method
int source = code.length;
code.putByte(Opcodes.TABLESWITCH);
code.putByteArray(null, 0, (4 - code.length % 4) % 4);
dflt.put(this, code, source, true);
code.putInt(min).putInt(max);
for (int i = 0; i < labels.length; ++i) {
labels[i].put(this, code, source, true);
}
// updates currentBlock
visitSwitchInsn(dflt, labels);
}
代码示例来源:origin: org.ow2.asm/asm-debug-all
@Override
public void visitTableSwitchInsn(final int min, final int max,
final Label dflt, final Label... labels) {
lastCodeOffset = code.length;
// adds the instruction to the bytecode of the method
int source = code.length;
code.putByte(Opcodes.TABLESWITCH);
code.putByteArray(null, 0, (4 - code.length % 4) % 4);
dflt.put(this, code, source, true);
code.putInt(min).putInt(max);
for (int i = 0; i < labels.length; ++i) {
labels[i].put(this, code, source, true);
}
// updates currentBlock
visitSwitchInsn(dflt, labels);
}
代码示例来源:origin: com.bladejava/blade-core
@Override
public void visitLookupSwitchInsn(final Label dflt, final int[] keys,
final Label[] labels) {
lastCodeOffset = code.length;
// adds the instruction to the bytecode of the method
int source = code.length;
code.putByte(Opcodes.LOOKUPSWITCH);
code.putByteArray(null, 0, (4 - code.length % 4) % 4);
dflt.put(this, code, source, true);
code.putInt(labels.length);
for (int i = 0; i < labels.length; ++i) {
code.putInt(keys[i]);
labels[i].put(this, code, source, true);
}
// updates currentBlock
visitSwitchInsn(dflt, labels);
}
代码示例来源:origin: org.ow2.asm/asm-debug-all
@Override
public void visitLookupSwitchInsn(final Label dflt, final int[] keys,
final Label[] labels) {
lastCodeOffset = code.length;
// adds the instruction to the bytecode of the method
int source = code.length;
code.putByte(Opcodes.LOOKUPSWITCH);
code.putByteArray(null, 0, (4 - code.length % 4) % 4);
dflt.put(this, code, source, true);
code.putInt(labels.length);
for (int i = 0; i < labels.length; ++i) {
code.putInt(keys[i]);
labels[i].put(this, code, source, true);
}
// updates currentBlock
visitSwitchInsn(dflt, labels);
}
代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle
label.put(code, code.length - 1, true);
} else if (baseOpcode != opcode) {
label.put(code, code.length - 1, true);
} else {
label.put(code, code.length - 1, false);
代码示例来源:origin: org.ow2.asm/asm-debug-all
code.putByte(200); // GOTO_W
label.put(this, code, code.length - 1, true);
} else if (isWide) {
label.put(this, code, code.length - 1, true);
} else {
label.put(this, code, code.length - 1, false);
代码示例来源:origin: com.bladejava/blade-asm
label.put(code, code.length - 1, true);
} else if (baseOpcode != opcode) {
label.put(code, code.length - 1, true);
} else {
label.put(code, code.length - 1, false);
代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.framework.extension
label.put(code, code.length - 1, true);
} else if (baseOpcode != opcode) {
label.put(code, code.length - 1, true);
} else {
label.put(code, code.length - 1, false);
代码示例来源:origin: com.bladejava/blade-core
code.putByte(200); // GOTO_W
label.put(this, code, code.length - 1, true);
} else {
label.put(this, code, code.length - 1, false);
内容来源于网络,如有侵权,请联系作者删除!