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

javap should print StackMapTable in a more readable format

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 6
    • Fix Version/s: 6
    • Component/s: tools
    • Subcomponent:
    • Resolved In Build:
      b61
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      When version 50 classes are read, javap should print StackMapTable attribute contents in a more readable format.

      ===============================
      Test.java:
      class Test {
        void runIt(int i) {
          if (i==0) { zeroTest(); }
        }
        void zeroTest() { }
      }
          
      > javac -target 6 Test.java
      > javap -verbose Test | more
      Compiled from "Test.java"
      class Test extends java.lang.Object
        SourceFile: "Test.java"
        minor version: 0
        major version: 50
        Constant pool:
      const #1 = Method #4.#15; // java/lang/Object."<init>":()V
      const #2 = Method #3.#16; // Test.zeroTest:()V
      const #3 = class #17; // Test
      const #4 = class #18; // java/lang/Object
      const #5 = Asciz <init>;
      const #6 = Asciz ()V;
      const #7 = Asciz Code;
      const #8 = Asciz LineNumberTable;
      const #9 = Asciz runIt;
      const #10 = Asciz (I)V;
      const #11 = Asciz StackMapTable;
      const #12 = Asciz zeroTest;
      const #13 = Asciz SourceFile;
      const #14 = Asciz Test.java;
      const #15 = NameAndType #5:#6;// "<init>":()V
      const #16 = NameAndType #12:#6;// zeroTest:()V
      const #17 = Asciz Test;
      const #18 = Asciz java/lang/Object;

      {
      Test();
        Code:
         Stack=1, Locals=1, Args_size=1
         0: aload_0
         1: invokespecial #1; //Method java/lang/Object."<init>":()V
         4: return
        LineNumberTable:
         line 1: 0

      void runIt(int);
        Code:
         Stack=1, Locals=2, Args_size=2
         0: iload_1
         1: ifne 8
         4: aload_0
         5: invokevirtual #2; //Method zeroTest:()V
         8: return
        LineNumberTable:
         line 3: 0
         line 4: 8
        StackMapTable: length = 0x3
         00 01 08

      void zeroTest();
        Code:
         Stack=0, Locals=1, Args_size=1
         0: return
        LineNumberTable:
         line 6: 0

      }

      ###@###.### 2005-05-16 23:15:24 GMT

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              wtaosunw Wei Tao (Inactive)
              Reporter:
              wtaosunw Wei Tao (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: