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

Print this page

        

@@ -406,11 +406,11 @@
         } else if (value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE) {
             mv.visitIntInsn(Opcodes.BIPUSH, value);
         } else if (value >= Short.MIN_VALUE && value <= Short.MAX_VALUE) {
             mv.visitIntInsn(Opcodes.SIPUSH, value);
         } else {
-            mv.visitLdcInsn(new Integer(value));
+            mv.visitLdcInsn(value);
         }
     }
 
     /**
      * Generates the instruction to push the given value on the stack.

@@ -420,11 +420,11 @@
      */
     public void push(final long value) {
         if (value == 0L || value == 1L) {
             mv.visitInsn(Opcodes.LCONST_0 + (int) value);
         } else {
-            mv.visitLdcInsn(new Long(value));
+            mv.visitLdcInsn(value);
         }
     }
 
     /**
      * Generates the instruction to push the given value on the stack.

@@ -435,11 +435,11 @@
     public void push(final float value) {
         int bits = Float.floatToIntBits(value);
         if (bits == 0L || bits == 0x3f800000 || bits == 0x40000000) { // 0..2
             mv.visitInsn(Opcodes.FCONST_0 + (int) value);
         } else {
-            mv.visitLdcInsn(new Float(value));
+            mv.visitLdcInsn(value);
         }
     }
 
     /**
      * Generates the instruction to push the given value on the stack.

@@ -450,11 +450,11 @@
     public void push(final double value) {
         long bits = Double.doubleToLongBits(value);
         if (bits == 0L || bits == 0x3ff0000000000000L) { // +0.0d and 1.0d
             mv.visitInsn(Opcodes.DCONST_0 + (int) value);
         } else {
-            mv.visitLdcInsn(new Double(value));
+            mv.visitLdcInsn(value);
         }
     }
 
     /**
      * Generates the instruction to push the given value on the stack.

@@ -1645,13 +1645,15 @@
      *            internal name of the type of exceptions handled by the
      *            handler.
      */
     public void catchException(final Label start, final Label end,
             final Type exception) {
+        Label doCatch = new Label();
         if (exception == null) {
-            mv.visitTryCatchBlock(start, end, mark(), null);
+            mv.visitTryCatchBlock(start, end, doCatch, null);
         } else {
-            mv.visitTryCatchBlock(start, end, mark(),
+            mv.visitTryCatchBlock(start, end, doCatch,
                     exception.getInternalName());
         }
+        mark(doCatch);
     }
 }