Package org.objectweb.asm.tree

Examples of org.objectweb.asm.tree.MultiANewArrayInsnNode


          il.add(new MethodInsnNode(((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("multiANewArray")) {
          il.add(new MultiANewArrayInsnNode(((IString)((IConstructor)v).get(0)).getValue(),
                            ((IInteger)((IConstructor)v).get(1)).intValue()));
        } else if (((IConstructor)v).getName().equals("tableSwitch")) {
          IList ll = (IList)((IConstructor)v).get(3);
          LabelNode la[] = new LabelNode[ll.length()];
          for (int i = 0; i < ll.length(); i++) {
View Full Code Here


        writer.write("])");
      } else if (ai instanceof MethodInsnNode) {
        MethodInsnNode n = ((MethodInsnNode)ai);
        writer.write("\n\t\t\t\tmethod(" + n.getOpcode() + ", \"" + escape(n.owner) + "\", \"" + escape(n.name) + "\", \"" + escape(n.desc) + "\")");
      } else if (ai instanceof MultiANewArrayInsnNode) {
        MultiANewArrayInsnNode n = ((MultiANewArrayInsnNode)ai);
        writer.write("\n\t\t\t\tmultiANewArray(\"" + escape(n.desc) + "\", " + n.dims + ")");
      } else if (ai instanceof TableSwitchInsnNode) {
        TableSwitchInsnNode n = ((TableSwitchInsnNode)ai);
        writer.write("\n\t\t\t\ttableSwitch(" + n.min + ", " + n.max + ", " + getLabelIndex(n.dflt) + ", [");
        boolean firstCase = true;
        for (LabelNode l : (List<LabelNode>)n.labels) {
          if (firstCase) { firstCase = false; } else { writer.write(", "); }
          writer.write("" + getLabelIndex(l));
        }
        writer.write("])");
      } else if (ai instanceof TypeInsnNode) {
        TypeInsnNode n = ((TypeInsnNode)ai);
        writer.write("\n\t\t\t\t\\type(" + n.getOpcode() + ", \"" + escape(n.desc) + "\")");
      } else {
        if (!(ai instanceof FrameNode)) {
          throw new RuntimeException("Error: Unsupported instruction encountered (" + ai.getClass() + ").");
        }
        first = true;
View Full Code Here

        new int[0], new LabelNode[0]));
  }

  @Test
  public void testMultiANewArrayInsn() {
    testInstructionBetweenFrames(new MultiANewArrayInsnNode(
        "java/lang/String", 4));
  }
View Full Code Here

        case INVOKEDYNAMIC: {
            final InvokeDynamicInsnNode invoke = (InvokeDynamicInsnNode) insn;
            return new Invoke(Type.getReturnType(invoke.desc), values);
        }
        case MULTIANEWARRAY: {
            final MultiANewArrayInsnNode arr = (MultiANewArrayInsnNode) insn;
            return new ArrayRef(Type.getType(arr.desc), values);
        }
        default:
            throw new IllegalArgumentException("Invalid instruction opcode.");
        }
View Full Code Here

        /* new frame to indicate use of popped value */
        frame = new DefUseFrame(null, value);
        break;
       
      case MULTIANEWARRAY: {
        final MultiANewArrayInsnNode arr = (MultiANewArrayInsnNode) instruction.getInstruction();
        final ValueRef[] counts = new ValueRef[arr.dims];
        for (int i = 0; i < arr.dims; i++) {
          counts[i] = stack.pop();
        }
        stack.push(new ArrayRef(counts));
View Full Code Here

        assertEquals("B1", ((TypeInsnNode) it.next()).desc);
        assertEquals("[LD1;", ((TypeInsnNode) it.next()).desc);
        assertEquals("[I", ((TypeInsnNode) it.next()).desc);
        assertEquals("J", ((TypeInsnNode) it.next()).desc);
       
        MultiANewArrayInsnNode n3 = (MultiANewArrayInsnNode) it.next();
        assertEquals("[[LB1;", n3.desc);
       
        MethodInsnNode n4 = (MethodInsnNode) it.next();
        assertEquals("D1", n4.owner);
        assertEquals("([[LB1;LC1;LD1;)LC1;", n4.desc);
View Full Code Here

                        frame.pop();
                        canThrowException = true;
                        break;
                       
                    case MULTIANEWARRAY:
                        MultiANewArrayInsnNode minode = (MultiANewArrayInsnNode) ain;
                        int dims = minode.dims;
                        frame.popn(dims);
                        componentType = TypeDesc.getInterned(minode.desc);
                        StringBuffer sb = new StringBuffer(componentType.length()
                                + dims);
View Full Code Here

  private static boolean sameMultiANewArrayInsn(AbstractInsnNode o, AbstractInsnNode n) {
    if (!(n instanceof MultiANewArrayInsnNode)) {
      return false;
    }
    MultiANewArrayInsnNode mnao = (MultiANewArrayInsnNode) o;
    MultiANewArrayInsnNode mnan = (MultiANewArrayInsnNode) n;
    if (!mnao.desc.equals(mnan.desc)) {
      return false;
    }
    if (mnao.dims != mnan.dims) {
      return false;
View Full Code Here

                    sp--;
                    break;

                case Opcodes.MULTIANEWARRAY:
                    {
                        MultiANewArrayInsnNode m = (MultiANewArrayInsnNode)anode;
                        sp -= m.dims;
                        stack[sp++] = m.desc;
                    }
                    break;
View Full Code Here

        for (int i = 0; i < lskeys.length; i++)
          lskeys[i] = lsinsn.keys.get(i);
        visitLookupSwitchInsn(lsinsn.dflt.getLabel(), lskeys, lslables);
        break;
      case 13:
        MultiANewArrayInsnNode ainsn = (MultiANewArrayInsnNode) insn;
        visitMultiANewArrayInsn(ainsn.desc, ainsn.dims);
        break;
      case 14:
        FrameNode fnode = (FrameNode) insn;
        switch (fnode.type)
View Full Code Here

TOP

Related Classes of org.objectweb.asm.tree.MultiANewArrayInsnNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.