author | martin |
Tue, 15 Sep 2015 21:56:04 -0700 | |
changeset 32649 | 2ee9017c7597 |
parent 27195 | b33768211561 |
child 36635 | f0147be2f50f |
permissions | -rw-r--r-- |
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1 |
/* |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
3 |
* |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
4 |
* This code is free software; you can redistribute it and/or modify it |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
5 |
* under the terms of the GNU General Public License version 2 only, as |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
6 |
* published by the Free Software Foundation. Oracle designates this |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
7 |
* particular file as subject to the "Classpath" exception as provided |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
8 |
* by Oracle in the LICENSE file that accompanied this code. |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
9 |
* |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
10 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
11 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
12 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
13 |
* version 2 for more details (a copy is included in the LICENSE file that |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
14 |
* accompanied this code). |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
15 |
* |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
16 |
* You should have received a copy of the GNU General Public License version |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
17 |
* 2 along with this work; if not, write to the Free Software Foundation, |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
18 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
19 |
* |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
20 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
21 |
* or visit www.oracle.com if you need additional information or have any |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
22 |
* questions. |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
23 |
*/ |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
24 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
25 |
/* |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
26 |
* This file is available under and governed by the GNU General Public |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
27 |
* License version 2 only, as published by the Free Software Foundation. |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
28 |
* However, the following notice accompanied the original version of this |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
29 |
* file: |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
30 |
* |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
31 |
* ASM: a very small and fast Java bytecode manipulation framework |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
32 |
* Copyright (c) 2000-2011 INRIA, France Telecom |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
33 |
* All rights reserved. |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
34 |
* |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
35 |
* Redistribution and use in source and binary forms, with or without |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
36 |
* modification, are permitted provided that the following conditions |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
37 |
* are met: |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
38 |
* 1. Redistributions of source code must retain the above copyright |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
39 |
* notice, this list of conditions and the following disclaimer. |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
40 |
* 2. Redistributions in binary form must reproduce the above copyright |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
41 |
* notice, this list of conditions and the following disclaimer in the |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
42 |
* documentation and/or other materials provided with the distribution. |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
43 |
* 3. Neither the name of the copyright holders nor the names of its |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
44 |
* contributors may be used to endorse or promote products derived from |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
45 |
* this software without specific prior written permission. |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
46 |
* |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
47 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
48 |
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
49 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
50 |
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
51 |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
52 |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
53 |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
54 |
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
55 |
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
56 |
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
57 |
* THE POSSIBILITY OF SUCH DAMAGE. |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
58 |
*/ |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
59 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
60 |
package jdk.internal.org.objectweb.asm.commons; |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
61 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
62 |
import jdk.internal.org.objectweb.asm.Handle; |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
63 |
import jdk.internal.org.objectweb.asm.Label; |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
64 |
import jdk.internal.org.objectweb.asm.MethodVisitor; |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
65 |
import jdk.internal.org.objectweb.asm.Opcodes; |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
66 |
import jdk.internal.org.objectweb.asm.Type; |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
67 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
68 |
/** |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
69 |
* A {@link MethodVisitor} providing a more detailed API to generate and |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
70 |
* transform instructions. |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
71 |
* |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
72 |
* @author Eric Bruneton |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
73 |
*/ |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
74 |
public class InstructionAdapter extends MethodVisitor { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
75 |
|
32649
2ee9017c7597
8136583: Core libraries should use blessed modifier order
martin
parents:
27195
diff
changeset
|
76 |
public static final Type OBJECT_TYPE = Type.getType("Ljava/lang/Object;"); |
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
77 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
78 |
/** |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
79 |
* Creates a new {@link InstructionAdapter}. <i>Subclasses must not use this |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
80 |
* constructor</i>. Instead, they must use the |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
81 |
* {@link #InstructionAdapter(int, MethodVisitor)} version. |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
82 |
* |
17420 | 83 |
* @param mv |
84 |
* the method visitor to which this adapter delegates calls. |
|
21617
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
85 |
* @throws IllegalStateException |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
86 |
* If a subclass calls this constructor. |
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
87 |
*/ |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
88 |
public InstructionAdapter(final MethodVisitor mv) { |
17420 | 89 |
this(Opcodes.ASM5, mv); |
21617
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
90 |
if (getClass() != InstructionAdapter.class) { |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
91 |
throw new IllegalStateException(); |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
92 |
} |
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
93 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
94 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
95 |
/** |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
96 |
* Creates a new {@link InstructionAdapter}. |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
97 |
* |
17420 | 98 |
* @param api |
99 |
* the ASM API version implemented by this visitor. Must be one |
|
100 |
* of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. |
|
101 |
* @param mv |
|
102 |
* the method visitor to which this adapter delegates calls. |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
103 |
*/ |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
104 |
protected InstructionAdapter(final int api, final MethodVisitor mv) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
105 |
super(api, mv); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
106 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
107 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
108 |
@Override |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
109 |
public void visitInsn(final int opcode) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
110 |
switch (opcode) { |
17420 | 111 |
case Opcodes.NOP: |
112 |
nop(); |
|
113 |
break; |
|
114 |
case Opcodes.ACONST_NULL: |
|
115 |
aconst(null); |
|
116 |
break; |
|
117 |
case Opcodes.ICONST_M1: |
|
118 |
case Opcodes.ICONST_0: |
|
119 |
case Opcodes.ICONST_1: |
|
120 |
case Opcodes.ICONST_2: |
|
121 |
case Opcodes.ICONST_3: |
|
122 |
case Opcodes.ICONST_4: |
|
123 |
case Opcodes.ICONST_5: |
|
124 |
iconst(opcode - Opcodes.ICONST_0); |
|
125 |
break; |
|
126 |
case Opcodes.LCONST_0: |
|
127 |
case Opcodes.LCONST_1: |
|
128 |
lconst(opcode - Opcodes.LCONST_0); |
|
129 |
break; |
|
130 |
case Opcodes.FCONST_0: |
|
131 |
case Opcodes.FCONST_1: |
|
132 |
case Opcodes.FCONST_2: |
|
133 |
fconst(opcode - Opcodes.FCONST_0); |
|
134 |
break; |
|
135 |
case Opcodes.DCONST_0: |
|
136 |
case Opcodes.DCONST_1: |
|
137 |
dconst(opcode - Opcodes.DCONST_0); |
|
138 |
break; |
|
139 |
case Opcodes.IALOAD: |
|
140 |
aload(Type.INT_TYPE); |
|
141 |
break; |
|
142 |
case Opcodes.LALOAD: |
|
143 |
aload(Type.LONG_TYPE); |
|
144 |
break; |
|
145 |
case Opcodes.FALOAD: |
|
146 |
aload(Type.FLOAT_TYPE); |
|
147 |
break; |
|
148 |
case Opcodes.DALOAD: |
|
149 |
aload(Type.DOUBLE_TYPE); |
|
150 |
break; |
|
151 |
case Opcodes.AALOAD: |
|
152 |
aload(OBJECT_TYPE); |
|
153 |
break; |
|
154 |
case Opcodes.BALOAD: |
|
155 |
aload(Type.BYTE_TYPE); |
|
156 |
break; |
|
157 |
case Opcodes.CALOAD: |
|
158 |
aload(Type.CHAR_TYPE); |
|
159 |
break; |
|
160 |
case Opcodes.SALOAD: |
|
161 |
aload(Type.SHORT_TYPE); |
|
162 |
break; |
|
163 |
case Opcodes.IASTORE: |
|
164 |
astore(Type.INT_TYPE); |
|
165 |
break; |
|
166 |
case Opcodes.LASTORE: |
|
167 |
astore(Type.LONG_TYPE); |
|
168 |
break; |
|
169 |
case Opcodes.FASTORE: |
|
170 |
astore(Type.FLOAT_TYPE); |
|
171 |
break; |
|
172 |
case Opcodes.DASTORE: |
|
173 |
astore(Type.DOUBLE_TYPE); |
|
174 |
break; |
|
175 |
case Opcodes.AASTORE: |
|
176 |
astore(OBJECT_TYPE); |
|
177 |
break; |
|
178 |
case Opcodes.BASTORE: |
|
179 |
astore(Type.BYTE_TYPE); |
|
180 |
break; |
|
181 |
case Opcodes.CASTORE: |
|
182 |
astore(Type.CHAR_TYPE); |
|
183 |
break; |
|
184 |
case Opcodes.SASTORE: |
|
185 |
astore(Type.SHORT_TYPE); |
|
186 |
break; |
|
187 |
case Opcodes.POP: |
|
188 |
pop(); |
|
189 |
break; |
|
190 |
case Opcodes.POP2: |
|
191 |
pop2(); |
|
192 |
break; |
|
193 |
case Opcodes.DUP: |
|
194 |
dup(); |
|
195 |
break; |
|
196 |
case Opcodes.DUP_X1: |
|
197 |
dupX1(); |
|
198 |
break; |
|
199 |
case Opcodes.DUP_X2: |
|
200 |
dupX2(); |
|
201 |
break; |
|
202 |
case Opcodes.DUP2: |
|
203 |
dup2(); |
|
204 |
break; |
|
205 |
case Opcodes.DUP2_X1: |
|
206 |
dup2X1(); |
|
207 |
break; |
|
208 |
case Opcodes.DUP2_X2: |
|
209 |
dup2X2(); |
|
210 |
break; |
|
211 |
case Opcodes.SWAP: |
|
212 |
swap(); |
|
213 |
break; |
|
214 |
case Opcodes.IADD: |
|
215 |
add(Type.INT_TYPE); |
|
216 |
break; |
|
217 |
case Opcodes.LADD: |
|
218 |
add(Type.LONG_TYPE); |
|
219 |
break; |
|
220 |
case Opcodes.FADD: |
|
221 |
add(Type.FLOAT_TYPE); |
|
222 |
break; |
|
223 |
case Opcodes.DADD: |
|
224 |
add(Type.DOUBLE_TYPE); |
|
225 |
break; |
|
226 |
case Opcodes.ISUB: |
|
227 |
sub(Type.INT_TYPE); |
|
228 |
break; |
|
229 |
case Opcodes.LSUB: |
|
230 |
sub(Type.LONG_TYPE); |
|
231 |
break; |
|
232 |
case Opcodes.FSUB: |
|
233 |
sub(Type.FLOAT_TYPE); |
|
234 |
break; |
|
235 |
case Opcodes.DSUB: |
|
236 |
sub(Type.DOUBLE_TYPE); |
|
237 |
break; |
|
238 |
case Opcodes.IMUL: |
|
239 |
mul(Type.INT_TYPE); |
|
240 |
break; |
|
241 |
case Opcodes.LMUL: |
|
242 |
mul(Type.LONG_TYPE); |
|
243 |
break; |
|
244 |
case Opcodes.FMUL: |
|
245 |
mul(Type.FLOAT_TYPE); |
|
246 |
break; |
|
247 |
case Opcodes.DMUL: |
|
248 |
mul(Type.DOUBLE_TYPE); |
|
249 |
break; |
|
250 |
case Opcodes.IDIV: |
|
251 |
div(Type.INT_TYPE); |
|
252 |
break; |
|
253 |
case Opcodes.LDIV: |
|
254 |
div(Type.LONG_TYPE); |
|
255 |
break; |
|
256 |
case Opcodes.FDIV: |
|
257 |
div(Type.FLOAT_TYPE); |
|
258 |
break; |
|
259 |
case Opcodes.DDIV: |
|
260 |
div(Type.DOUBLE_TYPE); |
|
261 |
break; |
|
262 |
case Opcodes.IREM: |
|
263 |
rem(Type.INT_TYPE); |
|
264 |
break; |
|
265 |
case Opcodes.LREM: |
|
266 |
rem(Type.LONG_TYPE); |
|
267 |
break; |
|
268 |
case Opcodes.FREM: |
|
269 |
rem(Type.FLOAT_TYPE); |
|
270 |
break; |
|
271 |
case Opcodes.DREM: |
|
272 |
rem(Type.DOUBLE_TYPE); |
|
273 |
break; |
|
274 |
case Opcodes.INEG: |
|
275 |
neg(Type.INT_TYPE); |
|
276 |
break; |
|
277 |
case Opcodes.LNEG: |
|
278 |
neg(Type.LONG_TYPE); |
|
279 |
break; |
|
280 |
case Opcodes.FNEG: |
|
281 |
neg(Type.FLOAT_TYPE); |
|
282 |
break; |
|
283 |
case Opcodes.DNEG: |
|
284 |
neg(Type.DOUBLE_TYPE); |
|
285 |
break; |
|
286 |
case Opcodes.ISHL: |
|
287 |
shl(Type.INT_TYPE); |
|
288 |
break; |
|
289 |
case Opcodes.LSHL: |
|
290 |
shl(Type.LONG_TYPE); |
|
291 |
break; |
|
292 |
case Opcodes.ISHR: |
|
293 |
shr(Type.INT_TYPE); |
|
294 |
break; |
|
295 |
case Opcodes.LSHR: |
|
296 |
shr(Type.LONG_TYPE); |
|
297 |
break; |
|
298 |
case Opcodes.IUSHR: |
|
299 |
ushr(Type.INT_TYPE); |
|
300 |
break; |
|
301 |
case Opcodes.LUSHR: |
|
302 |
ushr(Type.LONG_TYPE); |
|
303 |
break; |
|
304 |
case Opcodes.IAND: |
|
305 |
and(Type.INT_TYPE); |
|
306 |
break; |
|
307 |
case Opcodes.LAND: |
|
308 |
and(Type.LONG_TYPE); |
|
309 |
break; |
|
310 |
case Opcodes.IOR: |
|
311 |
or(Type.INT_TYPE); |
|
312 |
break; |
|
313 |
case Opcodes.LOR: |
|
314 |
or(Type.LONG_TYPE); |
|
315 |
break; |
|
316 |
case Opcodes.IXOR: |
|
317 |
xor(Type.INT_TYPE); |
|
318 |
break; |
|
319 |
case Opcodes.LXOR: |
|
320 |
xor(Type.LONG_TYPE); |
|
321 |
break; |
|
322 |
case Opcodes.I2L: |
|
323 |
cast(Type.INT_TYPE, Type.LONG_TYPE); |
|
324 |
break; |
|
325 |
case Opcodes.I2F: |
|
326 |
cast(Type.INT_TYPE, Type.FLOAT_TYPE); |
|
327 |
break; |
|
328 |
case Opcodes.I2D: |
|
329 |
cast(Type.INT_TYPE, Type.DOUBLE_TYPE); |
|
330 |
break; |
|
331 |
case Opcodes.L2I: |
|
332 |
cast(Type.LONG_TYPE, Type.INT_TYPE); |
|
333 |
break; |
|
334 |
case Opcodes.L2F: |
|
335 |
cast(Type.LONG_TYPE, Type.FLOAT_TYPE); |
|
336 |
break; |
|
337 |
case Opcodes.L2D: |
|
338 |
cast(Type.LONG_TYPE, Type.DOUBLE_TYPE); |
|
339 |
break; |
|
340 |
case Opcodes.F2I: |
|
341 |
cast(Type.FLOAT_TYPE, Type.INT_TYPE); |
|
342 |
break; |
|
343 |
case Opcodes.F2L: |
|
344 |
cast(Type.FLOAT_TYPE, Type.LONG_TYPE); |
|
345 |
break; |
|
346 |
case Opcodes.F2D: |
|
347 |
cast(Type.FLOAT_TYPE, Type.DOUBLE_TYPE); |
|
348 |
break; |
|
349 |
case Opcodes.D2I: |
|
350 |
cast(Type.DOUBLE_TYPE, Type.INT_TYPE); |
|
351 |
break; |
|
352 |
case Opcodes.D2L: |
|
353 |
cast(Type.DOUBLE_TYPE, Type.LONG_TYPE); |
|
354 |
break; |
|
355 |
case Opcodes.D2F: |
|
356 |
cast(Type.DOUBLE_TYPE, Type.FLOAT_TYPE); |
|
357 |
break; |
|
358 |
case Opcodes.I2B: |
|
359 |
cast(Type.INT_TYPE, Type.BYTE_TYPE); |
|
360 |
break; |
|
361 |
case Opcodes.I2C: |
|
362 |
cast(Type.INT_TYPE, Type.CHAR_TYPE); |
|
363 |
break; |
|
364 |
case Opcodes.I2S: |
|
365 |
cast(Type.INT_TYPE, Type.SHORT_TYPE); |
|
366 |
break; |
|
367 |
case Opcodes.LCMP: |
|
368 |
lcmp(); |
|
369 |
break; |
|
370 |
case Opcodes.FCMPL: |
|
371 |
cmpl(Type.FLOAT_TYPE); |
|
372 |
break; |
|
373 |
case Opcodes.FCMPG: |
|
374 |
cmpg(Type.FLOAT_TYPE); |
|
375 |
break; |
|
376 |
case Opcodes.DCMPL: |
|
377 |
cmpl(Type.DOUBLE_TYPE); |
|
378 |
break; |
|
379 |
case Opcodes.DCMPG: |
|
380 |
cmpg(Type.DOUBLE_TYPE); |
|
381 |
break; |
|
382 |
case Opcodes.IRETURN: |
|
383 |
areturn(Type.INT_TYPE); |
|
384 |
break; |
|
385 |
case Opcodes.LRETURN: |
|
386 |
areturn(Type.LONG_TYPE); |
|
387 |
break; |
|
388 |
case Opcodes.FRETURN: |
|
389 |
areturn(Type.FLOAT_TYPE); |
|
390 |
break; |
|
391 |
case Opcodes.DRETURN: |
|
392 |
areturn(Type.DOUBLE_TYPE); |
|
393 |
break; |
|
394 |
case Opcodes.ARETURN: |
|
395 |
areturn(OBJECT_TYPE); |
|
396 |
break; |
|
397 |
case Opcodes.RETURN: |
|
398 |
areturn(Type.VOID_TYPE); |
|
399 |
break; |
|
400 |
case Opcodes.ARRAYLENGTH: |
|
401 |
arraylength(); |
|
402 |
break; |
|
403 |
case Opcodes.ATHROW: |
|
404 |
athrow(); |
|
405 |
break; |
|
406 |
case Opcodes.MONITORENTER: |
|
407 |
monitorenter(); |
|
408 |
break; |
|
409 |
case Opcodes.MONITOREXIT: |
|
410 |
monitorexit(); |
|
411 |
break; |
|
412 |
default: |
|
413 |
throw new IllegalArgumentException(); |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
414 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
415 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
416 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
417 |
@Override |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
418 |
public void visitIntInsn(final int opcode, final int operand) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
419 |
switch (opcode) { |
17420 | 420 |
case Opcodes.BIPUSH: |
421 |
iconst(operand); |
|
422 |
break; |
|
423 |
case Opcodes.SIPUSH: |
|
424 |
iconst(operand); |
|
425 |
break; |
|
426 |
case Opcodes.NEWARRAY: |
|
427 |
switch (operand) { |
|
428 |
case Opcodes.T_BOOLEAN: |
|
429 |
newarray(Type.BOOLEAN_TYPE); |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
430 |
break; |
17420 | 431 |
case Opcodes.T_CHAR: |
432 |
newarray(Type.CHAR_TYPE); |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
433 |
break; |
17420 | 434 |
case Opcodes.T_BYTE: |
435 |
newarray(Type.BYTE_TYPE); |
|
436 |
break; |
|
437 |
case Opcodes.T_SHORT: |
|
438 |
newarray(Type.SHORT_TYPE); |
|
439 |
break; |
|
440 |
case Opcodes.T_INT: |
|
441 |
newarray(Type.INT_TYPE); |
|
442 |
break; |
|
443 |
case Opcodes.T_FLOAT: |
|
444 |
newarray(Type.FLOAT_TYPE); |
|
445 |
break; |
|
446 |
case Opcodes.T_LONG: |
|
447 |
newarray(Type.LONG_TYPE); |
|
448 |
break; |
|
449 |
case Opcodes.T_DOUBLE: |
|
450 |
newarray(Type.DOUBLE_TYPE); |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
451 |
break; |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
452 |
default: |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
453 |
throw new IllegalArgumentException(); |
17420 | 454 |
} |
455 |
break; |
|
456 |
default: |
|
457 |
throw new IllegalArgumentException(); |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
458 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
459 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
460 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
461 |
@Override |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
462 |
public void visitVarInsn(final int opcode, final int var) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
463 |
switch (opcode) { |
17420 | 464 |
case Opcodes.ILOAD: |
465 |
load(var, Type.INT_TYPE); |
|
466 |
break; |
|
467 |
case Opcodes.LLOAD: |
|
468 |
load(var, Type.LONG_TYPE); |
|
469 |
break; |
|
470 |
case Opcodes.FLOAD: |
|
471 |
load(var, Type.FLOAT_TYPE); |
|
472 |
break; |
|
473 |
case Opcodes.DLOAD: |
|
474 |
load(var, Type.DOUBLE_TYPE); |
|
475 |
break; |
|
476 |
case Opcodes.ALOAD: |
|
477 |
load(var, OBJECT_TYPE); |
|
478 |
break; |
|
479 |
case Opcodes.ISTORE: |
|
480 |
store(var, Type.INT_TYPE); |
|
481 |
break; |
|
482 |
case Opcodes.LSTORE: |
|
483 |
store(var, Type.LONG_TYPE); |
|
484 |
break; |
|
485 |
case Opcodes.FSTORE: |
|
486 |
store(var, Type.FLOAT_TYPE); |
|
487 |
break; |
|
488 |
case Opcodes.DSTORE: |
|
489 |
store(var, Type.DOUBLE_TYPE); |
|
490 |
break; |
|
491 |
case Opcodes.ASTORE: |
|
492 |
store(var, OBJECT_TYPE); |
|
493 |
break; |
|
494 |
case Opcodes.RET: |
|
495 |
ret(var); |
|
496 |
break; |
|
497 |
default: |
|
498 |
throw new IllegalArgumentException(); |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
499 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
500 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
501 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
502 |
@Override |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
503 |
public void visitTypeInsn(final int opcode, final String type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
504 |
Type t = Type.getObjectType(type); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
505 |
switch (opcode) { |
17420 | 506 |
case Opcodes.NEW: |
507 |
anew(t); |
|
508 |
break; |
|
509 |
case Opcodes.ANEWARRAY: |
|
510 |
newarray(t); |
|
511 |
break; |
|
512 |
case Opcodes.CHECKCAST: |
|
513 |
checkcast(t); |
|
514 |
break; |
|
515 |
case Opcodes.INSTANCEOF: |
|
516 |
instanceOf(t); |
|
517 |
break; |
|
518 |
default: |
|
519 |
throw new IllegalArgumentException(); |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
520 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
521 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
522 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
523 |
@Override |
17420 | 524 |
public void visitFieldInsn(final int opcode, final String owner, |
525 |
final String name, final String desc) { |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
526 |
switch (opcode) { |
17420 | 527 |
case Opcodes.GETSTATIC: |
528 |
getstatic(owner, name, desc); |
|
529 |
break; |
|
530 |
case Opcodes.PUTSTATIC: |
|
531 |
putstatic(owner, name, desc); |
|
532 |
break; |
|
533 |
case Opcodes.GETFIELD: |
|
534 |
getfield(owner, name, desc); |
|
535 |
break; |
|
536 |
case Opcodes.PUTFIELD: |
|
537 |
putfield(owner, name, desc); |
|
538 |
break; |
|
539 |
default: |
|
540 |
throw new IllegalArgumentException(); |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
541 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
542 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
543 |
|
21617
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
544 |
@Deprecated |
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
545 |
@Override |
17420 | 546 |
public void visitMethodInsn(final int opcode, final String owner, |
547 |
final String name, final String desc) { |
|
21617
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
548 |
if (api >= Opcodes.ASM5) { |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
549 |
super.visitMethodInsn(opcode, owner, name, desc); |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
550 |
return; |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
551 |
} |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
552 |
doVisitMethodInsn(opcode, owner, name, desc, |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
553 |
opcode == Opcodes.INVOKEINTERFACE); |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
554 |
} |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
555 |
|
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
556 |
@Override |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
557 |
public void visitMethodInsn(final int opcode, final String owner, |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
558 |
final String name, final String desc, final boolean itf) { |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
559 |
if (api < Opcodes.ASM5) { |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
560 |
super.visitMethodInsn(opcode, owner, name, desc, itf); |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
561 |
return; |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
562 |
} |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
563 |
doVisitMethodInsn(opcode, owner, name, desc, itf); |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
564 |
} |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
565 |
|
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
566 |
private void doVisitMethodInsn(int opcode, final String owner, |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
567 |
final String name, final String desc, final boolean itf) { |
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
568 |
switch (opcode) { |
17420 | 569 |
case Opcodes.INVOKESPECIAL: |
21617
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
570 |
invokespecial(owner, name, desc, itf); |
17420 | 571 |
break; |
572 |
case Opcodes.INVOKEVIRTUAL: |
|
21617
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
573 |
invokevirtual(owner, name, desc, itf); |
17420 | 574 |
break; |
575 |
case Opcodes.INVOKESTATIC: |
|
21617
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
576 |
invokestatic(owner, name, desc, itf); |
17420 | 577 |
break; |
578 |
case Opcodes.INVOKEINTERFACE: |
|
579 |
invokeinterface(owner, name, desc); |
|
580 |
break; |
|
581 |
default: |
|
582 |
throw new IllegalArgumentException(); |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
583 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
584 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
585 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
586 |
@Override |
17420 | 587 |
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, |
588 |
Object... bsmArgs) { |
|
589 |
invokedynamic(name, desc, bsm, bsmArgs); |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
590 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
591 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
592 |
@Override |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
593 |
public void visitJumpInsn(final int opcode, final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
594 |
switch (opcode) { |
17420 | 595 |
case Opcodes.IFEQ: |
596 |
ifeq(label); |
|
597 |
break; |
|
598 |
case Opcodes.IFNE: |
|
599 |
ifne(label); |
|
600 |
break; |
|
601 |
case Opcodes.IFLT: |
|
602 |
iflt(label); |
|
603 |
break; |
|
604 |
case Opcodes.IFGE: |
|
605 |
ifge(label); |
|
606 |
break; |
|
607 |
case Opcodes.IFGT: |
|
608 |
ifgt(label); |
|
609 |
break; |
|
610 |
case Opcodes.IFLE: |
|
611 |
ifle(label); |
|
612 |
break; |
|
613 |
case Opcodes.IF_ICMPEQ: |
|
614 |
ificmpeq(label); |
|
615 |
break; |
|
616 |
case Opcodes.IF_ICMPNE: |
|
617 |
ificmpne(label); |
|
618 |
break; |
|
619 |
case Opcodes.IF_ICMPLT: |
|
620 |
ificmplt(label); |
|
621 |
break; |
|
622 |
case Opcodes.IF_ICMPGE: |
|
623 |
ificmpge(label); |
|
624 |
break; |
|
625 |
case Opcodes.IF_ICMPGT: |
|
626 |
ificmpgt(label); |
|
627 |
break; |
|
628 |
case Opcodes.IF_ICMPLE: |
|
629 |
ificmple(label); |
|
630 |
break; |
|
631 |
case Opcodes.IF_ACMPEQ: |
|
632 |
ifacmpeq(label); |
|
633 |
break; |
|
634 |
case Opcodes.IF_ACMPNE: |
|
635 |
ifacmpne(label); |
|
636 |
break; |
|
637 |
case Opcodes.GOTO: |
|
638 |
goTo(label); |
|
639 |
break; |
|
640 |
case Opcodes.JSR: |
|
641 |
jsr(label); |
|
642 |
break; |
|
643 |
case Opcodes.IFNULL: |
|
644 |
ifnull(label); |
|
645 |
break; |
|
646 |
case Opcodes.IFNONNULL: |
|
647 |
ifnonnull(label); |
|
648 |
break; |
|
649 |
default: |
|
650 |
throw new IllegalArgumentException(); |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
651 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
652 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
653 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
654 |
@Override |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
655 |
public void visitLabel(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
656 |
mark(label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
657 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
658 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
659 |
@Override |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
660 |
public void visitLdcInsn(final Object cst) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
661 |
if (cst instanceof Integer) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
662 |
int val = ((Integer) cst).intValue(); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
663 |
iconst(val); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
664 |
} else if (cst instanceof Byte) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
665 |
int val = ((Byte) cst).intValue(); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
666 |
iconst(val); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
667 |
} else if (cst instanceof Character) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
668 |
int val = ((Character) cst).charValue(); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
669 |
iconst(val); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
670 |
} else if (cst instanceof Short) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
671 |
int val = ((Short) cst).intValue(); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
672 |
iconst(val); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
673 |
} else if (cst instanceof Boolean) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
674 |
int val = ((Boolean) cst).booleanValue() ? 1 : 0; |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
675 |
iconst(val); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
676 |
} else if (cst instanceof Float) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
677 |
float val = ((Float) cst).floatValue(); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
678 |
fconst(val); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
679 |
} else if (cst instanceof Long) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
680 |
long val = ((Long) cst).longValue(); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
681 |
lconst(val); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
682 |
} else if (cst instanceof Double) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
683 |
double val = ((Double) cst).doubleValue(); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
684 |
dconst(val); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
685 |
} else if (cst instanceof String) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
686 |
aconst(cst); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
687 |
} else if (cst instanceof Type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
688 |
tconst((Type) cst); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
689 |
} else if (cst instanceof Handle) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
690 |
hconst((Handle) cst); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
691 |
} else { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
692 |
throw new IllegalArgumentException(); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
693 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
694 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
695 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
696 |
@Override |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
697 |
public void visitIincInsn(final int var, final int increment) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
698 |
iinc(var, increment); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
699 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
700 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
701 |
@Override |
17420 | 702 |
public void visitTableSwitchInsn(final int min, final int max, |
703 |
final Label dflt, final Label... labels) { |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
704 |
tableswitch(min, max, dflt, labels); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
705 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
706 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
707 |
@Override |
17420 | 708 |
public void visitLookupSwitchInsn(final Label dflt, final int[] keys, |
709 |
final Label[] labels) { |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
710 |
lookupswitch(dflt, keys, labels); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
711 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
712 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
713 |
@Override |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
714 |
public void visitMultiANewArrayInsn(final String desc, final int dims) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
715 |
multianewarray(desc, dims); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
716 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
717 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
718 |
// ----------------------------------------------------------------------- |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
719 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
720 |
public void nop() { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
721 |
mv.visitInsn(Opcodes.NOP); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
722 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
723 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
724 |
public void aconst(final Object cst) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
725 |
if (cst == null) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
726 |
mv.visitInsn(Opcodes.ACONST_NULL); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
727 |
} else { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
728 |
mv.visitLdcInsn(cst); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
729 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
730 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
731 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
732 |
public void iconst(final int cst) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
733 |
if (cst >= -1 && cst <= 5) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
734 |
mv.visitInsn(Opcodes.ICONST_0 + cst); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
735 |
} else if (cst >= Byte.MIN_VALUE && cst <= Byte.MAX_VALUE) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
736 |
mv.visitIntInsn(Opcodes.BIPUSH, cst); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
737 |
} else if (cst >= Short.MIN_VALUE && cst <= Short.MAX_VALUE) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
738 |
mv.visitIntInsn(Opcodes.SIPUSH, cst); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
739 |
} else { |
27195
b33768211561
8061830: [asm] refresh internal ASM version v5.0.3
ksrini
parents:
25859
diff
changeset
|
740 |
mv.visitLdcInsn(cst); |
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
741 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
742 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
743 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
744 |
public void lconst(final long cst) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
745 |
if (cst == 0L || cst == 1L) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
746 |
mv.visitInsn(Opcodes.LCONST_0 + (int) cst); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
747 |
} else { |
27195
b33768211561
8061830: [asm] refresh internal ASM version v5.0.3
ksrini
parents:
25859
diff
changeset
|
748 |
mv.visitLdcInsn(cst); |
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
749 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
750 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
751 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
752 |
public void fconst(final float cst) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
753 |
int bits = Float.floatToIntBits(cst); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
754 |
if (bits == 0L || bits == 0x3f800000 || bits == 0x40000000) { // 0..2 |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
755 |
mv.visitInsn(Opcodes.FCONST_0 + (int) cst); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
756 |
} else { |
27195
b33768211561
8061830: [asm] refresh internal ASM version v5.0.3
ksrini
parents:
25859
diff
changeset
|
757 |
mv.visitLdcInsn(cst); |
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
758 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
759 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
760 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
761 |
public void dconst(final double cst) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
762 |
long bits = Double.doubleToLongBits(cst); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
763 |
if (bits == 0L || bits == 0x3ff0000000000000L) { // +0.0d and 1.0d |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
764 |
mv.visitInsn(Opcodes.DCONST_0 + (int) cst); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
765 |
} else { |
27195
b33768211561
8061830: [asm] refresh internal ASM version v5.0.3
ksrini
parents:
25859
diff
changeset
|
766 |
mv.visitLdcInsn(cst); |
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
767 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
768 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
769 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
770 |
public void tconst(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
771 |
mv.visitLdcInsn(type); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
772 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
773 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
774 |
public void hconst(final Handle handle) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
775 |
mv.visitLdcInsn(handle); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
776 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
777 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
778 |
public void load(final int var, final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
779 |
mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), var); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
780 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
781 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
782 |
public void aload(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
783 |
mv.visitInsn(type.getOpcode(Opcodes.IALOAD)); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
784 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
785 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
786 |
public void store(final int var, final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
787 |
mv.visitVarInsn(type.getOpcode(Opcodes.ISTORE), var); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
788 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
789 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
790 |
public void astore(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
791 |
mv.visitInsn(type.getOpcode(Opcodes.IASTORE)); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
792 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
793 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
794 |
public void pop() { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
795 |
mv.visitInsn(Opcodes.POP); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
796 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
797 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
798 |
public void pop2() { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
799 |
mv.visitInsn(Opcodes.POP2); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
800 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
801 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
802 |
public void dup() { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
803 |
mv.visitInsn(Opcodes.DUP); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
804 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
805 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
806 |
public void dup2() { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
807 |
mv.visitInsn(Opcodes.DUP2); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
808 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
809 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
810 |
public void dupX1() { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
811 |
mv.visitInsn(Opcodes.DUP_X1); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
812 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
813 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
814 |
public void dupX2() { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
815 |
mv.visitInsn(Opcodes.DUP_X2); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
816 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
817 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
818 |
public void dup2X1() { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
819 |
mv.visitInsn(Opcodes.DUP2_X1); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
820 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
821 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
822 |
public void dup2X2() { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
823 |
mv.visitInsn(Opcodes.DUP2_X2); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
824 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
825 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
826 |
public void swap() { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
827 |
mv.visitInsn(Opcodes.SWAP); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
828 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
829 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
830 |
public void add(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
831 |
mv.visitInsn(type.getOpcode(Opcodes.IADD)); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
832 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
833 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
834 |
public void sub(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
835 |
mv.visitInsn(type.getOpcode(Opcodes.ISUB)); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
836 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
837 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
838 |
public void mul(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
839 |
mv.visitInsn(type.getOpcode(Opcodes.IMUL)); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
840 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
841 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
842 |
public void div(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
843 |
mv.visitInsn(type.getOpcode(Opcodes.IDIV)); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
844 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
845 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
846 |
public void rem(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
847 |
mv.visitInsn(type.getOpcode(Opcodes.IREM)); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
848 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
849 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
850 |
public void neg(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
851 |
mv.visitInsn(type.getOpcode(Opcodes.INEG)); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
852 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
853 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
854 |
public void shl(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
855 |
mv.visitInsn(type.getOpcode(Opcodes.ISHL)); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
856 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
857 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
858 |
public void shr(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
859 |
mv.visitInsn(type.getOpcode(Opcodes.ISHR)); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
860 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
861 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
862 |
public void ushr(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
863 |
mv.visitInsn(type.getOpcode(Opcodes.IUSHR)); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
864 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
865 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
866 |
public void and(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
867 |
mv.visitInsn(type.getOpcode(Opcodes.IAND)); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
868 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
869 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
870 |
public void or(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
871 |
mv.visitInsn(type.getOpcode(Opcodes.IOR)); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
872 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
873 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
874 |
public void xor(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
875 |
mv.visitInsn(type.getOpcode(Opcodes.IXOR)); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
876 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
877 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
878 |
public void iinc(final int var, final int increment) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
879 |
mv.visitIincInsn(var, increment); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
880 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
881 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
882 |
public void cast(final Type from, final Type to) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
883 |
if (from != to) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
884 |
if (from == Type.DOUBLE_TYPE) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
885 |
if (to == Type.FLOAT_TYPE) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
886 |
mv.visitInsn(Opcodes.D2F); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
887 |
} else if (to == Type.LONG_TYPE) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
888 |
mv.visitInsn(Opcodes.D2L); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
889 |
} else { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
890 |
mv.visitInsn(Opcodes.D2I); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
891 |
cast(Type.INT_TYPE, to); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
892 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
893 |
} else if (from == Type.FLOAT_TYPE) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
894 |
if (to == Type.DOUBLE_TYPE) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
895 |
mv.visitInsn(Opcodes.F2D); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
896 |
} else if (to == Type.LONG_TYPE) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
897 |
mv.visitInsn(Opcodes.F2L); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
898 |
} else { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
899 |
mv.visitInsn(Opcodes.F2I); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
900 |
cast(Type.INT_TYPE, to); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
901 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
902 |
} else if (from == Type.LONG_TYPE) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
903 |
if (to == Type.DOUBLE_TYPE) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
904 |
mv.visitInsn(Opcodes.L2D); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
905 |
} else if (to == Type.FLOAT_TYPE) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
906 |
mv.visitInsn(Opcodes.L2F); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
907 |
} else { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
908 |
mv.visitInsn(Opcodes.L2I); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
909 |
cast(Type.INT_TYPE, to); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
910 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
911 |
} else { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
912 |
if (to == Type.BYTE_TYPE) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
913 |
mv.visitInsn(Opcodes.I2B); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
914 |
} else if (to == Type.CHAR_TYPE) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
915 |
mv.visitInsn(Opcodes.I2C); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
916 |
} else if (to == Type.DOUBLE_TYPE) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
917 |
mv.visitInsn(Opcodes.I2D); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
918 |
} else if (to == Type.FLOAT_TYPE) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
919 |
mv.visitInsn(Opcodes.I2F); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
920 |
} else if (to == Type.LONG_TYPE) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
921 |
mv.visitInsn(Opcodes.I2L); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
922 |
} else if (to == Type.SHORT_TYPE) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
923 |
mv.visitInsn(Opcodes.I2S); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
924 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
925 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
926 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
927 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
928 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
929 |
public void lcmp() { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
930 |
mv.visitInsn(Opcodes.LCMP); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
931 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
932 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
933 |
public void cmpl(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
934 |
mv.visitInsn(type == Type.FLOAT_TYPE ? Opcodes.FCMPL : Opcodes.DCMPL); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
935 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
936 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
937 |
public void cmpg(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
938 |
mv.visitInsn(type == Type.FLOAT_TYPE ? Opcodes.FCMPG : Opcodes.DCMPG); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
939 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
940 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
941 |
public void ifeq(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
942 |
mv.visitJumpInsn(Opcodes.IFEQ, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
943 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
944 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
945 |
public void ifne(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
946 |
mv.visitJumpInsn(Opcodes.IFNE, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
947 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
948 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
949 |
public void iflt(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
950 |
mv.visitJumpInsn(Opcodes.IFLT, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
951 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
952 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
953 |
public void ifge(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
954 |
mv.visitJumpInsn(Opcodes.IFGE, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
955 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
956 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
957 |
public void ifgt(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
958 |
mv.visitJumpInsn(Opcodes.IFGT, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
959 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
960 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
961 |
public void ifle(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
962 |
mv.visitJumpInsn(Opcodes.IFLE, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
963 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
964 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
965 |
public void ificmpeq(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
966 |
mv.visitJumpInsn(Opcodes.IF_ICMPEQ, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
967 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
968 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
969 |
public void ificmpne(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
970 |
mv.visitJumpInsn(Opcodes.IF_ICMPNE, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
971 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
972 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
973 |
public void ificmplt(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
974 |
mv.visitJumpInsn(Opcodes.IF_ICMPLT, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
975 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
976 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
977 |
public void ificmpge(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
978 |
mv.visitJumpInsn(Opcodes.IF_ICMPGE, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
979 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
980 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
981 |
public void ificmpgt(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
982 |
mv.visitJumpInsn(Opcodes.IF_ICMPGT, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
983 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
984 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
985 |
public void ificmple(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
986 |
mv.visitJumpInsn(Opcodes.IF_ICMPLE, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
987 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
988 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
989 |
public void ifacmpeq(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
990 |
mv.visitJumpInsn(Opcodes.IF_ACMPEQ, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
991 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
992 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
993 |
public void ifacmpne(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
994 |
mv.visitJumpInsn(Opcodes.IF_ACMPNE, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
995 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
996 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
997 |
public void goTo(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
998 |
mv.visitJumpInsn(Opcodes.GOTO, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
999 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1000 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1001 |
public void jsr(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1002 |
mv.visitJumpInsn(Opcodes.JSR, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1003 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1004 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1005 |
public void ret(final int var) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1006 |
mv.visitVarInsn(Opcodes.RET, var); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1007 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1008 |
|
17420 | 1009 |
public void tableswitch(final int min, final int max, final Label dflt, |
1010 |
final Label... labels) { |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1011 |
mv.visitTableSwitchInsn(min, max, dflt, labels); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1012 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1013 |
|
17420 | 1014 |
public void lookupswitch(final Label dflt, final int[] keys, |
1015 |
final Label[] labels) { |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1016 |
mv.visitLookupSwitchInsn(dflt, keys, labels); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1017 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1018 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1019 |
public void areturn(final Type t) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1020 |
mv.visitInsn(t.getOpcode(Opcodes.IRETURN)); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1021 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1022 |
|
17420 | 1023 |
public void getstatic(final String owner, final String name, |
1024 |
final String desc) { |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1025 |
mv.visitFieldInsn(Opcodes.GETSTATIC, owner, name, desc); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1026 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1027 |
|
17420 | 1028 |
public void putstatic(final String owner, final String name, |
1029 |
final String desc) { |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1030 |
mv.visitFieldInsn(Opcodes.PUTSTATIC, owner, name, desc); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1031 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1032 |
|
17420 | 1033 |
public void getfield(final String owner, final String name, |
1034 |
final String desc) { |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1035 |
mv.visitFieldInsn(Opcodes.GETFIELD, owner, name, desc); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1036 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1037 |
|
17420 | 1038 |
public void putfield(final String owner, final String name, |
1039 |
final String desc) { |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1040 |
mv.visitFieldInsn(Opcodes.PUTFIELD, owner, name, desc); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1041 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1042 |
|
21617
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1043 |
@Deprecated |
17420 | 1044 |
public void invokevirtual(final String owner, final String name, |
1045 |
final String desc) { |
|
21617
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1046 |
if (api >= Opcodes.ASM5) { |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1047 |
invokevirtual(owner, name, desc, false); |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1048 |
return; |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1049 |
} |
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1050 |
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, owner, name, desc); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1051 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1052 |
|
21617
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1053 |
public void invokevirtual(final String owner, final String name, |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1054 |
final String desc, final boolean itf) { |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1055 |
if (api < Opcodes.ASM5) { |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1056 |
if (itf) { |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1057 |
throw new IllegalArgumentException( |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1058 |
"INVOKEVIRTUAL on interfaces require ASM 5"); |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1059 |
} |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1060 |
invokevirtual(owner, name, desc); |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1061 |
return; |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1062 |
} |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1063 |
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, owner, name, desc, itf); |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1064 |
} |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1065 |
|
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1066 |
@Deprecated |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1067 |
public void invokespecial(final String owner, final String name, |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1068 |
final String desc) { |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1069 |
if (api >= Opcodes.ASM5) { |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1070 |
invokespecial(owner, name, desc, false); |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1071 |
return; |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1072 |
} |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1073 |
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, owner, name, desc, false); |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1074 |
} |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1075 |
|
17420 | 1076 |
public void invokespecial(final String owner, final String name, |
21617
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1077 |
final String desc, final boolean itf) { |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1078 |
if (api < Opcodes.ASM5) { |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1079 |
if (itf) { |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1080 |
throw new IllegalArgumentException( |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1081 |
"INVOKESPECIAL on interfaces require ASM 5"); |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1082 |
} |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1083 |
invokespecial(owner, name, desc); |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1084 |
return; |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1085 |
} |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1086 |
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, owner, name, desc, itf); |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1087 |
} |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1088 |
|
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1089 |
@Deprecated |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1090 |
public void invokestatic(final String owner, final String name, |
17420 | 1091 |
final String desc) { |
24687
a5dfe74199ca
8044046: [asm] refresh internal ASM version to v5.0.3
ksrini
parents:
21617
diff
changeset
|
1092 |
if (api >= Opcodes.ASM5) { |
21617
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1093 |
invokestatic(owner, name, desc, false); |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1094 |
return; |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1095 |
} |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1096 |
mv.visitMethodInsn(Opcodes.INVOKESTATIC, owner, name, desc, false); |
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1097 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1098 |
|
17420 | 1099 |
public void invokestatic(final String owner, final String name, |
21617
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1100 |
final String desc, final boolean itf) { |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1101 |
if (api < Opcodes.ASM5) { |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1102 |
if (itf) { |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1103 |
throw new IllegalArgumentException( |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1104 |
"INVOKESTATIC on interfaces require ASM 5"); |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1105 |
} |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1106 |
invokestatic(owner, name, desc); |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1107 |
return; |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1108 |
} |
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1109 |
mv.visitMethodInsn(Opcodes.INVOKESTATIC, owner, name, desc, itf); |
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1110 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1111 |
|
17420 | 1112 |
public void invokeinterface(final String owner, final String name, |
1113 |
final String desc) { |
|
21617
53b88e4ac6ed
8027227: [asm] generate CONSTANT_InterfaceMethodref for invoke{special/static) of non-abstract methods on ifaces
ksrini
parents:
17420
diff
changeset
|
1114 |
mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, owner, name, desc, true); |
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1115 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1116 |
|
17420 | 1117 |
public void invokedynamic(String name, String desc, Handle bsm, |
1118 |
Object[] bsmArgs) { |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1119 |
mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1120 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1121 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1122 |
public void anew(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1123 |
mv.visitTypeInsn(Opcodes.NEW, type.getInternalName()); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1124 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1125 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1126 |
public void newarray(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1127 |
int typ; |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1128 |
switch (type.getSort()) { |
17420 | 1129 |
case Type.BOOLEAN: |
1130 |
typ = Opcodes.T_BOOLEAN; |
|
1131 |
break; |
|
1132 |
case Type.CHAR: |
|
1133 |
typ = Opcodes.T_CHAR; |
|
1134 |
break; |
|
1135 |
case Type.BYTE: |
|
1136 |
typ = Opcodes.T_BYTE; |
|
1137 |
break; |
|
1138 |
case Type.SHORT: |
|
1139 |
typ = Opcodes.T_SHORT; |
|
1140 |
break; |
|
1141 |
case Type.INT: |
|
1142 |
typ = Opcodes.T_INT; |
|
1143 |
break; |
|
1144 |
case Type.FLOAT: |
|
1145 |
typ = Opcodes.T_FLOAT; |
|
1146 |
break; |
|
1147 |
case Type.LONG: |
|
1148 |
typ = Opcodes.T_LONG; |
|
1149 |
break; |
|
1150 |
case Type.DOUBLE: |
|
1151 |
typ = Opcodes.T_DOUBLE; |
|
1152 |
break; |
|
1153 |
default: |
|
1154 |
mv.visitTypeInsn(Opcodes.ANEWARRAY, type.getInternalName()); |
|
1155 |
return; |
|
14198
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1156 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1157 |
mv.visitIntInsn(Opcodes.NEWARRAY, typ); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1158 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1159 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1160 |
public void arraylength() { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1161 |
mv.visitInsn(Opcodes.ARRAYLENGTH); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1162 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1163 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1164 |
public void athrow() { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1165 |
mv.visitInsn(Opcodes.ATHROW); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1166 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1167 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1168 |
public void checkcast(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1169 |
mv.visitTypeInsn(Opcodes.CHECKCAST, type.getInternalName()); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1170 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1171 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1172 |
public void instanceOf(final Type type) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1173 |
mv.visitTypeInsn(Opcodes.INSTANCEOF, type.getInternalName()); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1174 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1175 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1176 |
public void monitorenter() { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1177 |
mv.visitInsn(Opcodes.MONITORENTER); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1178 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1179 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1180 |
public void monitorexit() { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1181 |
mv.visitInsn(Opcodes.MONITOREXIT); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1182 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1183 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1184 |
public void multianewarray(final String desc, final int dims) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1185 |
mv.visitMultiANewArrayInsn(desc, dims); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1186 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1187 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1188 |
public void ifnull(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1189 |
mv.visitJumpInsn(Opcodes.IFNULL, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1190 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1191 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1192 |
public void ifnonnull(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1193 |
mv.visitJumpInsn(Opcodes.IFNONNULL, label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1194 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1195 |
|
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1196 |
public void mark(final Label label) { |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1197 |
mv.visitLabel(label); |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1198 |
} |
071fd6fd257d
7197401: Add a subset of the org.objectweb.asm packages to jdk8
jjh
parents:
diff
changeset
|
1199 |
} |