-
Enhancement
-
Resolution: Fixed
-
P4
-
6
-
b61
-
generic
-
generic
-
Verified
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
===============================
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
- duplicates
-
JDK-6271807 javap should print nice version of StackMapTable attribute
- Closed
- relates to
-
JDK-6347681 javac test stackmap T4955930 fails
- Resolved
-
JDK-6227862 Make javac generate compact verification tables in target 6
- Resolved