Refine search
public CodeBlock sipush(final int shortValue) { instructionList.add(new IntInsnNode(SIPUSH, shortValue)); return this; }
@Override public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) { return new IntInsnNode(opcode, operand).cloneAnnotations(this); } }
private void convertIntInsn(IntInsnNode insn) { int op = insn.getOpcode(); StackFrame frame = getFrame(insn); Operand[] out = frame.out();
final InsnList il = new InsnList(); il.add(new LdcInsnNode(this.captureId)); il.add(new LdcInsnNode(internalClassName)); il.add(new MethodInsnNode(Opcodes.INVOKESTATIC, PackageInfo.getNameWithSlash(CaptureUtil.class), il.add(new IntInsnNode(Opcodes.BIPUSH, argTypes.length)); il.add(new IntInsnNode(Opcodes.BIPUSH, i));
@Override public void visitIntInsn(int opcode, int operand) { node = new IntInsnNode(opcode, operand); super.visitIntInsn(opcode, operand); }
private void createVarFieldArray(RuleMethod method, InsnList instructions, AbstractInsnNode ret) { int count = method.getLocalVarVariables().size(); // stack: instructions.insertBefore(ret, new IntInsnNode(BIPUSH, count)); // stack: <length> instructions.insertBefore(ret, new TypeInsnNode(ANEWARRAY, VAR.getInternalName())); // stack: <array> for (int i = 0; i < count; i++) { LocalVariableNode var = method.getLocalVarVariables().get(i); // stack: <array> instructions.insertBefore(ret, new InsnNode(DUP)); // stack: <array> :: <array> instructions.insertBefore(ret, new IntInsnNode(BIPUSH, i)); // stack: <array> :: <array> :: <index> instructions.insertBefore(ret, new VarInsnNode(ALOAD, var.index)); // stack: <array> :: <array> :: <index> :: <var> instructions.insertBefore(ret, new InsnNode(DUP)); // stack: <array> :: <array> :: <index> :: <var> :: <var> instructions.insertBefore(ret, new LdcInsnNode(method.name + ':' + var.name)); // stack: <array> :: <array> :: <index> :: <var> :: <var> :: <varName> instructions.insertBefore(ret, new MethodInsnNode(INVOKEVIRTUAL, VAR.getInternalName(), "setName", "(Ljava/lang/String;)V", false)); // stack: <array> :: <array> :: <index> :: <var> instructions.insertBefore(ret, new InsnNode(AASTORE)); // stack: <array> } // stack: <array> }
writer.write("["); boolean first = true; for (AbstractInsnNode ai : mn.instructions.toArray()) { if (first) { first = false; } else { writer.write(","); } if (ai instanceof FieldInsnNode) { } else if (ai instanceof IntInsnNode) { IntInsnNode n = ((IntInsnNode)ai); writer.write("\n\t\t\t\tinteger(" + n.getOpcode() + ", " + n.operand + ")"); } else if (ai instanceof JumpInsnNode) { JumpInsnNode n = ((JumpInsnNode)ai);
@Override public void accept(final MethodVisitor methodVisitor) { methodVisitor.visitIntInsn(opcode, operand); acceptAnnotations(methodVisitor); }
from.getPrevious().getType() == AbstractInsnNode.INT_INSN) { IntInsnNode intNode = (IntInsnNode) from.getPrevious(); if (intNode.getPrevious() != null && isSdkVersionLookup(intNode.getPrevious())) { JumpInsnNode jumpNode = (JumpInsnNode) from; int api = intNode.operand;
InsnList buildInstructions(IList iList) { InsnList il = new InsnList(); for (IValue v : iList) { if (((IConstructor)v).getName().equals("fieldRef")) { il.add(new FieldInsnNode(((IInteger)((IConstructor)v).get(0)).intValue(), ((IString)((IConstructor)v).get(1)).getValue(), ((IString)((IConstructor)v).get(2)).getValue(), ((IString)((IConstructor)v).get(3)).getValue())); } else if (((IConstructor)v).getName().equals("increment")) { il.add(new IincInsnNode(((IInteger)((IConstructor)v).get(0)).intValue(), ((IInteger)((IConstructor)v).get(1)).intValue())); } else if (((IConstructor)v).getName().equals("instruction")) { il.add(new InsnNode(((IInteger)((IConstructor)v).get(0)).intValue())); } else if (((IConstructor)v).getName().equals("integer")) { il.add(new IntInsnNode(((IInteger)((IConstructor)v).get(0)).intValue(), ((IInteger)((IConstructor)v).get(1)).intValue())); } else if (((IConstructor)v).getName().equals("jump")) {
public static AbstractInsnNode newIntegerNode(int i) { if (i >= -1 && i <= 5) { return new InsnNode(Opcodes.ICONST_0 + i); } else if (i >= Byte.MIN_VALUE && i <= Byte.MAX_VALUE) { return new IntInsnNode(Opcodes.BIPUSH, i); } else if (i >= Short.MIN_VALUE && i <= Short.MAX_VALUE) { return new IntInsnNode(Opcodes.SIPUSH, i); } else { return new LdcInsnNode(i); } } }
@Override public void accept(final MethodVisitor mv) { mv.visitIntInsn(opcode, operand); acceptAnnotations(mv); }
from.getPrevious().getType() == AbstractInsnNode.INT_INSN) { IntInsnNode intNode = (IntInsnNode) from.getPrevious(); if (intNode.getPrevious() != null && isSdkVersionLookup(intNode.getPrevious())) { JumpInsnNode jumpNode = (JumpInsnNode) from; int api = intNode.operand;
public CodeBlock visitInsnNode(final int opcode, final int operand) { instructionList.add(new IntInsnNode(opcode, operand)); return this; }
static AbstractInsnNode getIntNode(final int value) { if ( value <= 5 && -1 <= value ) return new InsnNode(ICONST_M1 + value + 1); if ( value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE ) return new IntInsnNode(BIPUSH, value); if ( value >= Short.MIN_VALUE && value <= Short.MAX_VALUE ) return new IntInsnNode(SIPUSH, value); return new LdcInsnNode(value); }
@Override public AbstractInsnNode clone(final Map<LabelNode, LabelNode> clonedLabels) { return new IntInsnNode(opcode, operand).cloneAnnotations(this); } }
public CodeBlock visitInsnNode(final int opcode, final int operand) { instructionList.add(new IntInsnNode(opcode, operand)); return this; }
@Override public void visitIntInsn(int opcode, int operand) { node = new IntInsnNode(opcode, operand); super.visitIntInsn(opcode, operand); }
@Override public void visitIntInsn(final int opcode, final int operand) { instructions.add(new IntInsnNode(opcode, operand)); }
public static AbstractInsnNode getPushInst(int value) { if (value >= -1 && value <= 5) return new InsnNode(ICONST_M1 + value + 1); if ((value >= -128) && (value <= 127)) return new IntInsnNode(BIPUSH, value); if ((value >= -32768) && (value <= 32767)) return new IntInsnNode(SIPUSH, value); return new LdcInsnNode(value); }