comparison c1x4hotspotsrc/HotSpotTest/src/C1XTest.java @ 1433:efba53f86c4f

various fixes and enhancements * correct refmap->oopmap conversion (register numbering, stack slot numbering) * fixes for inlining (correct scoping in exception handler lookup, NPE in scope conversion) * support for "jump to runtime stub" (patching code needs to be aware of jmp instruction) * provide more information about methods (to allow inlining: has_balanced_monitors, etc.) * fixes to signature type lookup * isSubTypeOf: correct handling of array classes * RiType: componentType/arrayOf * prologue: inline cache check, icmiss stub * klass state check (resolved but not initialized) in newinstance * card table write barriers * c1x classes are optional (to allow running c1 without them) * correct for stored frame pointer in calling conventions (methods with arguments on stack) * getType(Class<?>) for some basic types, used for optimizations and folding * RiMethod/RiType: throw exception instead of silent failure on unsupported operations * RiType: resolved/unresolved array type support * refactoring: new on-demand template generation mechanism * optimizations: template specialization for no_null_check, given length, etc.
author Lukas Stadler <lukas.stadler@oracle.com>
date Thu, 16 Sep 2010 19:42:20 -0700
parents 760213a60e8b
children 72cfb36c6bb2
comparison
equal deleted inserted replaced
1432:b61a43cd1255 1433:efba53f86c4f
1 import java.io.IOException; 1 import java.io.IOException;
2 2
3 public class C1XTest { 3 public class C1XTest {
4 4
5 public static void main(String[] args) throws IOException { 5 public static long sum = 10;
6 /* 6
7 * new C1XCompiledTest.C(); System.out.println("--- instanceof A"); 7 public static final long value() {
8 * System.out.println(new C1XCompiledTest().doCalc(10, 3, 8 return sum;
9 * C1XTest.class)); System.out.println("B instanceof A");
10 * System.out.println(new C1XCompiledTest().doCalc(10, 3, new
11 * C1XCompiledTest.B())); System.out.println("A instanceof A");
12 * System.out.println(new C1XCompiledTest().doCalc(10, 3, new
13 * C1XCompiledTest.A())); System.out.println("end");
14 */
15 new C1XCompiledTest.B();
16 System.out.println(new C1XCompiledTest().doCalc(10, 3, C1XTest.class));
17 /*
18 * for (int l = 0; l < 4; l++) { try { System.out.println(new
19 * C1XCompiledTest().doCalc(new int[l])); } catch (Throwable t) {
20 * t.printStackTrace(); }}
21 */
22 } 9 }
10
11 public static void main3(String[] args) {/*
12 long s = 0;
13 s += value();
14 System.out.println(s);*/
15 }
16
17 public static void main2(String[] args) {
18 Other.I[] array = new Other.I[] { new Other.A(), new Other.B(),
19 new Other.C(), new Other.A(), new Other.B(), new Other.C() };
20
21 int sum = 0;
22 for (int i = 0; i < 20; i++)
23 for (Other.I o : array) {
24 sum += o.v();
25 }
26 System.out.println(sum);
27 }
28
29 public static void main(String[] args) throws IOException, Exception {
30 for (int i = 0; i < 10000; i++) {
31 System.out.print((i & 0xfff) != 0 ? "" : ".");
32 test1();
33 }
34 System.out.println();
35 for (int i = 0; i < 100; i++) {
36 Thread.sleep(1000);
37 }
38 for (int i = 0; i < 10000; i++) {
39 System.out.print((i & 0xfff) != 0 ? "" : ".");
40 test2();
41 }
42 System.out.println();
43 for (int i = 0; i < 100; i++) {
44 Thread.sleep(1000);
45 }
46 for (int i = 0; i < 10000; i++) {
47 System.out.print((i & 0xfff) != 0 ? "" : ".");
48 test3();
49 }
50 System.out.println();
51 for (int i = 0; i < 100; i++) {
52 Thread.sleep(1000);
53 }
54 for (int i = 0; i < 10000; i++) {
55 System.out.print((i & 0xfff) != 0 ? "" : ".");
56 test4();
57 }
58 System.out.println();
59 for (int i = 0; i < 100; i++) {
60 Thread.sleep(1000);
61 }
62 for (int i = 0; i < 10000; i++) {
63 System.out.print((i & 0xfff) != 0 ? "" : ".");
64 test5();
65 }
66 System.out.println();
67 for (int i = 0; i < 100; i++) {
68 Thread.sleep(1000);
69 }
70 for (int i = 0; i < 10000; i++) {
71 System.out.print((i & 0xfff) != 0 ? "" : ".");
72 test6();
73 }
74 System.out.println();
75 for (int i = 0; i < 100; i++) {
76 Thread.sleep(1000);
77 }
78 for (int i = 0; i < 10000; i++) {
79 System.out.print((i & 0xfff) != 0 ? "" : ".");
80 test7();
81 }
82 System.out.println();
83 for (int i = 0; i < 100; i++) {
84 Thread.sleep(1000);
85 }
86 for (int i = 0; i < 10000; i++) {
87 System.out.print((i & 0xfff) != 0 ? "" : ".");
88 test8();
89 }
90 System.out.println();
91 for (int i = 0; i < 10; i++) {
92 Thread.sleep(1000);
93 }
94 System.out.println(sum);
95 }
96
97 public static void test1() {
98 long t1 = System.nanoTime();
99 long t2 = System.nanoTime();
100 sum += t2 - t1;
101 System.out.print("");
102 System.out.print("");
103 }
104
105 public static void test2() {
106 long t1 = System.nanoTime();
107 long t2 = System.nanoTime();
108 sum += t2 - t1;
109 System.out.print("");
110 System.out.print("");
111 }
112
113 public static void test3() {
114 long t1 = System.nanoTime();
115 long t2 = System.nanoTime();
116 sum += t2 - t1;
117 System.out.print("");
118 System.out.print("");
119 }
120
121 public static void test4() {
122 long t1 = System.nanoTime();
123 long t2 = System.nanoTime();
124 sum += t2 - t1;
125 System.out.print("");
126 System.out.print("");
127 }
128
129 public static void test5() {
130 long t1 = System.nanoTime();
131 long t2 = System.nanoTime();
132 sum += t2 - t1;
133 System.out.print("");
134 System.out.print("");
135 }
136
137 public static void test6() {
138 long t1 = System.nanoTime();
139 long t2 = System.nanoTime();
140 sum += t2 - t1;
141 System.out.print("");
142 System.out.print("");
143 }
144
145 public static void test7() {
146 long t1 = System.nanoTime();
147 long t2 = System.nanoTime();
148 sum += t2 - t1;
149 System.out.print("");
150 System.out.print("");
151 }
152
153 public static void test8() {
154 long t1 = System.nanoTime();
155 long t2 = System.nanoTime();
156 sum += t2 - t1;
157 System.out.print("");
158 System.out.print("");
159 }
160
23 } 161 }