Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-1184986

inefficient use of local variable slots

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P5 P5
    • None
    • 0.9
    • tools
    • sparc
    • solaris_2.4

      Local variable slot allocation is non-optimal. Both variables should be mapped
      to the same slot:

          public static void main(String argv[]) {
      {
      int x = 3;
      System.out.println(x);
      }
      {
      int y = 4;
      System.out.println(y);
      }
          }

      Method void main(oak/lang/String [])
         0 iconst_3
         1 istore_1 <<= x
         2 getstatic #5 <Field oak/lang/System.out Loak/io/PrintStream;>
         5 iload_1 1 <<= x
         6 invokevirtual #7 <Method oak/io/PrintStream.println(I)V>
         9 iconst_4
        10 istore_2 <<= y
        11 getstatic #5 <Field oak/lang/System.out Loak/io/PrintStream;>
        14 iload_2 2 <<= y
        15 invokevirtual #7 <Method oak/io/PrintStream.println(I)V>
        18 return

            fyellinsunw Frank Yellin (Inactive)
            ahoffsunw Arthur Hoff (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: