Lines 257-294
Link Here
|
257 |
" 46 iastore\n" + |
257 |
" 46 iastore\n" + |
258 |
" 47 astore_2 [tab]\n" + |
258 |
" 47 astore_2 [tab]\n" + |
259 |
" 48 aload_2 [tab]\n" + |
259 |
" 48 aload_2 [tab]\n" + |
260 |
" 49 astore 6\n" + |
260 |
" 49 dup\n" + |
261 |
" 51 iconst_0\n" + |
261 |
" 50 astore 6\n" + |
262 |
" 52 istore 4\n" + |
262 |
" 52 arraylength\n" + |
263 |
" 54 aload 6\n" + |
263 |
" 53 istore 5\n" + |
264 |
" 56 arraylength\n" + |
264 |
" 55 iconst_0\n" + |
265 |
" 57 istore 5\n" + |
265 |
" 56 istore 4\n" + |
266 |
" 59 goto 73\n" + |
266 |
" 58 goto 72\n" + |
267 |
" 62 aload 6\n" + |
267 |
" 61 aload 6\n" + |
268 |
" 64 iload 4\n" + |
268 |
" 63 iload 4\n" + |
269 |
" 66 iaload\n" + |
269 |
" 65 iaload\n" + |
270 |
" 67 istore_3 [e]\n" + |
270 |
" 66 istore_3 [e]\n" + |
271 |
" 68 iload_3 [e]\n" + |
271 |
" 67 iload_3 [e]\n" + |
272 |
" 69 istore_1\n" + |
272 |
" 68 istore_1\n" + |
273 |
" 70 iinc 4 1\n" + |
273 |
" 69 iinc 4 1\n" + |
274 |
" 73 iload 4\n" + |
274 |
" 72 iload 4\n" + |
275 |
" 75 iload 5\n" + |
275 |
" 74 iload 5\n" + |
276 |
" 77 if_icmplt 62\n" + |
276 |
" 76 if_icmplt 61\n" + |
277 |
" 80 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
277 |
" 79 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
278 |
" 83 ldc <String \"SUCCESS\"> [22]\n" + |
278 |
" 82 ldc <String \"SUCCESS\"> [22]\n" + |
279 |
" 85 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" + |
279 |
" 84 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" + |
280 |
" 88 return\n" + |
280 |
" 87 return\n" + |
281 |
" Line numbers:\n" + |
281 |
" Line numbers:\n" + |
282 |
" [pc: 0, line: 5]\n" + |
282 |
" [pc: 0, line: 5]\n" + |
283 |
" [pc: 48, line: 6]\n" + |
283 |
" [pc: 48, line: 6]\n" + |
284 |
" [pc: 68, line: 7]\n" + |
284 |
" [pc: 67, line: 7]\n" + |
285 |
" [pc: 70, line: 6]\n" + |
285 |
" [pc: 69, line: 6]\n" + |
286 |
" [pc: 80, line: 9]\n" + |
286 |
" [pc: 79, line: 9]\n" + |
287 |
" [pc: 88, line: 10]\n" + |
287 |
" [pc: 87, line: 10]\n" + |
288 |
" Local variable table:\n" + |
288 |
" Local variable table:\n" + |
289 |
" [pc: 0, pc: 89] local: args index: 0 type: java.lang.String[]\n" + |
289 |
" [pc: 0, pc: 88] local: args index: 0 type: java.lang.String[]\n" + |
290 |
" [pc: 48, pc: 89] local: tab index: 2 type: int[]\n" + |
290 |
" [pc: 48, pc: 88] local: tab index: 2 type: int[]\n" + |
291 |
" [pc: 68, pc: 70] local: e index: 3 type: int\n"; |
291 |
" [pc: 67, pc: 69] local: e index: 3 type: int\n"; |
292 |
|
292 |
|
293 |
try { |
293 |
try { |
294 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
294 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
Lines 595-623
Link Here
|
595 |
" 6 iastore\n" + |
595 |
" 6 iastore\n" + |
596 |
" 7 astore_1 [tab]\n" + |
596 |
" 7 astore_1 [tab]\n" + |
597 |
" 8 aload_1 [tab]\n" + |
597 |
" 8 aload_1 [tab]\n" + |
598 |
" 9 astore 4\n" + |
598 |
" 9 dup\n" + |
599 |
" 11 iconst_0\n" + |
599 |
" 10 astore 4\n" + |
600 |
" 12 istore_2\n" + |
600 |
" 12 arraylength\n" + |
601 |
" 13 aload 4\n" + |
601 |
" 13 istore_3\n" + |
602 |
" 15 arraylength\n" + |
602 |
" 14 iconst_0\n" + |
603 |
" 16 istore_3\n" + |
603 |
" 15 istore_2\n" + |
604 |
" 17 goto 23\n" + |
604 |
" 16 goto 22\n" + |
605 |
" 20 iinc 2 1\n" + |
605 |
" 19 iinc 2 1\n" + |
606 |
" 23 iload_2\n" + |
606 |
" 22 iload_2\n" + |
607 |
" 24 iload_3\n" + |
607 |
" 23 iload_3\n" + |
608 |
" 25 if_icmplt 20\n" + |
608 |
" 24 if_icmplt 19\n" + |
609 |
" 28 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
609 |
" 27 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
610 |
" 31 ldc <String \"SUCCESS\"> [22]\n" + |
610 |
" 30 ldc <String \"SUCCESS\"> [22]\n" + |
611 |
" 33 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" + |
611 |
" 32 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" + |
612 |
" 36 return\n" + |
612 |
" 35 return\n" + |
613 |
" Line numbers:\n" + |
613 |
" Line numbers:\n" + |
614 |
" [pc: 0, line: 4]\n" + |
614 |
" [pc: 0, line: 4]\n" + |
615 |
" [pc: 8, line: 5]\n" + |
615 |
" [pc: 8, line: 5]\n" + |
616 |
" [pc: 28, line: 7]\n" + |
616 |
" [pc: 27, line: 7]\n" + |
617 |
" [pc: 36, line: 8]\n" + |
617 |
" [pc: 35, line: 8]\n" + |
618 |
" Local variable table:\n" + |
618 |
" Local variable table:\n" + |
619 |
" [pc: 0, pc: 37] local: args index: 0 type: java.lang.String[]\n" + |
619 |
" [pc: 0, pc: 36] local: args index: 0 type: java.lang.String[]\n" + |
620 |
" [pc: 8, pc: 37] local: tab index: 1 type: int[]\n"; |
620 |
" [pc: 8, pc: 36] local: tab index: 1 type: int[]\n"; |
621 |
|
621 |
|
622 |
try { |
622 |
try { |
623 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
623 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
Lines 677-683
Link Here
|
677 |
"1"); |
677 |
"1"); |
678 |
String expectedOutput = |
678 |
String expectedOutput = |
679 |
" // Method descriptor #15 ([Ljava/lang/String;)V\n" + |
679 |
" // Method descriptor #15 ([Ljava/lang/String;)V\n" + |
680 |
" // Stack: 4, Locals: 6\n" + |
680 |
" // Stack: 4, Locals: 4\n" + |
681 |
" public static void main(java.lang.String[] args);\n" + |
681 |
" public static void main(java.lang.String[] args);\n" + |
682 |
" 0 iconst_1\n" + |
682 |
" 0 iconst_1\n" + |
683 |
" 1 newarray int [10]\n" + |
683 |
" 1 newarray int [10]\n" + |
Lines 687-722
Link Here
|
687 |
" 6 iastore\n" + |
687 |
" 6 iastore\n" + |
688 |
" 7 astore_1 [tab]\n" + |
688 |
" 7 astore_1 [tab]\n" + |
689 |
" 8 aload_1 [tab]\n" + |
689 |
" 8 aload_1 [tab]\n" + |
690 |
" 9 astore 5\n" + |
690 |
" 9 dup\n" + |
691 |
" 11 iconst_0\n" + |
691 |
" 10 astore_3\n" + |
692 |
" 12 istore_3\n" + |
692 |
" 11 arraylength\n" + |
693 |
" 13 aload 5\n" + |
693 |
" 12 ifeq 26\n" + |
694 |
" 15 arraylength\n" + |
694 |
" 15 aload_3\n" + |
695 |
" 16 istore 4\n" + |
695 |
" 16 iconst_0\n" + |
696 |
" 18 goto 36\n" + |
696 |
" 17 iaload\n" + |
697 |
" 21 aload 5\n" + |
697 |
" 18 istore_2 [e]\n" + |
698 |
" 23 iload_3\n" + |
698 |
" 19 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
699 |
" 24 iaload\n" + |
699 |
" 22 iload_2 [e]\n" + |
700 |
" 25 istore_2 [e]\n" + |
700 |
" 23 invokevirtual java.io.PrintStream.println(int) : void [22]\n" + |
701 |
" 26 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
701 |
" 26 return\n" + |
702 |
" 29 iload_2 [e]\n" + |
|
|
703 |
" 30 invokevirtual java.io.PrintStream.println(int) : void [22]\n" + |
704 |
" 33 goto 42\n" + |
705 |
" 36 iload_3\n" + |
706 |
" 37 iload 4\n" + |
707 |
" 39 if_icmplt 21\n" + |
708 |
" 42 return\n" + |
709 |
" Line numbers:\n" + |
702 |
" Line numbers:\n" + |
710 |
" [pc: 0, line: 4]\n" + |
703 |
" [pc: 0, line: 4]\n" + |
711 |
" [pc: 8, line: 5]\n" + |
704 |
" [pc: 8, line: 5]\n" + |
712 |
" [pc: 26, line: 6]\n" + |
705 |
" [pc: 19, line: 6]\n" + |
713 |
" [pc: 33, line: 7]\n" + |
706 |
" [pc: 26, line: 9]\n" + |
714 |
" [pc: 36, line: 5]\n" + |
707 |
" Local variable table:\n" + |
715 |
" [pc: 42, line: 9]\n" + |
708 |
" [pc: 0, pc: 27] local: args index: 0 type: java.lang.String[]\n" + |
716 |
" Local variable table:\n" + |
709 |
" [pc: 8, pc: 27] local: tab index: 1 type: int[]\n" + |
717 |
" [pc: 0, pc: 43] local: args index: 0 type: java.lang.String[]\n" + |
710 |
" [pc: 19, pc: 26] local: e index: 2 type: int\n"; |
718 |
" [pc: 8, pc: 43] local: tab index: 1 type: int[]\n" + |
|
|
719 |
" [pc: 26, pc: 36] local: e index: 2 type: int\n"; |
720 |
|
711 |
|
721 |
try { |
712 |
try { |
722 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
713 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
Lines 760-766
Link Here
|
760 |
|
751 |
|
761 |
String expectedOutput = |
752 |
String expectedOutput = |
762 |
" // Method descriptor #15 ([Ljava/lang/String;)V\n" + |
753 |
" // Method descriptor #15 ([Ljava/lang/String;)V\n" + |
763 |
" // Stack: 2, Locals: 5\n" + |
754 |
" // Stack: 2, Locals: 3\n" + |
764 |
" public static void main(java.lang.String[] args);\n" + |
755 |
" public static void main(java.lang.String[] args);\n" + |
765 |
" 0 iconst_0\n" + |
756 |
" 0 iconst_0\n" + |
766 |
" 1 newarray int [10]\n" + |
757 |
" 1 newarray int [10]\n" + |
Lines 769-804
Link Here
|
769 |
" 7 ldc <String \"SUC\"> [22]\n" + |
760 |
" 7 ldc <String \"SUC\"> [22]\n" + |
770 |
" 9 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + |
761 |
" 9 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + |
771 |
" 12 aload_1 [tab]\n" + |
762 |
" 12 aload_1 [tab]\n" + |
772 |
" 13 astore 4\n" + |
763 |
" 13 dup\n" + |
773 |
" 15 iconst_0\n" + |
764 |
" 14 astore_2\n" + |
774 |
" 16 istore_2\n" + |
765 |
" 15 arraylength\n" + |
775 |
" 17 aload 4\n" + |
766 |
" 16 ifeq 27\n" + |
776 |
" 19 arraylength\n" + |
767 |
" 19 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
777 |
" 20 istore_3\n" + |
768 |
" 22 ldc <String \"1x\"> [30]\n" + |
778 |
" 21 goto 35\n" + |
769 |
" 24 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + |
779 |
" 24 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
770 |
" 27 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
780 |
" 27 ldc <String \"1x\"> [30]\n" + |
771 |
" 30 ldc <String \"CESS\"> [32]\n" + |
781 |
" 29 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + |
772 |
" 32 invokevirtual java.io.PrintStream.println(java.lang.String) : void [34]\n" + |
782 |
" 32 goto 40\n" + |
773 |
" 35 return\n" + |
783 |
" 35 iload_2\n" + |
|
|
784 |
" 36 iload_3\n" + |
785 |
" 37 if_icmplt 24\n" + |
786 |
" 40 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
787 |
" 43 ldc <String \"CESS\"> [32]\n" + |
788 |
" 45 invokevirtual java.io.PrintStream.println(java.lang.String) : void [34]\n" + |
789 |
" 48 return\n" + |
790 |
" Line numbers:\n" + |
774 |
" Line numbers:\n" + |
791 |
" [pc: 0, line: 4]\n" + |
775 |
" [pc: 0, line: 4]\n" + |
792 |
" [pc: 4, line: 5]\n" + |
776 |
" [pc: 4, line: 5]\n" + |
793 |
" [pc: 12, line: 6]\n" + |
777 |
" [pc: 12, line: 6]\n" + |
794 |
" [pc: 24, line: 7]\n" + |
778 |
" [pc: 19, line: 7]\n" + |
795 |
" [pc: 32, line: 8]\n" + |
779 |
" [pc: 27, line: 10]\n" + |
796 |
" [pc: 35, line: 6]\n" + |
780 |
" [pc: 35, line: 11]\n" + |
797 |
" [pc: 40, line: 10]\n" + |
|
|
798 |
" [pc: 48, line: 11]\n" + |
799 |
" Local variable table:\n" + |
781 |
" Local variable table:\n" + |
800 |
" [pc: 0, pc: 49] local: args index: 0 type: java.lang.String[]\n" + |
782 |
" [pc: 0, pc: 36] local: args index: 0 type: java.lang.String[]\n" + |
801 |
" [pc: 4, pc: 49] local: tab index: 1 type: int[]\n"; |
783 |
" [pc: 4, pc: 36] local: tab index: 1 type: int[]\n"; |
802 |
|
784 |
|
803 |
try { |
785 |
try { |
804 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
786 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
Lines 851-885
Link Here
|
851 |
" 7 ldc <String \"SUC\"> [22]\n" + |
833 |
" 7 ldc <String \"SUC\"> [22]\n" + |
852 |
" 9 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + |
834 |
" 9 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + |
853 |
" 12 aload_1 [tab]\n" + |
835 |
" 12 aload_1 [tab]\n" + |
854 |
" 13 astore 4\n" + |
836 |
" 13 dup\n" + |
855 |
" 15 iconst_0\n" + |
837 |
" 14 astore 4\n" + |
856 |
" 16 istore_2\n" + |
838 |
" 16 arraylength\n" + |
857 |
" 17 aload 4\n" + |
839 |
" 17 istore_3\n" + |
858 |
" 19 arraylength\n" + |
840 |
" 18 iconst_0\n" + |
859 |
" 20 istore_3\n" + |
841 |
" 19 istore_2\n" + |
860 |
" 21 goto 35\n" + |
842 |
" 20 goto 34\n" + |
861 |
" 24 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
843 |
" 23 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
862 |
" 27 ldc <String \"1x\"> [30]\n" + |
844 |
" 26 ldc <String \"1x\"> [30]\n" + |
863 |
" 29 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + |
845 |
" 28 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + |
864 |
" 32 iinc 2 1\n" + |
846 |
" 31 iinc 2 1\n" + |
865 |
" 35 iload_2\n" + |
847 |
" 34 iload_2\n" + |
866 |
" 36 iload_3\n" + |
848 |
" 35 iload_3\n" + |
867 |
" 37 if_icmplt 24\n" + |
849 |
" 36 if_icmplt 23\n" + |
868 |
" 40 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
850 |
" 39 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
869 |
" 43 ldc <String \"CESS\"> [32]\n" + |
851 |
" 42 ldc <String \"CESS\"> [32]\n" + |
870 |
" 45 invokevirtual java.io.PrintStream.println(java.lang.String) : void [34]\n" + |
852 |
" 44 invokevirtual java.io.PrintStream.println(java.lang.String) : void [34]\n" + |
871 |
" 48 return\n" + |
853 |
" 47 return\n" + |
872 |
" Line numbers:\n" + |
854 |
" Line numbers:\n" + |
873 |
" [pc: 0, line: 4]\n" + |
855 |
" [pc: 0, line: 4]\n" + |
874 |
" [pc: 4, line: 5]\n" + |
856 |
" [pc: 4, line: 5]\n" + |
875 |
" [pc: 12, line: 6]\n" + |
857 |
" [pc: 12, line: 6]\n" + |
876 |
" [pc: 24, line: 7]\n" + |
858 |
" [pc: 23, line: 7]\n" + |
877 |
" [pc: 32, line: 6]\n" + |
859 |
" [pc: 31, line: 6]\n" + |
878 |
" [pc: 40, line: 10]\n" + |
860 |
" [pc: 39, line: 10]\n" + |
879 |
" [pc: 48, line: 11]\n" + |
861 |
" [pc: 47, line: 11]\n" + |
880 |
" Local variable table:\n" + |
862 |
" Local variable table:\n" + |
881 |
" [pc: 0, pc: 49] local: args index: 0 type: java.lang.String[]\n" + |
863 |
" [pc: 0, pc: 48] local: args index: 0 type: java.lang.String[]\n" + |
882 |
" [pc: 4, pc: 49] local: tab index: 1 type: int[]\n"; |
864 |
" [pc: 4, pc: 48] local: tab index: 1 type: int[]\n"; |
883 |
|
865 |
|
884 |
try { |
866 |
try { |
885 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
867 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
Lines 976-1034
Link Here
|
976 |
" 51 istore_3 [i]\n" + |
958 |
" 51 istore_3 [i]\n" + |
977 |
" 52 iinc 3 1 [i]\n" + |
959 |
" 52 iinc 3 1 [i]\n" + |
978 |
" 55 aload_1 [tab]\n" + |
960 |
" 55 aload_1 [tab]\n" + |
979 |
" 56 astore 7\n" + |
961 |
" 56 dup\n" + |
980 |
" 58 iconst_0\n" + |
962 |
" 57 astore 7\n" + |
981 |
" 59 istore 5\n" + |
963 |
" 59 arraylength\n" + |
982 |
" 61 aload 7\n" + |
964 |
" 60 istore 6\n" + |
983 |
" 63 arraylength\n" + |
965 |
" 62 iconst_0\n" + |
984 |
" 64 istore 6\n" + |
966 |
" 63 istore 5\n" + |
985 |
" 66 goto 101\n" + |
967 |
" 65 goto 100\n" + |
986 |
" 69 aload 7\n" + |
968 |
" 68 aload 7\n" + |
987 |
" 71 iload 5\n" + |
969 |
" 70 iload 5\n" + |
988 |
" 73 iaload\n" + |
970 |
" 72 iaload\n" + |
989 |
" 74 istore 4 [e]\n" + |
971 |
" 73 istore 4 [e]\n" + |
990 |
" 76 iload_2 [sum]\n" + |
972 |
" 75 iload_2 [sum]\n" + |
991 |
" 77 iload 4 [e]\n" + |
973 |
" 76 iload 4 [e]\n" + |
992 |
" 79 iadd\n" + |
974 |
" 78 iadd\n" + |
993 |
" 80 istore_2 [sum]\n" + |
975 |
" 79 istore_2 [sum]\n" + |
994 |
" 81 iload_3 [i]\n" + |
976 |
" 80 iload_3 [i]\n" + |
995 |
" 82 iconst_3\n" + |
977 |
" 81 iconst_3\n" + |
996 |
" 83 if_icmpne 89\n" + |
978 |
" 82 if_icmpne 88\n" + |
997 |
" 86 goto 111\n" + |
979 |
" 85 goto 110\n" + |
998 |
" 89 iload 4 [e]\n" + |
980 |
" 88 iload 4 [e]\n" + |
999 |
" 91 iconst_5\n" + |
981 |
" 90 iconst_5\n" + |
1000 |
" 92 if_icmpne 98\n" + |
982 |
" 91 if_icmpne 97\n" + |
1001 |
" 95 goto 52\n" + |
983 |
" 94 goto 52\n" + |
1002 |
" 98 iinc 5 1\n" + |
984 |
" 97 iinc 5 1\n" + |
1003 |
" 101 iload 5\n" + |
985 |
" 100 iload 5\n" + |
1004 |
" 103 iload 6\n" + |
986 |
" 102 iload 6\n" + |
1005 |
" 105 if_icmplt 69\n" + |
987 |
" 104 if_icmplt 68\n" + |
1006 |
" 108 goto 52\n" + |
988 |
" 107 goto 52\n" + |
1007 |
" 111 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
989 |
" 110 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
1008 |
" 114 iload_2 [sum]\n" + |
990 |
" 113 iload_2 [sum]\n" + |
1009 |
" 115 invokevirtual java.io.PrintStream.println(int) : void [22]\n" + |
991 |
" 114 invokevirtual java.io.PrintStream.println(int) : void [22]\n" + |
1010 |
" 118 return\n" + |
992 |
" 117 return\n" + |
1011 |
" Line numbers:\n" + |
993 |
" Line numbers:\n" + |
1012 |
" [pc: 0, line: 3]\n" + |
994 |
" [pc: 0, line: 3]\n" + |
1013 |
" [pc: 48, line: 4]\n" + |
995 |
" [pc: 48, line: 4]\n" + |
1014 |
" [pc: 50, line: 5]\n" + |
996 |
" [pc: 50, line: 5]\n" + |
1015 |
" [pc: 52, line: 7]\n" + |
997 |
" [pc: 52, line: 7]\n" + |
1016 |
" [pc: 55, line: 8]\n" + |
998 |
" [pc: 55, line: 8]\n" + |
1017 |
" [pc: 76, line: 9]\n" + |
999 |
" [pc: 75, line: 9]\n" + |
1018 |
" [pc: 81, line: 10]\n" + |
1000 |
" [pc: 80, line: 10]\n" + |
1019 |
" [pc: 86, line: 11]\n" + |
1001 |
" [pc: 85, line: 11]\n" + |
1020 |
" [pc: 89, line: 12]\n" + |
1002 |
" [pc: 88, line: 12]\n" + |
1021 |
" [pc: 95, line: 13]\n" + |
1003 |
" [pc: 94, line: 13]\n" + |
1022 |
" [pc: 98, line: 8]\n" + |
1004 |
" [pc: 97, line: 8]\n" + |
1023 |
" [pc: 108, line: 6]\n" + |
1005 |
" [pc: 107, line: 6]\n" + |
1024 |
" [pc: 111, line: 19]\n" + |
1006 |
" [pc: 110, line: 19]\n" + |
1025 |
" [pc: 118, line: 20]\n" + |
1007 |
" [pc: 117, line: 20]\n" + |
1026 |
" Local variable table:\n" + |
1008 |
" Local variable table:\n" + |
1027 |
" [pc: 0, pc: 119] local: args index: 0 type: java.lang.String[]\n" + |
1009 |
" [pc: 0, pc: 118] local: args index: 0 type: java.lang.String[]\n" + |
1028 |
" [pc: 48, pc: 119] local: tab index: 1 type: int[]\n" + |
1010 |
" [pc: 48, pc: 118] local: tab index: 1 type: int[]\n" + |
1029 |
" [pc: 50, pc: 119] local: sum index: 2 type: int\n" + |
1011 |
" [pc: 50, pc: 118] local: sum index: 2 type: int\n" + |
1030 |
" [pc: 52, pc: 119] local: i index: 3 type: int\n" + |
1012 |
" [pc: 52, pc: 118] local: i index: 3 type: int\n" + |
1031 |
" [pc: 76, pc: 98] local: e index: 4 type: int\n"; |
1013 |
" [pc: 75, pc: 97] local: e index: 4 type: int\n"; |
1032 |
|
1014 |
|
1033 |
try { |
1015 |
try { |
1034 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
1016 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
Lines 1221-1275
Link Here
|
1221 |
" 14 invokespecial java.util.ArrayList() [22]\n" + |
1203 |
" 14 invokespecial java.util.ArrayList() [22]\n" + |
1222 |
" 17 astore_2 [list]\n" + |
1204 |
" 17 astore_2 [list]\n" + |
1223 |
" 18 aload_1 [tab]\n" + |
1205 |
" 18 aload_1 [tab]\n" + |
1224 |
" 19 astore 6\n" + |
1206 |
" 19 dup\n" + |
1225 |
" 21 iconst_0\n" + |
1207 |
" 20 astore 6\n" + |
1226 |
" 22 istore 4\n" + |
1208 |
" 22 arraylength\n" + |
1227 |
" 24 aload 6\n" + |
1209 |
" 23 istore 5\n" + |
1228 |
" 26 arraylength\n" + |
1210 |
" 25 iconst_0\n" + |
1229 |
" 27 istore 5\n" + |
1211 |
" 26 istore 4\n" + |
1230 |
" 29 goto 49\n" + |
1212 |
" 28 goto 48\n" + |
1231 |
" 32 aload 6\n" + |
1213 |
" 31 aload 6\n" + |
1232 |
" 34 iload 4\n" + |
1214 |
" 33 iload 4\n" + |
1233 |
" 36 aaload\n" + |
1215 |
" 35 aaload\n" + |
1234 |
" 37 astore_3 [arg]\n" + |
1216 |
" 36 astore_3 [arg]\n" + |
1235 |
" 38 aload_2 [list]\n" + |
1217 |
" 37 aload_2 [list]\n" + |
1236 |
" 39 aload_3 [arg]\n" + |
1218 |
" 38 aload_3 [arg]\n" + |
1237 |
" 40 invokeinterface java.util.List.add(java.lang.Object) : boolean [23] [nargs: 2]\n" + |
1219 |
" 39 invokeinterface java.util.List.add(java.lang.Object) : boolean [23] [nargs: 2]\n" + |
1238 |
" 45 pop\n" + |
1220 |
" 44 pop\n" + |
1239 |
" 46 iinc 4 1\n" + |
1221 |
" 45 iinc 4 1\n" + |
1240 |
" 49 iload 4\n" + |
1222 |
" 48 iload 4\n" + |
1241 |
" 51 iload 5\n" + |
1223 |
" 50 iload 5\n" + |
1242 |
" 53 if_icmplt 32\n" + |
1224 |
" 52 if_icmplt 31\n" + |
1243 |
" 56 aload_2 [list]\n" + |
1225 |
" 55 aload_2 [list]\n" + |
1244 |
" 57 invokeinterface java.util.List.iterator() : java.util.Iterator [29] [nargs: 1]\n" + |
1226 |
" 56 invokeinterface java.util.List.iterator() : java.util.Iterator [29] [nargs: 1]\n" + |
1245 |
" 62 astore 4\n" + |
1227 |
" 61 astore 4\n" + |
1246 |
" 64 goto 82\n" + |
1228 |
" 63 goto 81\n" + |
1247 |
" 67 aload 4\n" + |
1229 |
" 66 aload 4\n" + |
1248 |
" 69 invokeinterface java.util.Iterator.next() : java.lang.Object [33] [nargs: 1]\n" + |
1230 |
" 68 invokeinterface java.util.Iterator.next() : java.lang.Object [33] [nargs: 1]\n" + |
1249 |
" 74 astore_3 [arg]\n" + |
1231 |
" 73 astore_3 [arg]\n" + |
1250 |
" 75 getstatic java.lang.System.out : java.io.PrintStream [39]\n" + |
1232 |
" 74 getstatic java.lang.System.out : java.io.PrintStream [39]\n" + |
1251 |
" 78 aload_3 [arg]\n" + |
1233 |
" 77 aload_3 [arg]\n" + |
1252 |
" 79 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [45]\n" + |
1234 |
" 78 invokevirtual java.io.PrintStream.print(java.lang.Object) : void [45]\n" + |
1253 |
" 82 aload 4\n" + |
1235 |
" 81 aload 4\n" + |
1254 |
" 84 invokeinterface java.util.Iterator.hasNext() : boolean [51] [nargs: 1]\n" + |
1236 |
" 83 invokeinterface java.util.Iterator.hasNext() : boolean [51] [nargs: 1]\n" + |
1255 |
" 89 ifne 67\n" + |
1237 |
" 88 ifne 66\n" + |
1256 |
" 92 return\n" + |
1238 |
" 91 return\n" + |
1257 |
" Line numbers:\n" + |
1239 |
" Line numbers:\n" + |
1258 |
" [pc: 0, line: 6]\n" + |
1240 |
" [pc: 0, line: 6]\n" + |
1259 |
" [pc: 10, line: 7]\n" + |
1241 |
" [pc: 10, line: 7]\n" + |
1260 |
" [pc: 18, line: 8]\n" + |
1242 |
" [pc: 18, line: 8]\n" + |
1261 |
" [pc: 38, line: 9]\n" + |
1243 |
" [pc: 37, line: 9]\n" + |
1262 |
" [pc: 46, line: 8]\n" + |
1244 |
" [pc: 45, line: 8]\n" + |
1263 |
" [pc: 56, line: 11]\n" + |
1245 |
" [pc: 55, line: 11]\n" + |
1264 |
" [pc: 75, line: 12]\n" + |
1246 |
" [pc: 74, line: 12]\n" + |
1265 |
" [pc: 82, line: 11]\n" + |
1247 |
" [pc: 81, line: 11]\n" + |
1266 |
" [pc: 92, line: 14]\n" + |
1248 |
" [pc: 91, line: 14]\n" + |
1267 |
" Local variable table:\n" + |
1249 |
" Local variable table:\n" + |
1268 |
" [pc: 0, pc: 93] local: args index: 0 type: java.lang.String[]\n" + |
1250 |
" [pc: 0, pc: 92] local: args index: 0 type: java.lang.String[]\n" + |
1269 |
" [pc: 10, pc: 93] local: tab index: 1 type: java.lang.String[]\n" + |
1251 |
" [pc: 10, pc: 92] local: tab index: 1 type: java.lang.String[]\n" + |
1270 |
" [pc: 18, pc: 93] local: list index: 2 type: java.util.List\n" + |
1252 |
" [pc: 18, pc: 92] local: list index: 2 type: java.util.List\n" + |
1271 |
" [pc: 38, pc: 46] local: arg index: 3 type: java.lang.String\n" + |
1253 |
" [pc: 37, pc: 45] local: arg index: 3 type: java.lang.String\n" + |
1272 |
" [pc: 75, pc: 82] local: arg index: 3 type: java.lang.Object\n"; |
1254 |
" [pc: 74, pc: 81] local: arg index: 3 type: java.lang.Object\n"; |
1273 |
|
1255 |
|
1274 |
try { |
1256 |
try { |
1275 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
1257 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
Lines 1360-1404
Link Here
|
1360 |
|
1342 |
|
1361 |
String expectedOutput = |
1343 |
String expectedOutput = |
1362 |
" // Method descriptor #15 ([Ljava/lang/String;)V\n" + |
1344 |
" // Method descriptor #15 ([Ljava/lang/String;)V\n" + |
1363 |
" // Stack: 2, Locals: 5\n" + |
1345 |
" // Stack: 2, Locals: 3\n" + |
1364 |
" public static void main(java.lang.String[] args);\n" + |
1346 |
" public static void main(java.lang.String[] args);\n" + |
1365 |
" 0 iconst_0\n" + |
1347 |
" 0 iconst_0\n" + |
1366 |
" 1 anewarray java.lang.Object [3]\n" + |
1348 |
" 1 anewarray java.lang.Object [3]\n" + |
1367 |
" 4 astore_1 [array]\n" + |
1349 |
" 4 astore_1 [array]\n" + |
1368 |
" 5 aload_1 [array]\n" + |
1350 |
" 5 aload_1 [array]\n" + |
1369 |
" 6 astore 4\n" + |
1351 |
" 6 dup\n" + |
1370 |
" 8 iconst_0\n" + |
1352 |
" 7 astore_2\n" + |
1371 |
" 9 istore_2\n" + |
1353 |
" 8 arraylength\n" + |
1372 |
" 10 aload 4\n" + |
1354 |
" 9 ifeq 22\n" + |
1373 |
" 12 arraylength\n" + |
1355 |
" 12 aload_0 [args]\n" + |
1374 |
" 13 istore_3\n" + |
1356 |
" 13 ifnonnull 21\n" + |
1375 |
" 14 goto 27\n" + |
1357 |
" 16 aconst_null\n" + |
1376 |
" 17 aload_0 [args]\n" + |
1358 |
" 17 pop\n" + |
1377 |
" 18 ifnonnull 26\n" + |
1359 |
" 18 goto 22\n" + |
1378 |
" 21 aconst_null\n" + |
1360 |
" 21 return\n" + |
1379 |
" 22 pop\n" + |
1361 |
" 22 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
1380 |
" 23 goto 32\n" + |
1362 |
" 25 ldc <String \"SUCCESS\"> [22]\n" + |
1381 |
" 26 return\n" + |
1363 |
" 27 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" + |
1382 |
" 27 iload_2\n" + |
1364 |
" 30 return\n" + |
1383 |
" 28 iload_3\n" + |
|
|
1384 |
" 29 if_icmplt 17\n" + |
1385 |
" 32 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
1386 |
" 35 ldc <String \"SUCCESS\"> [22]\n" + |
1387 |
" 37 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" + |
1388 |
" 40 return\n" + |
1389 |
" Line numbers:\n" + |
1365 |
" Line numbers:\n" + |
1390 |
" [pc: 0, line: 3]\n" + |
1366 |
" [pc: 0, line: 3]\n" + |
1391 |
" [pc: 5, line: 6]\n" + |
1367 |
" [pc: 5, line: 6]\n" + |
1392 |
" [pc: 17, line: 7]\n" + |
1368 |
" [pc: 12, line: 7]\n" + |
1393 |
" [pc: 21, line: 8]\n" + |
1369 |
" [pc: 16, line: 8]\n" + |
1394 |
" [pc: 23, line: 9]\n" + |
1370 |
" [pc: 18, line: 9]\n" + |
1395 |
" [pc: 26, line: 11]\n" + |
1371 |
" [pc: 21, line: 11]\n" + |
1396 |
" [pc: 27, line: 6]\n" + |
1372 |
" [pc: 22, line: 13]\n" + |
1397 |
" [pc: 32, line: 13]\n" + |
1373 |
" [pc: 30, line: 14]\n" + |
1398 |
" [pc: 40, line: 14]\n" + |
|
|
1399 |
" Local variable table:\n" + |
1374 |
" Local variable table:\n" + |
1400 |
" [pc: 0, pc: 41] local: args index: 0 type: java.lang.String[]\n" + |
1375 |
" [pc: 0, pc: 31] local: args index: 0 type: java.lang.String[]\n" + |
1401 |
" [pc: 5, pc: 41] local: array index: 1 type: java.lang.Object[]\n"; |
1376 |
" [pc: 5, pc: 31] local: array index: 1 type: java.lang.Object[]\n"; |
1402 |
|
1377 |
|
1403 |
try { |
1378 |
try { |
1404 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
1379 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
Lines 2386-2412
Link Here
|
2386 |
" // Stack: 2, Locals: 5\n" + |
2361 |
" // Stack: 2, Locals: 5\n" + |
2387 |
" public static void main(java.lang.String[] args);\n" + |
2362 |
" public static void main(java.lang.String[] args);\n" + |
2388 |
" 0 invokestatic X.initForEach() : int[] [16]\n" + |
2363 |
" 0 invokestatic X.initForEach() : int[] [16]\n" + |
2389 |
" 3 astore 4\n" + |
2364 |
" 3 dup\n" + |
2390 |
" 5 iconst_0\n" + |
2365 |
" 4 astore 4\n" + |
2391 |
" 6 istore_2\n" + |
2366 |
" 6 arraylength\n" + |
2392 |
" 7 aload 4\n" + |
2367 |
" 7 istore_3\n" + |
2393 |
" 9 arraylength\n" + |
2368 |
" 8 iconst_0\n" + |
2394 |
" 10 istore_3\n" + |
2369 |
" 9 istore_2\n" + |
2395 |
" 11 goto 22\n" + |
2370 |
" 10 goto 21\n" + |
2396 |
" 14 aload 4\n" + |
2371 |
" 13 aload 4\n" + |
2397 |
" 16 iload_2\n" + |
2372 |
" 15 iload_2\n" + |
2398 |
" 17 iaload\n" + |
2373 |
" 16 iaload\n" + |
2399 |
" 18 istore_1\n" + |
2374 |
" 17 istore_1\n" + |
2400 |
" 19 iinc 2 1\n" + |
2375 |
" 18 iinc 2 1\n" + |
2401 |
" 22 iload_2\n" + |
2376 |
" 21 iload_2\n" + |
2402 |
" 23 iload_3\n" + |
2377 |
" 22 iload_3\n" + |
2403 |
" 24 if_icmplt 14\n" + |
2378 |
" 23 if_icmplt 13\n" + |
2404 |
" 27 return\n" + |
2379 |
" 26 return\n" + |
2405 |
" Line numbers:\n" + |
2380 |
" Line numbers:\n" + |
2406 |
" [pc: 0, line: 3]\n" + |
2381 |
" [pc: 0, line: 3]\n" + |
2407 |
" [pc: 27, line: 5]\n" + |
2382 |
" [pc: 26, line: 5]\n" + |
2408 |
" Local variable table:\n" + |
2383 |
" Local variable table:\n" + |
2409 |
" [pc: 0, pc: 28] local: args index: 0 type: java.lang.String[]\n"; |
2384 |
" [pc: 0, pc: 27] local: args index: 0 type: java.lang.String[]\n"; |
2410 |
|
2385 |
|
2411 |
try { |
2386 |
try { |
2412 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
2387 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
Lines 2510-2521
Link Here
|
2510 |
" // Stack: 2, Locals: 4\n" + |
2485 |
" // Stack: 2, Locals: 4\n" + |
2511 |
" public static void foo();\n" + |
2486 |
" public static void foo();\n" + |
2512 |
" 0 invokestatic X.initForEach() : int[] [21]\n" + |
2487 |
" 0 invokestatic X.initForEach() : int[] [21]\n" + |
2513 |
" 3 astore_3\n" + |
2488 |
" 3 dup\n" + |
2514 |
" 4 iconst_0\n" + |
2489 |
" 4 astore_3\n" + |
2515 |
" 5 istore_1\n" + |
2490 |
" 5 arraylength\n" + |
2516 |
" 6 aload_3\n" + |
2491 |
" 6 istore_2\n" + |
2517 |
" 7 arraylength\n" + |
2492 |
" 7 iconst_0\n" + |
2518 |
" 8 istore_2\n" + |
2493 |
" 8 istore_1\n" + |
2519 |
" 9 goto 19\n" + |
2494 |
" 9 goto 19\n" + |
2520 |
" 12 aload_3\n" + |
2495 |
" 12 aload_3\n" + |
2521 |
" 13 iload_1\n" + |
2496 |
" 13 iload_1\n" + |
Lines 2579-2611
Link Here
|
2579 |
" // Stack: 2, Locals: 5\n" + |
2554 |
" // Stack: 2, Locals: 5\n" + |
2580 |
" public static void main(java.lang.String[] args);\n" + |
2555 |
" public static void main(java.lang.String[] args);\n" + |
2581 |
" 0 invokestatic X.initForEach() : int[] [16]\n" + |
2556 |
" 0 invokestatic X.initForEach() : int[] [16]\n" + |
2582 |
" 3 astore 4\n" + |
2557 |
" 3 dup\n" + |
2583 |
" 5 iconst_0\n" + |
2558 |
" 4 astore 4\n" + |
2584 |
" 6 istore_2\n" + |
2559 |
" 6 arraylength\n" + |
2585 |
" 7 aload 4\n" + |
2560 |
" 7 istore_3\n" + |
2586 |
" 9 arraylength\n" + |
2561 |
" 8 iconst_0\n" + |
2587 |
" 10 istore_3\n" + |
2562 |
" 9 istore_2\n" + |
2588 |
" 11 goto 30\n" + |
2563 |
" 10 goto 29\n" + |
2589 |
" 14 aload 4\n" + |
2564 |
" 13 aload 4\n" + |
2590 |
" 16 iload_2\n" + |
2565 |
" 15 iload_2\n" + |
2591 |
" 17 iaload\n" + |
2566 |
" 16 iaload\n" + |
2592 |
" 18 istore_1 [i]\n" + |
2567 |
" 17 istore_1 [i]\n" + |
2593 |
" 19 getstatic java.lang.System.out : java.io.PrintStream [20]\n" + |
2568 |
" 18 getstatic java.lang.System.out : java.io.PrintStream [20]\n" + |
2594 |
" 22 bipush 97\n" + |
2569 |
" 21 bipush 97\n" + |
2595 |
" 24 invokevirtual java.io.PrintStream.print(char) : void [26]\n" + |
2570 |
" 23 invokevirtual java.io.PrintStream.print(char) : void [26]\n" + |
2596 |
" 27 iinc 2 1\n" + |
2571 |
" 26 iinc 2 1\n" + |
2597 |
" 30 iload_2\n" + |
2572 |
" 29 iload_2\n" + |
2598 |
" 31 iload_3\n" + |
2573 |
" 30 iload_3\n" + |
2599 |
" 32 if_icmplt 14\n" + |
2574 |
" 31 if_icmplt 13\n" + |
2600 |
" 35 return\n" + |
2575 |
" 34 return\n" + |
2601 |
" Line numbers:\n" + |
2576 |
" Line numbers:\n" + |
2602 |
" [pc: 0, line: 3]\n" + |
2577 |
" [pc: 0, line: 3]\n" + |
2603 |
" [pc: 19, line: 4]\n" + |
2578 |
" [pc: 18, line: 4]\n" + |
2604 |
" [pc: 27, line: 3]\n" + |
2579 |
" [pc: 26, line: 3]\n" + |
2605 |
" [pc: 35, line: 6]\n" + |
2580 |
" [pc: 34, line: 6]\n" + |
2606 |
" Local variable table:\n" + |
2581 |
" Local variable table:\n" + |
2607 |
" [pc: 0, pc: 36] local: args index: 0 type: java.lang.String[]\n" + |
2582 |
" [pc: 0, pc: 35] local: args index: 0 type: java.lang.String[]\n" + |
2608 |
" [pc: 19, pc: 27] local: i index: 1 type: int\n"; |
2583 |
" [pc: 18, pc: 26] local: i index: 1 type: int\n"; |
2609 |
|
2584 |
|
2610 |
try { |
2585 |
try { |
2611 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
2586 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
Lines 2656-2667
Link Here
|
2656 |
" // Stack: 2, Locals: 4\n" + |
2631 |
" // Stack: 2, Locals: 4\n" + |
2657 |
" public static void main(java.lang.String[] args);\n" + |
2632 |
" public static void main(java.lang.String[] args);\n" + |
2658 |
" 0 invokestatic X.initForEach() : int[] [16]\n" + |
2633 |
" 0 invokestatic X.initForEach() : int[] [16]\n" + |
2659 |
" 3 astore_3\n" + |
2634 |
" 3 dup\n" + |
2660 |
" 4 iconst_0\n" + |
2635 |
" 4 astore_3\n" + |
2661 |
" 5 istore_1\n" + |
2636 |
" 5 arraylength\n" + |
2662 |
" 6 aload_3\n" + |
2637 |
" 6 istore_2\n" + |
2663 |
" 7 arraylength\n" + |
2638 |
" 7 iconst_0\n" + |
2664 |
" 8 istore_2\n" + |
2639 |
" 8 istore_1\n" + |
2665 |
" 9 goto 23\n" + |
2640 |
" 9 goto 23\n" + |
2666 |
" 12 getstatic java.lang.System.out : java.io.PrintStream [20]\n" + |
2641 |
" 12 getstatic java.lang.System.out : java.io.PrintStream [20]\n" + |
2667 |
" 15 bipush 97\n" + |
2642 |
" 15 bipush 97\n" + |
Lines 2697-2702
Link Here
|
2697 |
assertTrue(false); |
2672 |
assertTrue(false); |
2698 |
} |
2673 |
} |
2699 |
} |
2674 |
} |
|
|
2675 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=180471 |
2676 |
public void test047() { |
2677 |
this.runConformTest( |
2678 |
new String[] { |
2679 |
"X.java", |
2680 |
"public class X {\n" + |
2681 |
" void foo3(int[] array) {\n" + |
2682 |
" for (int i : array) {\n" + |
2683 |
" System.out.println(i);\n" + |
2684 |
" break;\n" + |
2685 |
" }\n" + |
2686 |
" }\n" + |
2687 |
"}\n", // ================= |
2688 |
}, |
2689 |
""); |
2690 |
|
2691 |
String expectedOutput = |
2692 |
" // Method descriptor #15 ([I)V\n" + |
2693 |
" // Stack: 2, Locals: 4\n" + |
2694 |
" void foo3(int[] array);\n" + |
2695 |
" 0 aload_1 [array]\n" + |
2696 |
" 1 dup\n" + |
2697 |
" 2 astore_3\n" + |
2698 |
" 3 arraylength\n" + |
2699 |
" 4 ifeq 18\n" + |
2700 |
" 7 aload_3\n" + |
2701 |
" 8 iconst_0\n" + |
2702 |
" 9 iaload\n" + |
2703 |
" 10 istore_2 [i]\n" + |
2704 |
" 11 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
2705 |
" 14 iload_2 [i]\n" + |
2706 |
" 15 invokevirtual java.io.PrintStream.println(int) : void [22]\n" + |
2707 |
" 18 return\n" + |
2708 |
" Line numbers:\n" + |
2709 |
" [pc: 0, line: 3]\n" + |
2710 |
" [pc: 11, line: 4]\n" + |
2711 |
" [pc: 18, line: 7]\n" + |
2712 |
" Local variable table:\n" + |
2713 |
" [pc: 0, pc: 19] local: this index: 0 type: X\n" + |
2714 |
" [pc: 0, pc: 19] local: array index: 1 type: int[]\n" + |
2715 |
" [pc: 11, pc: 18] local: i index: 2 type: int\n"; |
2716 |
|
2717 |
try { |
2718 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
2719 |
byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f); |
2720 |
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler(); |
2721 |
String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED); |
2722 |
int index = result.indexOf(expectedOutput); |
2723 |
if (index == -1 || expectedOutput.length() == 0) { |
2724 |
System.out.println(Util.displayString(result, 3)); |
2725 |
} |
2726 |
if (index == -1) { |
2727 |
assertEquals("Wrong contents", expectedOutput, result); |
2728 |
} |
2729 |
} catch (org.eclipse.jdt.core.util.ClassFormatException e) { |
2730 |
assertTrue(false); |
2731 |
} catch (IOException e) { |
2732 |
assertTrue(false); |
2733 |
} |
2734 |
} |
2735 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=180471 - variation |
2736 |
public void test048() { |
2737 |
this.runConformTest( |
2738 |
new String[] { |
2739 |
"X.java", |
2740 |
"public class X {\n" + |
2741 |
" void foo3(java.util.List<String> ls) {\n" + |
2742 |
" for (String s : ls) {\n" + |
2743 |
" System.out.println(s);\n" + |
2744 |
" break;\n" + |
2745 |
" }\n" + |
2746 |
" }\n" + |
2747 |
"}\n", // ================= |
2748 |
}, |
2749 |
""); |
2750 |
|
2751 |
String expectedOutput = |
2752 |
" // Method descriptor #15 ([I)V\n" + |
2753 |
" // Stack: 2, Locals: 4\n" + |
2754 |
" void foo3(int[] array);\n" + |
2755 |
" 0 aload_1 [array]\n" + |
2756 |
" 1 dup\n" + |
2757 |
" 2 astore_3\n" + |
2758 |
" 3 arraylength\n" + |
2759 |
" 4 ifeq 18\n" + |
2760 |
" 7 aload_3\n" + |
2761 |
" 8 iconst_0\n" + |
2762 |
" 9 iaload\n" + |
2763 |
" 10 istore_2 [i]\n" + |
2764 |
" 11 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
2765 |
" 14 iload_2 [i]\n" + |
2766 |
" 15 invokevirtual java.io.PrintStream.println(int) : void [22]\n" + |
2767 |
" 18 return\n" + |
2768 |
" Line numbers:\n" + |
2769 |
" [pc: 0, line: 3]\n" + |
2770 |
" [pc: 11, line: 4]\n" + |
2771 |
" [pc: 18, line: 7]\n" + |
2772 |
" Local variable table:\n" + |
2773 |
" [pc: 0, pc: 19] local: this index: 0 type: X\n" + |
2774 |
" [pc: 0, pc: 19] local: array index: 1 type: int[]\n" + |
2775 |
" [pc: 11, pc: 18] local: i index: 2 type: int\n"; |
2776 |
|
2777 |
try { |
2778 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
2779 |
byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f); |
2780 |
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler(); |
2781 |
String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED); |
2782 |
int index = result.indexOf(expectedOutput); |
2783 |
if (index == -1 || expectedOutput.length() == 0) { |
2784 |
System.out.println(Util.displayString(result, 3)); |
2785 |
} |
2786 |
if (index == -1) { |
2787 |
assertEquals("Wrong contents", expectedOutput, result); |
2788 |
} |
2789 |
} catch (org.eclipse.jdt.core.util.ClassFormatException e) { |
2790 |
assertTrue(false); |
2791 |
} catch (IOException e) { |
2792 |
assertTrue(false); |
2793 |
} |
2794 |
} |
2795 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=180471 - variation |
2796 |
public void test049() { |
2797 |
this.runConformTest( |
2798 |
new String[] { |
2799 |
"X.java", |
2800 |
"public class X {\n" + |
2801 |
" void foo3(int[] array) {\n" + |
2802 |
" void foo3(java.util.List l) {\n" + |
2803 |
" for (Object o : l) {\n" + |
2804 |
" System.out.println(o);\n" + |
2805 |
" break;\n" + |
2806 |
" }\n" + |
2807 |
" }\n" + |
2808 |
" }\n" + |
2809 |
"}\n", // ================= |
2810 |
}, |
2811 |
""); |
2812 |
|
2813 |
String expectedOutput = |
2814 |
" // Method descriptor #15 ([I)V\n" + |
2815 |
" // Stack: 2, Locals: 4\n" + |
2816 |
" void foo3(int[] array);\n" + |
2817 |
" 0 aload_1 [array]\n" + |
2818 |
" 1 dup\n" + |
2819 |
" 2 astore_3\n" + |
2820 |
" 3 arraylength\n" + |
2821 |
" 4 ifeq 18\n" + |
2822 |
" 7 aload_3\n" + |
2823 |
" 8 iconst_0\n" + |
2824 |
" 9 iaload\n" + |
2825 |
" 10 istore_2 [i]\n" + |
2826 |
" 11 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + |
2827 |
" 14 iload_2 [i]\n" + |
2828 |
" 15 invokevirtual java.io.PrintStream.println(int) : void [22]\n" + |
2829 |
" 18 return\n" + |
2830 |
" Line numbers:\n" + |
2831 |
" [pc: 0, line: 3]\n" + |
2832 |
" [pc: 11, line: 4]\n" + |
2833 |
" [pc: 18, line: 7]\n" + |
2834 |
" Local variable table:\n" + |
2835 |
" [pc: 0, pc: 19] local: this index: 0 type: X\n" + |
2836 |
" [pc: 0, pc: 19] local: array index: 1 type: int[]\n" + |
2837 |
" [pc: 11, pc: 18] local: i index: 2 type: int\n"; |
2838 |
|
2839 |
try { |
2840 |
File f = new File(OUTPUT_DIR + File.separator + "X.class"); |
2841 |
byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f); |
2842 |
ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler(); |
2843 |
String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED); |
2844 |
int index = result.indexOf(expectedOutput); |
2845 |
if (index == -1 || expectedOutput.length() == 0) { |
2846 |
System.out.println(Util.displayString(result, 3)); |
2847 |
} |
2848 |
if (index == -1) { |
2849 |
assertEquals("Wrong contents", expectedOutput, result); |
2850 |
} |
2851 |
} catch (org.eclipse.jdt.core.util.ClassFormatException e) { |
2852 |
assertTrue(false); |
2853 |
} catch (IOException e) { |
2854 |
assertTrue(false); |
2855 |
} |
2856 |
} |
2700 |
public static Class testClass() { |
2857 |
public static Class testClass() { |
2701 |
return ForeachStatementTest.class; |
2858 |
return ForeachStatementTest.class; |
2702 |
} |
2859 |
} |