@@ -81,7 +81,7 @@ public final class MethodWriter extends GeneratorAdapter {
8181 private final BitSet statements ;
8282 private final CompilerSettings settings ;
8383
84- private final Deque <List <org . objectweb . asm . Type >> stringConcatArgs =
84+ private final Deque <List <Type >> stringConcatArgs =
8585 (INDY_STRING_CONCAT_BOOTSTRAP_HANDLE == null ) ? null : new ArrayDeque <>();
8686
8787 public MethodWriter (int access , Method method , ClassVisitor cw , BitSet statements , CompilerSettings settings ) {
@@ -200,7 +200,7 @@ private void writeCast(Class<?> from, Class<?> to) {
200200 * Proxy the box method to use valueOf instead to ensure that the modern boxing methods are used.
201201 */
202202 @ Override
203- public void box (org . objectweb . asm . Type type ) {
203+ public void box (Type type ) {
204204 valueOf (type );
205205 }
206206
@@ -252,10 +252,10 @@ public int writeNewStrings() {
252252 }
253253 }
254254
255- public void writeAppendStrings (final Definition . Type type ) {
255+ public void writeAppendStrings (Class <?> clazz ) {
256256 if (INDY_STRING_CONCAT_BOOTSTRAP_HANDLE != null ) {
257257 // Java 9+: record type information
258- stringConcatArgs .peek ().add (type . type );
258+ stringConcatArgs .peek ().add (getType ( clazz ) );
259259 // prevent too many concat args.
260260 // If there are too many, do the actual concat:
261261 if (stringConcatArgs .peek ().size () >= MAX_INDY_STRING_CONCAT_ARGS ) {
@@ -266,24 +266,24 @@ public void writeAppendStrings(final Definition.Type type) {
266266 }
267267 } else {
268268 // Java 8: push a StringBuilder append
269- if ( type . clazz == boolean .class ) invokeVirtual (STRINGBUILDER_TYPE , STRINGBUILDER_APPEND_BOOLEAN );
270- else if (type . clazz == char .class ) invokeVirtual (STRINGBUILDER_TYPE , STRINGBUILDER_APPEND_CHAR );
271- else if (type . clazz == byte .class ||
272- type . clazz == short .class ||
273- type . clazz == int .class ) invokeVirtual (STRINGBUILDER_TYPE , STRINGBUILDER_APPEND_INT );
274- else if (type . clazz == long .class ) invokeVirtual (STRINGBUILDER_TYPE , STRINGBUILDER_APPEND_LONG );
275- else if (type . clazz == float .class ) invokeVirtual (STRINGBUILDER_TYPE , STRINGBUILDER_APPEND_FLOAT );
276- else if (type . clazz == double .class ) invokeVirtual (STRINGBUILDER_TYPE , STRINGBUILDER_APPEND_DOUBLE );
277- else if (type . clazz == String .class ) invokeVirtual (STRINGBUILDER_TYPE , STRINGBUILDER_APPEND_STRING );
278- else invokeVirtual (STRINGBUILDER_TYPE , STRINGBUILDER_APPEND_OBJECT );
269+ if ( clazz == boolean .class ) invokeVirtual (STRINGBUILDER_TYPE , STRINGBUILDER_APPEND_BOOLEAN );
270+ else if (clazz == char .class ) invokeVirtual (STRINGBUILDER_TYPE , STRINGBUILDER_APPEND_CHAR );
271+ else if (clazz == byte .class ||
272+ clazz == short .class ||
273+ clazz == int .class ) invokeVirtual (STRINGBUILDER_TYPE , STRINGBUILDER_APPEND_INT );
274+ else if (clazz == long .class ) invokeVirtual (STRINGBUILDER_TYPE , STRINGBUILDER_APPEND_LONG );
275+ else if (clazz == float .class ) invokeVirtual (STRINGBUILDER_TYPE , STRINGBUILDER_APPEND_FLOAT );
276+ else if (clazz == double .class ) invokeVirtual (STRINGBUILDER_TYPE , STRINGBUILDER_APPEND_DOUBLE );
277+ else if (clazz == String .class ) invokeVirtual (STRINGBUILDER_TYPE , STRINGBUILDER_APPEND_STRING );
278+ else invokeVirtual (STRINGBUILDER_TYPE , STRINGBUILDER_APPEND_OBJECT );
279279 }
280280 }
281281
282282 public void writeToStrings () {
283283 if (INDY_STRING_CONCAT_BOOTSTRAP_HANDLE != null ) {
284284 // Java 9+: use type information and push invokeDynamic
285- final String desc = org . objectweb . asm . Type .getMethodDescriptor (STRING_TYPE ,
286- stringConcatArgs .pop ().stream ().toArray (org . objectweb . asm . Type []::new ));
285+ final String desc = Type .getMethodDescriptor (STRING_TYPE ,
286+ stringConcatArgs .pop ().stream ().toArray (Type []::new ));
287287 invokeDynamic ("concat" , desc , INDY_STRING_CONCAT_BOOTSTRAP_HANDLE );
288288 } else {
289289 // Java 8: call toString() on StringBuilder
@@ -292,9 +292,9 @@ public void writeToStrings() {
292292 }
293293
294294 /** Writes a dynamic binary instruction: returnType, lhs, and rhs can be different */
295- public void writeDynamicBinaryInstruction (Location location , Definition . Type returnType , Definition . Type lhs , Definition . Type rhs ,
295+ public void writeDynamicBinaryInstruction (Location location , Class <?> returnType , Class <?> lhs , Class <?> rhs ,
296296 Operation operation , int flags ) {
297- org . objectweb . asm . Type methodType = org . objectweb . asm . Type .getMethodType (returnType . type , lhs . type , rhs . type );
297+ Type methodType = Type .getMethodType (getType ( returnType ), getType ( lhs ), getType ( rhs ) );
298298
299299 switch (operation ) {
300300 case MUL :
@@ -310,7 +310,7 @@ public void writeDynamicBinaryInstruction(Location location, Definition.Type ret
310310 // if either side is primitive, then the + operator should always throw NPE on null,
311311 // so we don't need a special NPE guard.
312312 // otherwise, we need to allow nulls for possible string concatenation.
313- boolean hasPrimitiveArg = lhs .clazz . isPrimitive () || rhs . clazz .isPrimitive ();
313+ boolean hasPrimitiveArg = lhs .isPrimitive () || rhs .isPrimitive ();
314314 if (!hasPrimitiveArg ) {
315315 flags |= DefBootstrap .OPERATOR_ALLOWS_NULL ;
316316 }
@@ -343,26 +343,26 @@ public void writeDynamicBinaryInstruction(Location location, Definition.Type ret
343343 }
344344
345345 /** Writes a static binary instruction */
346- public void writeBinaryInstruction (Location location , Definition . Type type , Operation operation ) {
347- if (( type . clazz == float .class || type . clazz == double .class ) &&
346+ public void writeBinaryInstruction (Location location , Class <?> clazz , Operation operation ) {
347+ if ( ( clazz == float .class || clazz == double .class ) &&
348348 (operation == Operation .LSH || operation == Operation .USH ||
349349 operation == Operation .RSH || operation == Operation .BWAND ||
350350 operation == Operation .XOR || operation == Operation .BWOR )) {
351351 throw location .createError (new IllegalStateException ("Illegal tree structure." ));
352352 }
353353
354354 switch (operation ) {
355- case MUL : math (GeneratorAdapter .MUL , type . type ); break ;
356- case DIV : math (GeneratorAdapter .DIV , type . type ); break ;
357- case REM : math (GeneratorAdapter .REM , type . type ); break ;
358- case ADD : math (GeneratorAdapter .ADD , type . type ); break ;
359- case SUB : math (GeneratorAdapter .SUB , type . type ); break ;
360- case LSH : math (GeneratorAdapter .SHL , type . type ); break ;
361- case USH : math (GeneratorAdapter .USHR , type . type ); break ;
362- case RSH : math (GeneratorAdapter .SHR , type . type ); break ;
363- case BWAND : math (GeneratorAdapter .AND , type . type ); break ;
364- case XOR : math (GeneratorAdapter .XOR , type . type ); break ;
365- case BWOR : math (GeneratorAdapter .OR , type . type ); break ;
355+ case MUL : math (GeneratorAdapter .MUL , getType ( clazz ) ); break ;
356+ case DIV : math (GeneratorAdapter .DIV , getType ( clazz ) ); break ;
357+ case REM : math (GeneratorAdapter .REM , getType ( clazz ) ); break ;
358+ case ADD : math (GeneratorAdapter .ADD , getType ( clazz ) ); break ;
359+ case SUB : math (GeneratorAdapter .SUB , getType ( clazz ) ); break ;
360+ case LSH : math (GeneratorAdapter .SHL , getType ( clazz ) ); break ;
361+ case USH : math (GeneratorAdapter .USHR , getType ( clazz ) ); break ;
362+ case RSH : math (GeneratorAdapter .SHR , getType ( clazz ) ); break ;
363+ case BWAND : math (GeneratorAdapter .AND , getType ( clazz ) ); break ;
364+ case XOR : math (GeneratorAdapter .XOR , getType ( clazz ) ); break ;
365+ case BWOR : math (GeneratorAdapter .OR , getType ( clazz ) ); break ;
366366 default :
367367 throw location .createError (new IllegalStateException ("Illegal tree structure." ));
368368 }
@@ -416,7 +416,7 @@ public void visitEnd() {
416416 * @param flavor type of call
417417 * @param params flavor-specific parameters
418418 */
419- public void invokeDefCall (String name , org . objectweb . asm . Type methodType , int flavor , Object ... params ) {
419+ public void invokeDefCall (String name , Type methodType , int flavor , Object ... params ) {
420420 Object [] args = new Object [params .length + 2 ];
421421 args [0 ] = settings .getInitialCallSiteDepth ();
422422 args [1 ] = flavor ;
0 commit comments