53
53
import com .oracle .svm .core .log .Log ;
54
54
import com .oracle .svm .core .thread .VMThreads ;
55
55
import com .oracle .svm .core .threadlocal .VMThreadLocalSupport ;
56
+ import com .oracle .svm .core .util .Timer ;
56
57
57
58
import jdk .graal .compiler .word .Word ;
58
59
@@ -251,25 +252,25 @@ void sweepAndCompact(Timers timers, ChunkReleaser chunkReleaser) {
251
252
*/
252
253
ReferenceObjectProcessing .updateForwardedRefs ();
253
254
254
- Timer oldPlanningTimer = timers .oldPlanning .open ();
255
+ Timer oldPlanningTimer = timers .oldPlanning .start ();
255
256
try {
256
257
planCompaction ();
257
258
} finally {
258
- oldPlanningTimer .close ();
259
+ oldPlanningTimer .stop ();
259
260
}
260
261
261
- Timer oldFixupTimer = timers .oldFixup .open ();
262
+ Timer oldFixupTimer = timers .oldFixup .start ();
262
263
try {
263
264
fixupReferencesBeforeCompaction (chunkReleaser , timers );
264
265
} finally {
265
- oldFixupTimer .close ();
266
+ oldFixupTimer .stop ();
266
267
}
267
268
268
- Timer oldCompactionTimer = timers .oldCompaction .open ();
269
+ Timer oldCompactionTimer = timers .oldCompaction .start ();
269
270
try {
270
271
compact (timers );
271
272
} finally {
272
- oldCompactionTimer .close ();
273
+ oldCompactionTimer .stop ();
273
274
}
274
275
}
275
276
@@ -280,18 +281,18 @@ private void planCompaction() {
280
281
281
282
@ Uninterruptible (reason = "Avoid unnecessary safepoint checks in GC for performance." )
282
283
private void fixupReferencesBeforeCompaction (ChunkReleaser chunkReleaser , Timers timers ) {
283
- Timer oldFixupAlignedChunksTimer = timers .oldFixupAlignedChunks .open ();
284
+ Timer oldFixupAlignedChunksTimer = timers .oldFixupAlignedChunks .start ();
284
285
try {
285
286
AlignedHeapChunk .AlignedHeader aChunk = space .getFirstAlignedHeapChunk ();
286
287
while (aChunk .isNonNull ()) {
287
288
ObjectMoveInfo .walkObjects (aChunk , fixupVisitor );
288
289
aChunk = HeapChunk .getNext (aChunk );
289
290
}
290
291
} finally {
291
- oldFixupAlignedChunksTimer .close ();
292
+ oldFixupAlignedChunksTimer .stop ();
292
293
}
293
294
294
- Timer oldFixupImageHeapTimer = timers .oldFixupImageHeap .open ();
295
+ Timer oldFixupImageHeapTimer = timers .oldFixupImageHeap .start ();
295
296
try {
296
297
for (ImageHeapInfo info : HeapImpl .getImageHeapInfos ()) {
297
298
fixupImageHeapRoots (info );
@@ -303,43 +304,43 @@ private void fixupReferencesBeforeCompaction(ChunkReleaser chunkReleaser, Timers
303
304
}
304
305
}
305
306
} finally {
306
- oldFixupImageHeapTimer .close ();
307
+ oldFixupImageHeapTimer .stop ();
307
308
}
308
309
309
- Timer oldFixupThreadLocalsTimer = timers .oldFixupThreadLocals .open ();
310
+ Timer oldFixupThreadLocalsTimer = timers .oldFixupThreadLocals .start ();
310
311
try {
311
312
for (IsolateThread isolateThread = VMThreads .firstThread (); isolateThread .isNonNull (); isolateThread = VMThreads .nextThread (isolateThread )) {
312
313
VMThreadLocalSupport .singleton ().walk (isolateThread , refFixupVisitor );
313
314
}
314
315
} finally {
315
- oldFixupThreadLocalsTimer .close ();
316
+ oldFixupThreadLocalsTimer .stop ();
316
317
}
317
318
318
- Timer oldFixupStackTimer = timers .oldFixupStack .open ();
319
+ Timer oldFixupStackTimer = timers .oldFixupStack .start ();
319
320
try {
320
321
fixupStackReferences ();
321
322
} finally {
322
- oldFixupStackTimer .close ();
323
+ oldFixupStackTimer .stop ();
323
324
}
324
325
325
326
/*
326
327
* Check each unaligned object and fix its references if the object is marked. Add the chunk
327
328
* to the releaser's list in case the object is not marked and therefore won't survive.
328
329
*/
329
- Timer oldFixupUnalignedChunksTimer = timers .oldFixupUnalignedChunks .open ();
330
+ Timer oldFixupUnalignedChunksTimer = timers .oldFixupUnalignedChunks .start ();
330
331
try {
331
332
fixupUnalignedChunkReferences (chunkReleaser );
332
333
} finally {
333
- oldFixupUnalignedChunksTimer .close ();
334
+ oldFixupUnalignedChunksTimer .stop ();
334
335
}
335
336
336
- Timer oldFixupRuntimeCodeCacheTimer = timers .oldFixupRuntimeCodeCache .open ();
337
+ Timer oldFixupRuntimeCodeCacheTimer = timers .oldFixupRuntimeCodeCache .start ();
337
338
try {
338
339
if (RuntimeCompilation .isEnabled ()) {
339
340
RuntimeCodeInfoMemory .singleton ().walkRuntimeMethodsDuringGC (runtimeCodeCacheFixupWalker );
340
341
}
341
342
} finally {
342
- oldFixupRuntimeCodeCacheTimer .close ();
343
+ oldFixupRuntimeCodeCacheTimer .stop ();
343
344
}
344
345
}
345
346
@@ -394,7 +395,7 @@ private void compact(Timers timers) {
394
395
chunk = HeapChunk .getNext (chunk );
395
396
}
396
397
397
- Timer oldCompactionRememberedSetsTimer = timers .oldCompactionRememberedSets .open ();
398
+ Timer oldCompactionRememberedSetsTimer = timers .oldCompactionRememberedSets .start ();
398
399
try {
399
400
chunk = space .getFirstAlignedHeapChunk ();
400
401
while (chunk .isNonNull ()) {
@@ -413,7 +414,7 @@ private void compact(Timers timers) {
413
414
chunk = HeapChunk .getNext (chunk );
414
415
}
415
416
} finally {
416
- oldCompactionRememberedSetsTimer .close ();
417
+ oldCompactionRememberedSetsTimer .stop ();
417
418
}
418
419
}
419
420
0 commit comments