@@ -106,7 +106,7 @@ public static boolean isFatalErrorHandlingThread() {
106106
107107 public static int maxInvocations () {
108108 int result = 0 ;
109- DiagnosticThunkRegister thunks = DiagnosticThunkRegister . getSingleton ();
109+ DiagnosticThunkRegistry thunks = DiagnosticThunkRegistry . singleton ();
110110 for (int i = 0 ; i < thunks .size (); i ++) {
111111 result += thunks .getThunk (i ).maxInvocationCount ();
112112 }
@@ -142,10 +142,10 @@ public static void printInformation(Log log, Pointer sp, CodePointer ip, Registe
142142 errorContext .setFrameHasCalleeSavedRegisters (frameHasCalleeSavedRegisters );
143143
144144 // Print all thunks in a reasonably safe way.
145- int numDiagnosticThunks = DiagnosticThunkRegister . getSingleton ().size ();
145+ int numDiagnosticThunks = DiagnosticThunkRegistry . singleton ().size ();
146146 for (int i = 0 ; i < numDiagnosticThunks ; i ++) {
147- DiagnosticThunk thunk = DiagnosticThunkRegister . getSingleton ().getThunk (i );
148- int invocationCount = DiagnosticThunkRegister . getSingleton ().getInitialInvocationCount (i );
147+ DiagnosticThunk thunk = DiagnosticThunkRegistry . singleton ().getThunk (i );
148+ int invocationCount = DiagnosticThunkRegistry . singleton ().getInitialInvocationCount (i );
149149 if (invocationCount <= thunk .maxInvocationCount ()) {
150150 thunk .printDiagnostics (log , errorContext , DiagnosticLevel .SAFE , invocationCount );
151151 }
@@ -202,14 +202,14 @@ private static void printFatalErrorForCurrentState() {
202202 // Print the various sections of the diagnostics and skip all sections that were already
203203 // printed earlier.
204204 ErrorContext errorContext = fatalErrorState .getErrorContext ();
205- int numDiagnosticThunks = DiagnosticThunkRegister . getSingleton ().size ();
205+ int numDiagnosticThunks = DiagnosticThunkRegistry . singleton ().size ();
206206 while (fatalErrorState .diagnosticThunkIndex < numDiagnosticThunks ) {
207207 int index = fatalErrorState .diagnosticThunkIndex ;
208- DiagnosticThunk thunk = DiagnosticThunkRegister . getSingleton ().getThunk (index );
208+ DiagnosticThunk thunk = DiagnosticThunkRegistry . singleton ().getThunk (index );
209209
210210 // Start at the configured initial invocation count.
211211 if (fatalErrorState .invocationCount == 0 ) {
212- fatalErrorState .invocationCount = DiagnosticThunkRegister . getSingleton ().getInitialInvocationCount (index ) - 1 ;
212+ fatalErrorState .invocationCount = DiagnosticThunkRegistry . singleton ().getInitialInvocationCount (index ) - 1 ;
213213 }
214214
215215 while (++fatalErrorState .invocationCount <= thunk .maxInvocationCount ()) {
@@ -322,13 +322,13 @@ private static void updateInitialInvocationCount(String entry) throws IllegalArg
322322 int initialInvocationCount = parseInvocationCount (entry , pos );
323323
324324 int matches = 0 ;
325- int numDiagnosticThunks = DiagnosticThunkRegister . getSingleton ().size ();
325+ int numDiagnosticThunks = DiagnosticThunkRegistry . singleton ().size ();
326326 for (int i = 0 ; i < numDiagnosticThunks ; i ++) {
327- DiagnosticThunk thunk = DiagnosticThunkRegister . getSingleton ().getThunk (i );
327+ DiagnosticThunk thunk = DiagnosticThunkRegistry . singleton ().getThunk (i );
328328 // Checkstyle: allow Class.getSimpleName
329329 if (matches (thunk .getClass ().getSimpleName (), pattern )) {
330330 // Checkstyle: disallow Class.getSimpleName
331- DiagnosticThunkRegister . getSingleton ().setInitialInvocationCount (i , initialInvocationCount );
331+ DiagnosticThunkRegistry . singleton ().setInitialInvocationCount (i , initialInvocationCount );
332332 matches ++;
333333 }
334334 }
@@ -898,27 +898,22 @@ public abstract static class DiagnosticThunk {
898898 public abstract int maxInvocationCount ();
899899 }
900900
901- public static class DiagnosticThunkRegister {
901+ public static class DiagnosticThunkRegistry {
902902 private DiagnosticThunk [] diagnosticThunks ;
903903 private int [] initialInvocationCount ;
904904
905- /**
906- * Get the register.
907- * <p>
908- * This method is @Fold so anyone who uses it ensures there is a register.
909- */
910905 @ Fold
911906 /* Checkstyle: allow synchronization. */
912- public static synchronized DiagnosticThunkRegister getSingleton () {
913- if (!ImageSingletons .contains (DiagnosticThunkRegister .class )) {
914- ImageSingletons .add (DiagnosticThunkRegister .class , new DiagnosticThunkRegister ());
907+ public static synchronized DiagnosticThunkRegistry singleton () {
908+ if (!ImageSingletons .contains (DiagnosticThunkRegistry .class )) {
909+ ImageSingletons .add (DiagnosticThunkRegistry .class , new DiagnosticThunkRegistry ());
915910 }
916- return ImageSingletons .lookup (DiagnosticThunkRegister .class );
911+ return ImageSingletons .lookup (DiagnosticThunkRegistry .class );
917912 }
918913 /* Checkstyle: disallow synchronization. */
919914
920915 @ Platforms (Platform .HOSTED_ONLY .class )
921- DiagnosticThunkRegister () {
916+ DiagnosticThunkRegistry () {
922917 this .diagnosticThunks = new DiagnosticThunk []{new DumpRegisters (), new DumpInstructions (), new DumpTopOfCurrentThreadStack (), new DumpDeoptStubPointer (), new DumpTopFrame (),
923918 new DumpThreads (), new DumpCurrentThreadLocals (), new DumpCurrentVMOperation (), new DumpVMOperationHistory (), new DumpCodeCacheHistory (),
924919 new DumpRuntimeCodeInfoMemory (), new DumpRecentDeoptimizations (), new DumpCounters (), new DumpCurrentThreadFrameAnchors (), new DumpCurrentThreadDecodedStackTrace (),
0 commit comments