List of usage examples for org.objectweb.asm Opcodes F_NEW
int F_NEW
To view the source code for org.objectweb.asm Opcodes F_NEW.
Click Source Link
From source file:org.jacoco.core.internal.instr.ProbeVariableInserterTest.java
License:Open Source License
@Test public void testInsertProbeFrameNoFrameForLabel() { final FrameRecorder rec = new FrameRecorder(); ProbeVariableInserter i = new ProbeVariableInserter(0, "(J)V", rec); // The first (implicit) frame: i.visitFrame(Opcodes.F_NEW, 2, new Object[] { "LFoo;", Opcodes.LONG }, 0, new Object[0]); // There must be a label which is a multi-jump target: Label label = new Label(); LabelInfo.setTarget(label);//from w ww. j a va2s . c om LabelInfo.setTarget(label); i.visitLabel(label); // Insert a frame for this label: i.visitFrame(Opcodes.F_NEW, 3, new Object[] { "LFoo;", Opcodes.LONG, "Ljava/lang/String;" }, 0, new Object[0]); // Try to insert a frame for a different label: rec.frame = null; i.insertProbeFrame(new Label()); assertNull(rec.frame); }
From source file:org.jacoco.core.internal.instr.ProbeVariableInserterTest.java
License:Open Source License
@Test public void testInsertProbeFrameNoMultiTarget() { final FrameRecorder rec = new FrameRecorder(); ProbeVariableInserter i = new ProbeVariableInserter(0, "(J)V", rec); // The first (implicit) frame: i.visitFrame(Opcodes.F_NEW, 2, new Object[] { "LFoo;", Opcodes.LONG }, 0, new Object[0]); // The frame for this label isn't required: Label label = new Label(); i.visitLabel(label);/*from w w w. ja v a 2s . co m*/ // Insert a frame for this label: i.visitFrame(Opcodes.F_NEW, 3, new Object[] { "LFoo;", Opcodes.LONG, "Ljava/lang/String;" }, 0, new Object[0]); // Inserting a frame for the label shouldn't work: rec.frame = null; i.insertProbeFrame(label); assertNull(rec.frame); }
From source file:org.jboss.byteman.agent.adapter.RuleGeneratorAdapter.java
License:Open Source License
public void visitFrame(final int type, final int nLocal, final Object[] local, final int nStack, final Object[] stack) { if (type != Opcodes.F_NEW) { // uncompressed frame throw new IllegalStateException("ClassReader.accept() should be called with EXPAND_FRAMES flag"); }//from w w w. ja va 2 s . c o m // dumpFrame(nLocal, local, nStack, stack); // adjust the local types array int toRemove = localTypes.size(); for (int i = toRemove; i > 0; i--) { localTypes.remove(i - 1); } int nextLocal = 0; for (int i = 0; i < nLocal; i++) { Object t = local[i]; if (t == Opcodes.TOP) { localTypes.add(null); } else if (t == null) { localTypes.add(null); } else if (t == Opcodes.INTEGER) { localTypes.add(Type.INT_TYPE); } else if (t == Opcodes.FLOAT) { localTypes.add(Type.FLOAT_TYPE); } else if (t == Opcodes.DOUBLE) { localTypes.add(Type.DOUBLE_TYPE); nextLocal++; localTypes.add(null); } else if (t == Opcodes.LONG) { localTypes.add(Type.LONG_TYPE); nextLocal++; localTypes.add(null); } else if (t == Opcodes.NULL) { localTypes.add(null); } else if (t == Opcodes.UNINITIALIZED_THIS) { localTypes.add(null); } else if (t instanceof String) { localTypes.add(Type.getObjectType((String) t)); } else { localTypes.add(null); } nextLocal++; } this.nextLocal = nextLocal; mv.visitFrame(type, nLocal, local, nStack, stack); }
From source file:org.summer.aop.ltw.AuxiliaryWeaver.java
License:Open Source License
protected void visitFrame() { mv.visitFrame(Opcodes.F_NEW, frame.getLocalSize(), frame.getLocals(), frame.getStackSize(), frame.getStack()); }