# HG changeset patch # User Doug Simon # Date 1400186624 -7200 # Node ID 7b999df1dabccfeb3424d560f5805a5ebda51f74 # Parent 807090ddbbf248d34753eddae6537bfc45c402a1 ensure Graal C++ shutdown routines are called exactly once during VM shutdown diff -r 807090ddbbf2 -r 7b999df1dabc src/share/vm/runtime/java.cpp --- a/src/share/vm/runtime/java.cpp Thu May 15 22:42:08 2014 +0200 +++ b/src/share/vm/runtime/java.cpp Thu May 15 22:43:44 2014 +0200 @@ -462,15 +462,6 @@ #define BEFORE_EXIT_DONE 2 static jint volatile _before_exit_status = BEFORE_EXIT_NOT_RUN; -#ifdef GRAAL -#ifdef COMPILERGRAAL - if (GraalCompiler::instance() != NULL) { - GraalCompiler::instance()->shutdown(); - } -#endif - VMToCompiler::shutdownRuntime(); -#endif - // Note: don't use a Mutex to guard the entire before_exit(), as // JVMTI post_thread_end_event and post_vm_death_event will run native code. // A CAS or OSMutex would work just fine but then we need to manipulate @@ -492,6 +483,15 @@ } } +#ifdef GRAAL +#ifdef COMPILERGRAAL + if (GraalCompiler::instance() != NULL) { + GraalCompiler::instance()->shutdown(); + } +#endif + VMToCompiler::shutdownRuntime(); +#endif + // The only difference between this and Win32's _onexit procs is that // this version is invoked before any threads get killed. ExitProc* current = exit_procs;