本文整理汇总了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;
}