publicclassFooTest {static class Foo {
int mSplat;
}
Foo[] mArray = {new Foo(), new Foo(), new Foo()};
publicvoidzero() {
int sum = 0;
for (int i = 0; i < mArray.length; ++i) {
sum += mArray[i].mSplat;
}
}
publicvoidone() {
int sum = 0;
Foo[] localArray = mArray;
int len = localArray.length;
for (int i = 0; i < len; ++i) {
sum += localArray[i].mSplat;
}
}
}
Classfile /E:/svn/bms/bms-server/src/test/java/FooTest.class
Last modified 2017-10-11; size 801bytes
MD5 checksum 8d904b2f3e6e2f56b7047ad2231b7766
Compiled from "FooTest.java"public class FooTest
minor version: 0
major version: 52
flags: ACC_PUBLIC, ACC_SUPER
Constant pool:
#1= Methodref #7.#31// java/lang/Object."<init>":()V#2= Class #32// FooTest$Foo#3= Methodref #2.#31// FooTest$Foo."<init>":()V#4= Fieldref #6.#33// FooTest.mArray:[LFooTest$Foo;#5= Fieldref #2.#34// FooTest$Foo.mSplat:I#6= Class #35// FooTest#7= Class #36// java/lang/Object#8= Utf8 Foo
#9= Utf8 InnerClasses
#10= Utf8 mArray
#11= Utf8 [LFooTest$Foo;
#12= Utf8 <init>#13= Utf8 ()V
#14= Utf8 Code
#15= Utf8 LineNumberTable
#16= Utf8 LocalVariableTable
#17= Utf8 this
#18= Utf8 LFooTest;
#19= Utf8 zero
#20= Utf8 i
#21= Utf8 I
#22= Utf8 sum#23= Utf8 StackMapTable
#24= Utf8 one
#25= Utf8 localArray
#26= Utf8 len
#27= Class #35// FooTest#28= Class #11// "[LFooTest$Foo;"#29= Utf8 SourceFile
#30= Utf8 FooTest.java
#31= NameAndType #12:#13// "<init>":()V#32= Utf8 FooTest$Foo#33= NameAndType #10:#11// mArray:[LFooTest$Foo;#34= NameAndType #37:#21// mSplat:I#35= Utf8 FooTest
#36= Utf8 java/lang/Object
#37= Utf8 mSplat
{
FooTest$Foo[] mArray;
descriptor: [LFooTest$Foo;
flags:
public FooTest();
descriptor: ()V
flags: ACC_PUBLIC
Code:
stack=6, locals=1, args_size=10: aload_0
1: invokespecial #1// Method java/lang/Object."<init>":()V4: aload_0
5: iconst_3
6: anewarray #2// class FooTest$Foo9: dup
10: iconst_0
11: new#2// class FooTest$Foo14: dup
15: invokespecial #3// Method FooTest$Foo."<init>":()V18: aastore
19: dup
20: iconst_1
21: new#2// class FooTest$Foo24: dup
25: invokespecial #3// Method FooTest$Foo."<init>":()V28: aastore
29: dup
30: iconst_2
31: new#2// class FooTest$Foo34: dup
35: invokespecial #3// Method FooTest$Foo."<init>":()V38: aastore
39: putfield #4// Field mArray:[LFooTest$Foo;42: return
LineNumberTable:
line 5: 0
line 10: 4
LocalVariableTable:
Start Length Slot Name Signature
0430 this LFooTest;
publicvoid zero();
descriptor: ()V
flags: ACC_PUBLIC
Code:
stack=3, locals=3, args_size=10: iconst_0
1: istore_1
2: iconst_0
3: istore_2
4: iload_2
5: aload_0
6: getfield #4// Field mArray:[LFooTest$Foo;9: arraylength
10: if_icmpge 3113: iload_1
14: aload_0
15: getfield #4// Field mArray:[LFooTest$Foo;18: iload_2
19: aaload
20: getfield #5// Field FooTest$Foo.mSplat:I23: iadd
24: istore_1
25: iinc 2, 128: goto 431: return
LineNumberTable:
line 13: 0
line 14: 2
line 15: 13
line 14: 25
line 17: 31
LocalVariableTable:
Start Length Slot Name Signature
4272 i I
0320 this LFooTest;
2301sum I
StackMapTable: number_of_entries =2
frame_type =253/* append */
offset_delta =4
locals =[ int, int ]
frame_type = 250 /* chop */
offset_delta = 26
public void one();
descriptor: ()V
flags: ACC_PUBLIC
Code:
stack=3, locals=5, args_size=1
0: iconst_0
1: istore_1
2: aload_0
3: getfield #4 // Field mArray:[LFooTest$Foo;
6: astore_2
7: aload_2
8: arraylength
9: istore_3
10: iconst_0
11: istore 413: iload 415: iload_3
16: if_icmpge 3519: iload_1
20: aload_2
21: iload 423: aaload
24: getfield #5// Field FooTest$Foo.mSplat:I27: iadd
28: istore_1
29: iinc 4, 132: goto 1335: return
LineNumberTable:
line 20: 0
line 21: 2
line 22: 7
line 24: 10
line 25: 19
line 24: 29
line 27: 35
LocalVariableTable:
Start Length Slot Name Signature
13224 i I
0360 this LFooTest;
2341sum I
7292 localArray [LFooTest$Foo;
10263 len I
StackMapTable: number_of_entries =2
frame_type =255/* full_frame */
offset_delta =13
locals =[ class FooTest, int, class "[LFooTest$Foo;", int, int ]
stack = []
frame_type = 250 /* chop */
offset_delta = 21
}
SourceFile: "FooTest.java"
InnerClasses:
static #8= #2 of #6; //Foo=class FooTest$Foo of class FooTest