Created
February 20, 2015 13:21
-
-
Save AKB428/1e56057930cc65088e8f to your computer and use it in GitHub Desktop.
Javaのfor最適化は意味あるか否か classfile -> javap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| C:\pleiades\workspace\MyCodeBox\src>javap -c OptimizeForLoop.class | |
| Compiled from "OptimizeForLoop.java" | |
| public class OptimizeForLoop { | |
| public OptimizeForLoop(); | |
| Code: | |
| 0: aload_0 | |
| 1: invokespecial #1 // Method java/lang/Object."<init>":()V | |
| 4: return | |
| public static void main(java.lang.String[]); | |
| Code: | |
| 0: aload_0 | |
| 1: invokestatic #2 // Method noOptimize:([Ljava/lang/String;)V | |
| 4: aload_0 | |
| 5: invokestatic #3 // Method optimize:([Ljava/lang/String;)V | |
| 8: return | |
| public static void noOptimize(java.lang.String[]); | |
| Code: | |
| 0: iconst_0 | |
| 1: istore_1 | |
| 2: iload_1 | |
| 3: aload_0 | |
| 4: arraylength | |
| 5: if_icmpge 23 | |
| 8: getstatic #4 // Field java/lang/System.out:Ljava/io/PrintStream; | |
| 11: aload_0 | |
| 12: iload_1 | |
| 13: aaload | |
| 14: invokevirtual #5 // Method java/io/PrintStream.println:(Ljava/lang/String;)V | |
| 17: iinc 1, 1 | |
| 20: goto 2 | |
| 23: return | |
| public static void optimize(java.lang.String[]); | |
| Code: | |
| 0: iconst_0 | |
| 1: istore_1 | |
| 2: aload_0 | |
| 3: arraylength | |
| 4: istore_2 | |
| 5: iload_1 | |
| 6: iload_2 | |
| 7: if_icmpge 25 | |
| 10: getstatic #4 // Field java/lang/System.out:Ljava/io/PrintStream; | |
| 13: aload_0 | |
| 14: iload_1 | |
| 15: aaload | |
| 16: invokevirtual #5 // Method java/io/PrintStream.println:(Ljava/lang/String;)V | |
| 19: iinc 1, 1 | |
| 22: goto 5 | |
| 25: return | |
| } | |
| C:\pleiades\workspace\MyCodeBox\src> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment