@@ -124,76 +124,87 @@ public void removeDuplicates() {
124
124
i = 34 ;
125
125
}
126
126
127
+ // Test failures on ideal phases only.
127
128
@ Test
128
- @ IR (failOn = {IRNode .STORE , IRNode .FIELD_ACCESS , IRNode .COUNTED_LOOP },
129
- counts = {IRNode .STORE , "3" , IRNode .FIELD_ACCESS , "2" , IRNode .COUNTED_LOOP , "2" })
130
- @ ExpectedFailure (ruleId = 1 , phase = CompilePhase .PRINT_IDEAL , failOn = 1 , counts = {1 , 3 })
131
- @ ExpectedFailure (ruleId = 1 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , failOn = 2 )
129
+ @ IR (failOn = {IRNode .STORE , IRNode .OOPMAP_WITH , "asdf" , IRNode .COUNTED_LOOP },
130
+ counts = {IRNode .STORE , "2" , IRNode .FIELD_ACCESS , "2" , IRNode .STORE_I , "1" })
131
+ @ ExpectedFailure (ruleId = 1 , phase = CompilePhase .PRINT_IDEAL , failOn = 1 )
132
132
133
- @ IR (failOn = {IRNode .STORE , IRNode .FIELD_ACCESS , IRNode .COUNTED_LOOP })
134
- @ ExpectedFailure ( ruleId = 2 , phase = CompilePhase . PRINT_IDEAL , failOn = 1 )
135
- @ ExpectedFailure (ruleId = 2 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , failOn = 2 )
133
+ @ IR (failOn = {IRNode .STORE_F , IRNode .OOPMAP_WITH , "asdf" , IRNode .COUNTED_LOOP },
134
+ counts = { IRNode . STORE , "2" , IRNode . FIELD_ACCESS , "2" , IRNode . STORE_I , "2" } )
135
+ @ ExpectedFailure (ruleId = 2 , phase = CompilePhase .PRINT_IDEAL , counts = 3 )
136
136
137
- @ IR (counts = {IRNode .STORE , "3" , IRNode .FIELD_ACCESS , "1" , IRNode .COUNTED_LOOP , "2" })
138
- @ ExpectedFailure (ruleId = 3 , phase = CompilePhase .PRINT_IDEAL , counts = {1 , 3 })
139
- @ ExpectedFailure (ruleId = 3 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , counts = 2 )
137
+ @ IR (failOn = {IRNode .STORE , IRNode .OOPMAP_WITH , "asdf" , IRNode .COUNTED_LOOP })
138
+ @ ExpectedFailure (ruleId = 3 , phase = CompilePhase .PRINT_IDEAL , failOn = 1 )
139
+
140
+ @ IR (counts = {IRNode .STORE , "3" , IRNode .FIELD_ACCESS , "2" , IRNode .COUNTED_LOOP , "2" })
141
+ @ ExpectedFailure (ruleId = 4 , phase = CompilePhase .PRINT_IDEAL , counts = {1 , 3 })
142
+
143
+ @ IR (failOn = {IRNode .STORE , IRNode .OOPMAP_WITH , "asdf" , IRNode .COUNTED_LOOP },
144
+ counts = {IRNode .STORE , "3" , IRNode .FIELD_ACCESS , "2" , IRNode .COUNTED_LOOP , "2" })
145
+ @ ExpectedFailure (ruleId = 5 , phase = CompilePhase .PRINT_IDEAL , failOn = 1 , counts = {1 , 3 })
140
146
141
147
@ IR (counts = {IRNode .STORE_I , "2" })
142
- @ ExpectedFailure (ruleId = 4 , phase = CompilePhase .PRINT_IDEAL , counts = 1 )
148
+ @ ExpectedFailure (ruleId = 6 , phase = CompilePhase .PRINT_IDEAL , counts = 1 )
143
149
public void defaultOnIdeal () {
144
150
i = 34 ;
145
151
l = 34 ;
146
152
}
147
153
154
+ // Test failures on mach phases only.
148
155
@ Test
149
156
@ IR (failOn = {IRNode .STORE_F , IRNode .FIELD_ACCESS , IRNode .COUNTED_LOOP },
150
- counts = {IRNode .STORE_F , "3 " , IRNode .FIELD_ACCESS , "1 " , IRNode .COUNTED_LOOP , "2" })
157
+ counts = {IRNode .STORE_I , "1 " , IRNode .FIELD_ACCESS , "2 " , IRNode .OOPMAP_WITH , "asdf" , "< 2" })
151
158
@ ExpectedFailure (ruleId = 1 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , failOn = 2 )
152
- @ ExpectedFailure (ruleId = 1 , phase = CompilePhase .PRINT_IDEAL , counts = {1 , 3 })
159
+
160
+ @ IR (failOn = {IRNode .STORE_F , IRNode .OOPMAP_WITH , "asdf" , IRNode .COUNTED_LOOP },
161
+ counts = {IRNode .STORE_I , "1" , IRNode .FIELD_ACCESS , "1" , IRNode .OOPMAP_WITH , "asdf" , "< 2" })
162
+ @ ExpectedFailure (ruleId = 2 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , counts = 2 )
153
163
154
164
@ IR (failOn = {IRNode .STORE_F , IRNode .FIELD_ACCESS , IRNode .COUNTED_LOOP })
155
- @ ExpectedFailure (ruleId = 2 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , failOn = 2 )
165
+ @ ExpectedFailure (ruleId = 3 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , failOn = 2 )
156
166
157
- @ IR (counts = {IRNode .STORE_F , "3 " , IRNode .FIELD_ACCESS , "1" , IRNode .COUNTED_LOOP , "2 " })
158
- @ ExpectedFailure (ruleId = 3 , phase = CompilePhase .PRINT_IDEAL , counts = {1 , 3 })
167
+ @ IR (counts = {IRNode .STORE_I , "1 " , IRNode .FIELD_ACCESS , "1" , IRNode .OOPMAP_WITH , "asdf" , "3 " })
168
+ @ ExpectedFailure (ruleId = 4 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , counts = {2 , 3 })
159
169
160
170
@ IR (failOn = {IRNode .STORE_F , IRNode .FIELD_ACCESS , IRNode .COUNTED_LOOP },
161
- counts = {IRNode .STORE_F , "3" , IRNode .FIELD_ACCESS , "2" , IRNode .COUNTED_LOOP , "2" })
162
-
163
- @ ExpectedFailure (ruleId = 4 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , failOn = 2 , counts = 2 )
164
- @ ExpectedFailure (ruleId = 4 , phase = CompilePhase .PRINT_IDEAL , counts = {1 , 3 })
171
+ counts = {IRNode .STORE_I , "1" , IRNode .FIELD_ACCESS , "1" , IRNode .OOPMAP_WITH , "asdf" , "3" })
172
+ @ ExpectedFailure (ruleId = 5 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , failOn = 2 , counts = {2 , 3 })
165
173
166
- @ IR (counts = {IRNode .FIELD_ACCESS , "2" })
167
- @ ExpectedFailure (ruleId = 5 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , counts = 1 )
168
- public Object defaultOnOptoAssembly (Helper h ) {
169
- return h .getString ();
174
+ @ IR (counts = {IRNode .FIELD_ACCESS , "1" })
175
+ @ ExpectedFailure (ruleId = 6 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , counts = 1 )
176
+ public void defaultOnOptoAssembly () {
177
+ i = 34 ;
178
+ l = 34 ;
170
179
}
171
180
181
+ // Test failures on ideal and mach phases.
172
182
@ Test
173
183
@ IR (failOn = {IRNode .STORE , IRNode .FIELD_ACCESS , IRNode .COUNTED_LOOP },
174
- counts = {IRNode .STORE , "20" , IRNode .FIELD_ACCESS , "3" , IRNode .COUNTED_LOOP , "2" })
184
+ counts = {IRNode .STORE , "2" , IRNode .FIELD_ACCESS , "2" , IRNode .STORE_I , "1" })
185
+ @ ExpectedFailure (ruleId = 1 , phase = CompilePhase .PRINT_IDEAL , failOn = 1 )
175
186
@ ExpectedFailure (ruleId = 1 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , failOn = 2 )
176
- @ ExpectedFailure (ruleId = 1 , phase = CompilePhase .PRINT_IDEAL , failOn = 1 , counts = {1 , 3 })
177
187
178
188
@ IR (failOn = {IRNode .STORE , IRNode .FIELD_ACCESS , IRNode .COUNTED_LOOP })
179
189
@ ExpectedFailure (ruleId = 2 , phase = CompilePhase .PRINT_IDEAL , failOn = 1 )
180
190
@ ExpectedFailure (ruleId = 2 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , failOn = 2 )
181
191
182
- @ IR (counts = {IRNode .STORE , "20" , IRNode .FIELD_ACCESS , "2 " , IRNode .COUNTED_LOOP , "2 " })
183
- @ ExpectedFailure (ruleId = 3 , phase = CompilePhase .PRINT_IDEAL , counts = { 1 , 3 } )
192
+ @ IR (counts = {IRNode .STORE , "20" , IRNode .FIELD_ACCESS , "1 " , IRNode .STORE_I , "1 " })
193
+ @ ExpectedFailure (ruleId = 3 , phase = CompilePhase .PRINT_IDEAL , counts = 1 )
184
194
@ ExpectedFailure (ruleId = 3 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , counts = 2 )
185
195
186
196
@ IR (failOn = {IRNode .STORE , IRNode .FIELD_ACCESS , IRNode .COUNTED_LOOP },
187
- counts = {IRNode .STORE , "20" , IRNode .FIELD_ACCESS , "2" , IRNode .COUNTED_LOOP , "2" })
188
- @ ExpectedFailure (ruleId = 4 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , failOn = 2 , counts = 2 )
197
+ counts = {IRNode .STORE , "20" , IRNode .FIELD_ACCESS , "1" , IRNode .COUNTED_LOOP , "2" })
189
198
@ ExpectedFailure (ruleId = 4 , phase = CompilePhase .PRINT_IDEAL , failOn = 1 , counts = {1 , 3 })
199
+ @ ExpectedFailure (ruleId = 4 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , failOn = 2 , counts = 2 )
190
200
191
- @ IR (counts = {IRNode .FIELD_ACCESS , "2" })
192
- @ ExpectedFailure (ruleId = 5 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , counts = 1 )
193
- public Object defaultOnBoth (Helper h ) {
201
+ @ IR (failOn = {IRNode .STORE , IRNode .FIELD_ACCESS , IRNode .COUNTED_LOOP , IRNode .STORE_I },
202
+ counts = {IRNode .STORE , "20" , IRNode .FIELD_ACCESS , "1" , IRNode .COUNTED_LOOP , "2" , IRNode .OOPMAP_WITH , "asdf" , "2" })
203
+ @ ExpectedFailure (ruleId = 5 , phase = CompilePhase .PRINT_IDEAL , failOn = {1 , 4 }, counts = {1 , 3 })
204
+ @ ExpectedFailure (ruleId = 5 , phase = CompilePhase .PRINT_OPTO_ASSEMBLY , failOn = 2 , counts = {2 , 4 })
205
+ public void defaultOnBoth () {
194
206
i = 34 ;
195
207
l = 34 ;
196
- return h .getString ();
197
208
}
198
209
199
210
@ Test
@@ -215,7 +226,7 @@ public int removeLoopsWithMultipleCompilations(int k) {
215
226
return x ;
216
227
}
217
228
218
- @ Run (test = { "removeLoopsWithMultipleCompilations" , "defaultOnOptoAssembly" , "defaultOnBoth" } )
229
+ @ Run (test = "removeLoopsWithMultipleCompilations" )
219
230
@ Warmup (1 )
220
231
public void run () {
221
232
for (int i = 0 ; i < 10000 ; i ++) {
@@ -224,8 +235,6 @@ public void run() {
224
235
for (int i = 0 ; i < 10000 ; i ++) {
225
236
removeLoopsWithMultipleCompilations (3 );
226
237
}
227
- defaultOnOptoAssembly (new Helper ("a" , 1 ));
228
- defaultOnBoth (new Helper ("a" , 1 ));
229
238
}
230
239
231
240
@ Test
0 commit comments