< prev index next >

src/java.base/share/classes/jdk/internal/org/objectweb/asm/commons/AnalyzerAdapter.java

Print this page
rev 47452 : imported patch jdk-new-asmv6.patch


 153      * constructor</i>. Instead, they must use the
 154      * {@link #AnalyzerAdapter(int, String, int, String, String, MethodVisitor)}
 155      * version.
 156      *
 157      * @param owner
 158      *            the owner's class name.
 159      * @param access
 160      *            the method's access flags (see {@link Opcodes}).
 161      * @param name
 162      *            the method's name.
 163      * @param desc
 164      *            the method's descriptor (see {@link Type Type}).
 165      * @param mv
 166      *            the method visitor to which this adapter delegates calls. May
 167      *            be <tt>null</tt>.
 168      * @throws IllegalStateException
 169      *             If a subclass calls this constructor.
 170      */
 171     public AnalyzerAdapter(final String owner, final int access,
 172             final String name, final String desc, final MethodVisitor mv) {
 173         this(Opcodes.ASM5, owner, access, name, desc, mv);
 174         if (getClass() != AnalyzerAdapter.class) {
 175             throw new IllegalStateException();
 176         }
 177     }
 178 
 179     /**
 180      * Creates a new {@link AnalyzerAdapter}.
 181      *
 182      * @param api
 183      *            the ASM API version implemented by this visitor. Must be one
 184      *            of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
 185      * @param owner
 186      *            the owner's class name.
 187      * @param access
 188      *            the method's access flags (see {@link Opcodes}).
 189      * @param name
 190      *            the method's name.
 191      * @param desc
 192      *            the method's descriptor (see {@link Type Type}).
 193      * @param mv
 194      *            the method visitor to which this adapter delegates calls. May
 195      *            be <tt>null</tt>.
 196      */
 197     protected AnalyzerAdapter(final int api, final String owner,
 198             final int access, final String name, final String desc,
 199             final MethodVisitor mv) {
 200         super(api, mv);
 201         this.owner = owner;
 202         locals = new ArrayList<Object>();
 203         stack = new ArrayList<Object>();
 204         uninitializedTypes = new HashMap<Object, Object>();


 673         case Opcodes.D2L:
 674             pop(2);
 675             push(Opcodes.LONG);
 676             push(Opcodes.TOP);
 677             break;
 678         case Opcodes.FALOAD:
 679             pop(2);
 680             push(Opcodes.FLOAT);
 681             break;
 682         case Opcodes.DALOAD:
 683         case Opcodes.L2D:
 684             pop(2);
 685             push(Opcodes.DOUBLE);
 686             push(Opcodes.TOP);
 687             break;
 688         case Opcodes.AALOAD:
 689             pop(1);
 690             t1 = pop();
 691             if (t1 instanceof String) {
 692                 pushDesc(((String) t1).substring(1));


 693             } else {
 694                 push("java/lang/Object");
 695             }
 696             break;
 697         case Opcodes.ISTORE:
 698         case Opcodes.FSTORE:
 699         case Opcodes.ASTORE:
 700             t1 = pop();
 701             set(iarg, t1);
 702             if (iarg > 0) {
 703                 t2 = get(iarg - 1);
 704                 if (t2 == Opcodes.LONG || t2 == Opcodes.DOUBLE) {
 705                     set(iarg - 1, Opcodes.TOP);
 706                 }
 707             }
 708             break;
 709         case Opcodes.LSTORE:
 710         case Opcodes.DSTORE:
 711             pop(1);
 712             t1 = pop();




 153      * constructor</i>. Instead, they must use the
 154      * {@link #AnalyzerAdapter(int, String, int, String, String, MethodVisitor)}
 155      * version.
 156      *
 157      * @param owner
 158      *            the owner's class name.
 159      * @param access
 160      *            the method's access flags (see {@link Opcodes}).
 161      * @param name
 162      *            the method's name.
 163      * @param desc
 164      *            the method's descriptor (see {@link Type Type}).
 165      * @param mv
 166      *            the method visitor to which this adapter delegates calls. May
 167      *            be <tt>null</tt>.
 168      * @throws IllegalStateException
 169      *             If a subclass calls this constructor.
 170      */
 171     public AnalyzerAdapter(final String owner, final int access,
 172             final String name, final String desc, final MethodVisitor mv) {
 173         this(Opcodes.ASM6, owner, access, name, desc, mv);
 174         if (getClass() != AnalyzerAdapter.class) {
 175             throw new IllegalStateException();
 176         }
 177     }
 178 
 179     /**
 180      * Creates a new {@link AnalyzerAdapter}.
 181      *
 182      * @param api
 183      *            the ASM API version implemented by this visitor. Must be one
 184      *            of {@link Opcodes#ASM4}, {@link Opcodes#ASM5} or {@link Opcodes#ASM6}.
 185      * @param owner
 186      *            the owner's class name.
 187      * @param access
 188      *            the method's access flags (see {@link Opcodes}).
 189      * @param name
 190      *            the method's name.
 191      * @param desc
 192      *            the method's descriptor (see {@link Type Type}).
 193      * @param mv
 194      *            the method visitor to which this adapter delegates calls. May
 195      *            be <tt>null</tt>.
 196      */
 197     protected AnalyzerAdapter(final int api, final String owner,
 198             final int access, final String name, final String desc,
 199             final MethodVisitor mv) {
 200         super(api, mv);
 201         this.owner = owner;
 202         locals = new ArrayList<Object>();
 203         stack = new ArrayList<Object>();
 204         uninitializedTypes = new HashMap<Object, Object>();


 673         case Opcodes.D2L:
 674             pop(2);
 675             push(Opcodes.LONG);
 676             push(Opcodes.TOP);
 677             break;
 678         case Opcodes.FALOAD:
 679             pop(2);
 680             push(Opcodes.FLOAT);
 681             break;
 682         case Opcodes.DALOAD:
 683         case Opcodes.L2D:
 684             pop(2);
 685             push(Opcodes.DOUBLE);
 686             push(Opcodes.TOP);
 687             break;
 688         case Opcodes.AALOAD:
 689             pop(1);
 690             t1 = pop();
 691             if (t1 instanceof String) {
 692                 pushDesc(((String) t1).substring(1));
 693             } else if (t1 == Opcodes.NULL) {
 694                 push(t1);
 695             } else {
 696                 push("java/lang/Object");
 697             }
 698             break;
 699         case Opcodes.ISTORE:
 700         case Opcodes.FSTORE:
 701         case Opcodes.ASTORE:
 702             t1 = pop();
 703             set(iarg, t1);
 704             if (iarg > 0) {
 705                 t2 = get(iarg - 1);
 706                 if (t2 == Opcodes.LONG || t2 == Opcodes.DOUBLE) {
 707                     set(iarg - 1, Opcodes.TOP);
 708                 }
 709             }
 710             break;
 711         case Opcodes.LSTORE:
 712         case Opcodes.DSTORE:
 713             pop(1);
 714             t1 = pop();


< prev index next >