Skip to content

Instantly share code, notes, and snippets.

@rjdkolb
Last active Aug 29, 2015
Embed
What would you like to do?
Java P Byte Code
public class App {
public void createPrimativeInteger(){
int x = 100000000;
}
public void createObjectIntegerNonAutoBoxing(){
int x = 200000000;
}
public void createObjectIntegerAutoBoxing(){
Integer x = 300000000;
}
public void createObjectLongNoBoxing(){
Long x = new Long(400000000);
}
public void createObjectLongAutoBoxing(){
Long x = 500000000L;
}
}
public class App {
public App();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
public void createPrimativeInteger();
Code:
0: ldc #2 // int 100000000
2: istore_1
3: return
public void createObjectIntegerNonAutoBoxing();
Code:
0: ldc #3 // int 200000000
2: istore_1
3: return
public void createObjectIntegerAutoBoxing();
Code:
0: ldc #4 // int 300000000
2: invokestatic #5 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
5: astore_1
6: return
public void createObjectLongNoBoxing();
Code:
0: new #6 // class java/lang/Long
3: dup
4: ldc2_w #7 // long 400000000l
7: invokespecial #9 // Method java/lang/Long."<init>":(J)V
10: astore_1
11: return
public void createObjectLongAutoBoxing();
Code:
0: ldc2_w #10 // long 500000000l
3: invokestatic #12 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
6: astore_1
7: return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment