Codota Logo
MethodWriter
Code IndexAdd Codota to your IDE (free)

How to use
MethodWriter
in
org.mvel2.asm

Best Java code snippets using org.mvel2.asm.MethodWriter (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: io.virtdata/virtdata-lib-realer

@Override
public final MethodVisitor visitMethod(final int access, final String name,
    final String desc, final String signature, final String[] exceptions) {
  return new MethodWriter(this, access, name, desc, signature,
      exceptions, compute);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

private void visitSwitchInsn(final Label dflt, final Label[] labels) {
  // Label currentBlock = this.currentBlock;
  if (currentBlock != null) {
    if (compute == FRAMES) {
      currentBlock.frame.execute(Opcodes.LOOKUPSWITCH, 0, null, null);
      // adds current ast successors
      addSuccessor(Edge.NORMAL, dflt);
      dflt.getFirst().status |= Label.TARGET;
      for (int i = 0; i < labels.length; ++i) {
        addSuccessor(Edge.NORMAL, labels[i]);
        labels[i].getFirst().status |= Label.TARGET;
      }
    }
    else {
      // updates current stack size (max stack size unchanged)
      --stackSize;
      // adds current ast successors
      addSuccessor(stackSize, dflt);
      for (int i = 0; i < labels.length; ++i) {
        addSuccessor(stackSize, labels[i]);
      }
    }
    // ends current ast
    noSuccessor();
  }
}
origin: io.virtdata/virtdata-lib-realer

int frameIndex = startFrame(f.owner.position, nLocal, nStack);
for (i = 0; nLocal > 0; ++i, --nLocal) {
  t = locals[i];
endFrame();
origin: io.virtdata/virtdata-lib-realer

    currentBlock.frame.initInputFrame(cw, access,
        Type.getArgumentTypes(descriptor), nLocal);
    visitImplicitFirstFrame();
  } else {
    if (type == Opcodes.F_NEW) {
    visitFrame(currentBlock.frame);
    visitImplicitFirstFrame();
  int frameIndex = startFrame(code.length, nLocal, nStack);
  for (int i = 0; i < nLocal; ++i) {
    if (local[i] instanceof String) {
  endFrame();
} else {
  int delta;
    stackMap.putByte(FULL_FRAME).putShort(delta).putShort(nLocal);
    for (int i = 0; i < nLocal; ++i) {
      writeFrameType(local[i]);
      writeFrameType(stack[i]);
    stackMap.putByte(SAME_FRAME_EXTENDED + nLocal).putShort(delta);
    for (int i = 0; i < nLocal; ++i) {
      writeFrameType(local[i]);
    writeFrameType(stack[0]);
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

Type[] args = Type.getArgumentTypes(descriptor);
f.initInputFrame(cw, access, args, this.maxLocals);
visitFrame(f);
  f = l.frame;
  if ((l.status & Label.STORE) != 0) {
    visitFrame(f);
      startFrame(start, 0, 1);
      frame[frameIndex++] = Frame.OBJECT
          | cw.addType("java/lang/Throwable");
      endFrame();
  findSubroutine(labels, id);
        findSubroutine(subroutine, id);
  findSubroutineSuccessors(0x1000, new Label[10], 0);
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

addSuccessor(Edge.NORMAL, label);
if (opcode != Opcodes.GOTO) {
  jsr = true;
  currentBlock.status |= Label.JSR;
  addSuccessor(stackSize + 1, label);
  addSuccessor(stackSize, label);
visitLabel(nextInsn);
noSuccessor();
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

    label = u + readUnsignedShort(b, u + 1);
    label = u + readShort(b, u + 1);
  newOffset = getNewOffset(allIndexes, allSizes, u, label);
  if (newOffset < Short.MIN_VALUE
      || newOffset > Short.MAX_VALUE) {
    newOffset = getNewOffset(allIndexes, allSizes, 0, u);
    insert = -(newOffset & 3);
  u += 4 * (readInt(b, u + 8) - readInt(b, u + 4) + 1) + 12;
  break;
case ClassWriter.LOOK_INSN:
  if (state == 1) {
    newOffset = getNewOffset(allIndexes, allSizes, 0, u);
    insert = -(newOffset & 3);
  u += 8 * readInt(b, u + 4) + 8;
  break;
case ClassWriter.WIDE_INSN:
  label = u + readUnsignedShort(b, u + 1);
  label = u + readShort(b, u + 1);
newOffset = getNewOffset(allIndexes, allSizes, u, label);
if (resize[u]) {
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

startFrame(code.length, nLocal, nStack);
for (int i = 0; i < nLocal; ++i) {
  if (local[i] instanceof String) {
endFrame();
        .putShort(nLocal);
    for (int i = 0; i < nLocal; ++i) {
      writeFrameType(local[i]);
      writeFrameType(stack[i]);
        .putShort(delta);
    for (int i = 0; i < nLocal; ++i) {
      writeFrameType(local[i]);
          .putShort(delta);
    writeFrameType(stack[0]);
    break;
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

public void visitLookupSwitchInsn(
    final Label dflt,
    final int keys[],
    final Label labels[]) {
  // adds the instruction to the bytecode of the method
  int source = code.length;
  code.putByte(Opcodes.LOOKUPSWITCH);
  code.length += (4 - code.length % 4) % 4;
  dflt.put(this, code, source, true);
  code.putInt(labels.length);
  for (int i = 0; i < labels.length; ++i) {
    code.putInt(keys[i]);
    labels[i].put(this, code, source, true);
  }
  // updates currentBlock
  visitSwitchInsn(dflt, labels);
}
origin: io.virtdata/virtdata-lib-realer

f.initInputFrame(cw, access, Type.getArgumentTypes(descriptor),
    this.maxLocals);
visitFrame(f);
  f = l.frame;
  if ((l.status & Label.STORE) != 0) {
    visitFrame(f);
      int frameIndex = startFrame(start, 0, 1);
      frame[frameIndex] = Frame.OBJECT
          | cw.addType("java/lang/Throwable");
      endFrame();
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

    noSuccessor();
visitLabel(new Label());
origin: org.mvel/mvel2

addSuccessorToCurrentBasicBlock(Edge.JUMP, label);
if (baseOpcode != Opcodes.GOTO) {
 addSuccessorToCurrentBasicBlock(relativeStackSize + 1, label);
 addSuccessorToCurrentBasicBlock(relativeStackSize, label);
 nextBasicBlock.flags |= Label.FLAG_JUMP_TARGET;
visitLabel(nextBasicBlock);
endCurrentBasicBlockWithNoSuccessor();
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

while (mb != null) {
  ++nbMethods;
  size += mb.getSize();
  mb = mb.next;
mb = firstMethod;
while (mb != null) {
  mb.put(out);
  mb = mb.next;
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

int size = getArgumentsAndReturnSizes(descriptor) >> 2;
if ((access & Opcodes.ACC_STATIC) != 0) {
  --size;
visitLabel(labels);
origin: org.mvel/mvel2

  endCurrentBasicBlockWithNoSuccessor();
 } else { // xLOAD or xSTORE
  int size = relativeStackSize + STACK_SIZE_DELTA[opcode];
visitLabel(new Label());
origin: io.virtdata/virtdata-lib-realer

visitLabel(labels);
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

public void visitInsn(final int opcode) {
  // adds the instruction to the bytecode of the method
  code.putByte(opcode);
  // update currentBlock
  // Label currentBlock = this.currentBlock;
  if (currentBlock != null) {
    if (compute == FRAMES) {
      currentBlock.frame.execute(opcode, 0, null, null);
    }
    else {
      // updates current and max stack sizes
      int size = stackSize + Frame.SIZE[opcode];
      if (size > maxStackSize) {
        maxStackSize = size;
      }
      stackSize = size;
    }
    // if opcode == ATHROW or xRETURN, ends current ast (no successor)
    if ((opcode >= Opcodes.IRETURN && opcode <= Opcodes.RETURN)
        || opcode == Opcodes.ATHROW) {
      noSuccessor();
    }
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

addSuccessor(Edge.NORMAL, label);
addSuccessor(stackSize, label);
origin: io.virtdata/virtdata-lib-realer

addSuccessor(Edge.NORMAL, label);
if (opcode != Opcodes.GOTO) {
  addSuccessor(stackSize + 1, label);
  addSuccessor(stackSize, label);
visitLabel(nextInsn);
noSuccessor();
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

public void visitTableSwitchInsn(
    final int min,
    final int max,
    final Label dflt,
    final Label labels[]) {
  // adds the instruction to the bytecode of the method
  int source = code.length;
  code.putByte(Opcodes.TABLESWITCH);
  code.length += (4 - code.length % 4) % 4;
  dflt.put(this, code, source, true);
  code.putInt(min).putInt(max);
  for (int i = 0; i < labels.length; ++i) {
    labels[i].put(this, code, source, true);
  }
  // updates currentBlock
  visitSwitchInsn(dflt, labels);
}
org.mvel2.asmMethodWriter

Javadoc

A MethodVisitor that generates a corresponding 'method_info' structure, as defined in the Java Virtual Machine Specification (JVMS).

Most used methods

  • <init>
    Constructs a new MethodWriter.
  • visitLabel
  • visitSwitchInsn
  • addSuccessor
    Adds a successor to the #currentBlock ast.
  • endFrame
    Checks if the visit of the current frame #frame is finished, and if yes, write it in the StackMapTab
  • getSize
    Returns the size of the bytecode of this method.
  • noSuccessor
    Ends the current basic ast. This method must be used in the case where the current basic ast does no
  • put
    Puts the bytecode of this method in the given byte vector.
  • startFrame
    Starts the visit of a stack map frame.
  • visitFrame
    Visits a frame that has been computed from scratch.
  • writeFrame
    Compress and writes the current frame #frame in the StackMapTable attribute.
  • writeFrameType
  • writeFrame,
  • writeFrameType,
  • writeFrameTypes,
  • addSuccessorToCurrentBasicBlock,
  • canCopyMethodAttributes,
  • collectAttributePrototypes,
  • computeAllFrames,
  • computeMaxStackAndLocal,
  • computeMethodInfoSize,
  • endCurrentBasicBlockWithNoSuccessor

Popular in Java

  • Making http requests using okhttp
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • setContentView (Activity)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now