本文整理匯總了Java中org.objectweb.asm.tree.AbstractInsnNode.getPrevious方法的典型用法代碼示例。如果您正苦於以下問題:Java AbstractInsnNode.getPrevious方法的具體用法?Java AbstractInsnNode.getPrevious怎麽用?Java AbstractInsnNode.getPrevious使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.objectweb.asm.tree.AbstractInsnNode
的用法示例。
在下文中一共展示了AbstractInsnNode.getPrevious方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: findPreviousLabel
import org.objectweb.asm.tree.AbstractInsnNode; //導入方法依賴的package包/類
public LabelNode findPreviousLabel(AbstractInsnNode node) {
while (node.getPrevious() != null) {
if (node.getPrevious() instanceof LabelNode)
return (LabelNode) node.getPrevious();
node = node.getPrevious();
}
return null;
}
示例2: getMethodTransformers
import org.objectweb.asm.tree.AbstractInsnNode; //導入方法依賴的package包/類
@Override
public MethodTransformer[] getMethodTransformers() {
MethodTransformer transformDoStitch = new MethodTransformer() {
public String getMethodName() {return CoreLoader.isObfuscated ? "c" : "doStitch";}
public String getDescName() {return "()V";}
@Override
public void transform(ClassNode classNode, MethodNode method, boolean obfuscated) {
CLTLog.info("Found method: " + method.name + " " + method.desc);
AbstractInsnNode instruction = method.instructions.getLast();
//find ProgressManager.pop
for (int i = 0; i < 5; i++) {
instruction = instruction.getPrevious();
}
InsnList toInsert = new InsnList();
//TransformerUtil.createTextureMap(stitchSlots);
toInsert.add(new VarInsnNode(ALOAD, 0)); //this
toInsert.add(new FieldInsnNode(GETFIELD, classNode.name,
obfuscated ? "field_94317_b" : "stitchSlots", "Ljava/util/List;")); //stitchSlots
toInsert.add(new MethodInsnNode(INVOKESTATIC, Type.getInternalName(TransformerUtil.class),
"createTextureMap", "(Ljava/util/List;)V", false)); //TransformerUtil.createTextureMap
method.instructions.insertBefore(instruction, toInsert);
}
};
return new MethodTransformer[] {transformDoStitch};
}
示例3: getMethodTransformers
import org.objectweb.asm.tree.AbstractInsnNode; //導入方法依賴的package包/類
@Override
public MethodTransformer[] getMethodTransformers() {
MethodTransformer transformSetupCameraTransform = new MethodTransformer() {
public String getMethodName() {return CoreLoader.isObfuscated ? "a" : "setupCameraTransform";}
public String getDescName() {return "(FI)V";}
/**
* Transforms {@link net.minecraft.client.renderer.EntityRenderer#setupCameraTransform()}
*/
public void transform(ClassNode classNode, MethodNode method, boolean obfuscated) {
CLTLog.info("Found method: " + method.name + " " + method.desc);
for (AbstractInsnNode instruction : method.instructions.toArray()) {
if (instruction.getOpcode() == TABLESWITCH) {
CLTLog.info("Found tableswitch in method " + getMethodName());
//Go back to orientCamera
for (int i = 0; i < 8+4; i++) {
instruction = instruction.getPrevious();
}
InsnList toInsert = new InsnList();
//GlStateManager.translate(0, 0, -0.05F);
toInsert.add(new InsnNode(FCONST_0)); //0
toInsert.add(new InsnNode(FCONST_0)); //0
toInsert.add(new LdcInsnNode(-0.05f)); //-0.05
toInsert.add(new MethodInsnNode(INVOKESTATIC, Type.getInternalName(GlStateManager.class),
obfuscated ? "func_179109_b" : "translate", "(FFF)V", false));
method.instructions.insertBefore(instruction, toInsert);
break;
}
}
}
};
return new MethodTransformer[] {transformSetupCameraTransform};
}
示例4: getMethodTransformers
import org.objectweb.asm.tree.AbstractInsnNode; //導入方法依賴的package包/類
@Override
public MethodTransformer[] getMethodTransformers() {
MethodTransformer transformRenderParticle = new MethodTransformer() {
@Override
public MethodName getName() {
return Names.Particle_renderParticle;
}
@Override
public void transform(ClassNode classNode, MethodNode method, boolean obfuscated) {
CLTLog.info("Found method: " + method.name + " " + method.desc);
for (AbstractInsnNode instruction : method.instructions.toArray()) {
if (instruction.getOpcode() == BIPUSH &&
instruction.getNext().getOpcode() == GETSTATIC) {
CLTLog.info("Found BIPUSH in method " + getName().all());
instruction = instruction.getPrevious();
transformParticle(classNode, method, instruction, 15);
break;
}
}
}
};
return new MethodTransformer[] {transformRenderParticle};
}
示例5: getMethodTransformers
import org.objectweb.asm.tree.AbstractInsnNode; //導入方法依賴的package包/類
@Override
public MethodTransformer[] getMethodTransformers() {
MethodTransformer transformRenderParticle = new MethodTransformer() {
@Override
public MethodName getName() {
return Names.Particle_renderParticle;
}
@Override
public void transform(ClassNode classNode, MethodNode method, boolean obfuscated) {
CLTLog.info("Found method: " + method.name + " " + method.desc);
for (AbstractInsnNode instruction : method.instructions.toArray()) {
if (instruction.getOpcode() == ANEWARRAY) {
CLTLog.info("Found ANEWARRAY in method " + getName().all());
instruction = instruction.getPrevious();
transformParticle(classNode, method, instruction, 14);
break;
}
}
}
};
return new MethodTransformer[] {transformRenderParticle};
}
示例6: transform
import org.objectweb.asm.tree.AbstractInsnNode; //導入方法依賴的package包/類
@Override
public void transform(ClassNode clazz, MethodNode method, InsnMatcher matcher) {
AbstractInsnNode ret = AsmUtils.getPreviousRealInsn(method.instructions.getLast());
AbstractInsnNode aload = ret.getPrevious();
InsnList list = new InsnList();
list.add(new TypeInsnNode(Opcodes.NEW, "com/wyverngame/anvil/api/server/action/AnvilBehaviour"));
list.add(new InsnNode(Opcodes.DUP));
method.instructions.insertBefore(aload, list);
method.instructions.insertBefore(ret, new MethodInsnNode(Opcodes.INVOKESPECIAL, "com/wyverngame/anvil/api/server/action/AnvilBehaviour", "<init>", "(Lcom/wurmonline/server/behaviours/Behaviour;)V", false));
}
示例7: getPreviousRealInsn
import org.objectweb.asm.tree.AbstractInsnNode; //導入方法依賴的package包/類
public static @Nullable AbstractInsnNode getPreviousRealInsn(AbstractInsnNode insn) {
while ((insn = insn.getPrevious()) != null && insn.getOpcode() == -1);
return insn;
}
示例8: getPreviousPseudoInsn
import org.objectweb.asm.tree.AbstractInsnNode; //導入方法依賴的package包/類
public static @Nullable AbstractInsnNode getPreviousPseudoInsn(AbstractInsnNode insn) {
while ((insn = insn.getPrevious()) != null && insn.getOpcode() != -1);
return insn;
}