@@ -205,49 +205,51 @@ public void testBlockCompilationLargeBlocks() {
205
205
}
206
206
207
207
@ Test
208
- public void testBlockCompilationMaximumGraalGraphSize () {
209
- int blockSize = 100 ;
210
- int nodeCount = 1000 ;
211
- setupContext ("engine.CompileImmediately" , "true" ,
212
- "engine.BackgroundCompilation" , "false" ,
213
- "engine.PartialBlockCompilationSize" , String .valueOf (blockSize ),
214
- "compiler.MaximumGraalGraphSize" , "20000" );
215
- OptimizedTruffleRuntime runtime = OptimizedTruffleRuntime .getRuntime ();
216
- AbstractTestNode [] children = new AbstractTestNode [nodeCount ];
217
- for (int i = 0 ; i < children .length ; i ++) {
218
- children [i ] = new ExpensiveTestNode ();
219
- }
220
- BlockNode <AbstractTestNode > block = BlockNode .create (children , new NodeExecutor ());
221
- OptimizedCallTarget compilable = (OptimizedCallTarget ) new TestRootNode (block ).getCallTarget ();
222
- TestListener listener = new TestListener (compilable );
223
- try {
224
- runtime .addListener (listener );
225
- compilable .compile (!compilable .engine .multiTier );
226
- List <EventType > expectedEvents = new ArrayList <>();
227
- // Main CallTarget
228
- expectedEvents .add (EventType .ENQUEUED );
229
- expectedEvents .add (EventType .COMPILATION_STARTED );
230
- expectedEvents .add (EventType .COMPILATION_FAILURE );
231
- expectedEvents .add (EventType .DEQUEUED );
232
- // Main CallTarget enqueued for re-compilation
233
- expectedEvents .add (EventType .ENQUEUED );
234
- // New partial blocks CallTargets
235
- for (int i = 0 ; i < nodeCount / blockSize ; i ++) {
208
+ public void testBlockCompilationMaximumGraalGraphSize () throws Exception {
209
+ executeInSubprocess (() -> {
210
+ int blockSize = 100 ;
211
+ int nodeCount = 1000 ;
212
+ setupContext ("engine.CompileImmediately" , "true" ,
213
+ "engine.BackgroundCompilation" , "false" ,
214
+ "engine.PartialBlockCompilationSize" , String .valueOf (blockSize ),
215
+ "compiler.MaximumGraalGraphSize" , "20000" );
216
+ OptimizedTruffleRuntime runtime = OptimizedTruffleRuntime .getRuntime ();
217
+ AbstractTestNode [] children = new AbstractTestNode [nodeCount ];
218
+ for (int i = 0 ; i < children .length ; i ++) {
219
+ children [i ] = new ExpensiveTestNode ();
220
+ }
221
+ BlockNode <AbstractTestNode > block = BlockNode .create (children , new NodeExecutor ());
222
+ OptimizedCallTarget compilable = (OptimizedCallTarget ) new TestRootNode (block ).getCallTarget ();
223
+ TestListener listener = new TestListener (compilable );
224
+ try {
225
+ runtime .addListener (listener );
226
+ compilable .compile (!compilable .engine .multiTier );
227
+ List <EventType > expectedEvents = new ArrayList <>();
228
+ // Main CallTarget
236
229
expectedEvents .add (EventType .ENQUEUED );
237
230
expectedEvents .add (EventType .COMPILATION_STARTED );
231
+ expectedEvents .add (EventType .COMPILATION_FAILURE );
232
+ expectedEvents .add (EventType .DEQUEUED );
233
+ // Main CallTarget enqueued for re-compilation
234
+ expectedEvents .add (EventType .ENQUEUED );
235
+ // New partial blocks CallTargets
236
+ for (int i = 0 ; i < nodeCount / blockSize ; i ++) {
237
+ expectedEvents .add (EventType .ENQUEUED );
238
+ expectedEvents .add (EventType .COMPILATION_STARTED );
239
+ expectedEvents .add (EventType .TRUFFLE_TIER_FINISHED );
240
+ expectedEvents .add (EventType .GRAAL_TIER_FINISHED );
241
+ expectedEvents .add (EventType .COMPILATION_SUCCESS );
242
+ }
243
+ // Main CallTarget re-compilation
244
+ expectedEvents .add (EventType .COMPILATION_STARTED );
238
245
expectedEvents .add (EventType .TRUFFLE_TIER_FINISHED );
239
246
expectedEvents .add (EventType .GRAAL_TIER_FINISHED );
240
247
expectedEvents .add (EventType .COMPILATION_SUCCESS );
248
+ listener .assertEvents (expectedEvents .toArray (new EventType [expectedEvents .size ()]));
249
+ } finally {
250
+ runtime .removeListener (listener );
241
251
}
242
- // Main CallTarget re-compilation
243
- expectedEvents .add (EventType .COMPILATION_STARTED );
244
- expectedEvents .add (EventType .TRUFFLE_TIER_FINISHED );
245
- expectedEvents .add (EventType .GRAAL_TIER_FINISHED );
246
- expectedEvents .add (EventType .COMPILATION_SUCCESS );
247
- listener .assertEvents (expectedEvents .toArray (new EventType [expectedEvents .size ()]));
248
- } finally {
249
- runtime .removeListener (listener );
250
- }
252
+ });
251
253
}
252
254
253
255
private static RootNode createFailureNode () {
0 commit comments