src/hotspot/share/runtime/vmOperations.cpp
changeset 54729 f72402697b2f
parent 54669 ad45b3802d4e
child 54732 2d012a75d35c
equal deleted inserted replaced
54728:6188582d58b5 54729:f72402697b2f
    28 #include "code/codeCache.hpp"
    28 #include "code/codeCache.hpp"
    29 #include "compiler/compileBroker.hpp"
    29 #include "compiler/compileBroker.hpp"
    30 #include "gc/shared/isGCActiveMark.hpp"
    30 #include "gc/shared/isGCActiveMark.hpp"
    31 #include "logging/log.hpp"
    31 #include "logging/log.hpp"
    32 #include "logging/logStream.hpp"
    32 #include "logging/logStream.hpp"
       
    33 #include "logging/logConfiguration.hpp"
    33 #include "memory/heapInspection.hpp"
    34 #include "memory/heapInspection.hpp"
    34 #include "memory/resourceArea.hpp"
    35 #include "memory/resourceArea.hpp"
    35 #include "oops/symbol.hpp"
    36 #include "oops/symbol.hpp"
    36 #include "runtime/arguments.hpp"
    37 #include "runtime/arguments.hpp"
    37 #include "runtime/deoptimization.hpp"
    38 #include "runtime/deoptimization.hpp"
   467     ml.wait(10);
   468     ml.wait(10);
   468   }
   469   }
   469 }
   470 }
   470 
   471 
   471 void VM_Exit::doit() {
   472 void VM_Exit::doit() {
       
   473 
       
   474   if (VerifyBeforeExit) {
       
   475     HandleMark hm(VMThread::vm_thread());
       
   476     // Among other things, this ensures that Eden top is correct.
       
   477     Universe::heap()->prepare_for_verify();
       
   478     // Silent verification so as not to pollute normal output,
       
   479     // unless we really asked for it.
       
   480     Universe::verify();
       
   481   }
       
   482 
   472   CompileBroker::set_should_block();
   483   CompileBroker::set_should_block();
   473 
   484 
   474   // Wait for a short period for threads in native to block. Any thread
   485   // Wait for a short period for threads in native to block. Any thread
   475   // still executing native code after the wait will be stopped at
   486   // still executing native code after the wait will be stopped at
   476   // native==>Java/VM barriers.
   487   // native==>Java/VM barriers.
   478   // running in native; the other 6% are quiescent within 250ms (Ultra 80).
   489   // running in native; the other 6% are quiescent within 250ms (Ultra 80).
   479   wait_for_threads_in_native_to_block();
   490   wait_for_threads_in_native_to_block();
   480 
   491 
   481   set_vm_exited();
   492   set_vm_exited();
   482 
   493 
       
   494   // We'd like to call IdealGraphPrinter::clean_up() to finalize the
       
   495   // XML logging, but we can't safely do that here. The logic to make
       
   496   // XML termination logging safe is tied to the termination of the
       
   497   // VMThread, and it doesn't terminate on this exit path. See 8222534.
       
   498 
   483   // cleanup globals resources before exiting. exit_globals() currently
   499   // cleanup globals resources before exiting. exit_globals() currently
   484   // cleans up outputStream resources and PerfMemory resources.
   500   // cleans up outputStream resources and PerfMemory resources.
   485   exit_globals();
   501   exit_globals();
       
   502 
       
   503   LogConfiguration::finalize();
   486 
   504 
   487   // Check for exit hook
   505   // Check for exit hook
   488   exit_hook_t exit_hook = Arguments::exit_hook();
   506   exit_hook_t exit_hook = Arguments::exit_hook();
   489   if (exit_hook != NULL) {
   507   if (exit_hook != NULL) {
   490     // exit hook should exit.
   508     // exit hook should exit.