List of usage examples for org.objectweb.asm Opcodes FLOAD
int FLOAD
To view the source code for org.objectweb.asm Opcodes FLOAD.
Click Source Link
From source file:v6.java.preverifier.PreverifierMethodNode.java
License:Open Source License
/** * Return a boolean indicating whether the specified opcode is * a floating point Opcodes./*www. ja v a2 s . c o m*/ * * @param opcode * @return */ private boolean isFloatingPointOpcode(int opcode) { boolean isFloatingPointOpcode = false; switch (opcode) { case Opcodes.FCONST_0: case Opcodes.FCONST_1: case Opcodes.FCONST_2: case Opcodes.DCONST_0: case Opcodes.DCONST_1: case Opcodes.FLOAD: case Opcodes.DLOAD: case Opcodes.FSTORE: case Opcodes.DSTORE: case Opcodes.FALOAD: case Opcodes.DALOAD: case Opcodes.FASTORE: case Opcodes.DASTORE: case Opcodes.FADD: case Opcodes.DADD: case Opcodes.FSUB: case Opcodes.DSUB: case Opcodes.FMUL: case Opcodes.DMUL: case Opcodes.FDIV: case Opcodes.DDIV: case Opcodes.FREM: case Opcodes.DREM: case Opcodes.FNEG: case Opcodes.DNEG: case Opcodes.FCMPG: case Opcodes.FCMPL: case Opcodes.DCMPG: case Opcodes.DCMPL: case Opcodes.I2F: case Opcodes.F2I: case Opcodes.I2D: case Opcodes.D2I: case Opcodes.L2F: case Opcodes.L2D: case Opcodes.F2L: case Opcodes.D2L: case Opcodes.F2D: case Opcodes.D2F: case Opcodes.FRETURN: case Opcodes.DRETURN: isFloatingPointOpcode = true; break; } return isFloatingPointOpcode; }
From source file:vazkii.quark.base.asm.ClassTransformer.java
License:Creative Commons License
private static byte[] transformRenderBoat(byte[] basicClass) { log("Transforming RenderBoat"); MethodSignature sig = new MethodSignature("doRender", "func_188300_b", "b", "(Lnet/minecraft/entity/item/EntityBoat;DDDFF)V"); return transform(basicClass, Pair.of(sig, combine((AbstractInsnNode node) -> { // Filter return (node.getOpcode() == Opcodes.INVOKEVIRTUAL || node.getOpcode() == Opcodes.INVOKEINTERFACE) && checkDesc(((MethodInsnNode) node).desc, "(Lnet/minecraft/entity/Entity;FFFFFF)V"); }, (MethodNode method, AbstractInsnNode node) -> { // Action InsnList newInstructions = new InsnList(); newInstructions.add(new VarInsnNode(Opcodes.ALOAD, 1)); newInstructions.add(new VarInsnNode(Opcodes.FLOAD, 9)); newInstructions.add(new MethodInsnNode(Opcodes.INVOKESTATIC, ASM_HOOKS, "renderBannerOnBoat", "(Lnet/minecraft/entity/item/EntityBoat;F)V")); method.instructions.insert(node, newInstructions); return true; })));/*from w w w. j a v a 2 s.co m*/ }
From source file:vazkii.quark.base.asm.ClassTransformer.java
License:Creative Commons License
private static byte[] transformRender(byte[] basicClass) { log("Transforming Render"); MethodSignature sig = new MethodSignature("renderEntityOnFire", "func_76977_a", "a", "(Lnet/minecraft/entity/Entity;DDDF)V"); return transform(basicClass, Pair.of(sig, combine((AbstractInsnNode node) -> { // Filter return true; }, (MethodNode method, AbstractInsnNode node) -> { // Action InsnList newInstructions = new InsnList(); newInstructions.add(new VarInsnNode(Opcodes.ALOAD, 1)); newInstructions.add(new VarInsnNode(Opcodes.DLOAD, 2)); newInstructions.add(new VarInsnNode(Opcodes.DLOAD, 4)); newInstructions.add(new VarInsnNode(Opcodes.DLOAD, 6)); newInstructions.add(new VarInsnNode(Opcodes.FLOAD, 8)); newInstructions.add(new MethodInsnNode(Opcodes.INVOKESTATIC, ASM_HOOKS, "renderFire", "(Lnet/minecraft/entity/Entity;DDDF)Z")); LabelNode label = new LabelNode(); newInstructions.add(new JumpInsnNode(Opcodes.IFEQ, label)); newInstructions.add(new InsnNode(Opcodes.RETURN)); newInstructions.add(label);/*from w w w . j a va2s. c om*/ method.instructions.insertBefore(node, newInstructions); return true; }))); }