< prev index next >

src/share/vm/runtime/java.cpp

Print this page




  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "classfile/classLoader.hpp"
  27 #include "classfile/symbolTable.hpp"
  28 #include "classfile/systemDictionary.hpp"
  29 #include "code/codeCache.hpp"
  30 #include "compiler/compileBroker.hpp"
  31 #include "compiler/compilerOracle.hpp"
  32 #include "interpreter/bytecodeHistogram.hpp"


  33 #include "memory/genCollectedHeap.hpp"
  34 #include "memory/oopFactory.hpp"
  35 #include "memory/universe.hpp"
  36 #include "oops/constantPool.hpp"
  37 #include "oops/generateOopMap.hpp"
  38 #include "oops/instanceKlass.hpp"
  39 #include "oops/instanceOop.hpp"
  40 #include "oops/method.hpp"
  41 #include "oops/objArrayOop.hpp"
  42 #include "oops/oop.inline.hpp"
  43 #include "oops/symbol.hpp"
  44 #include "prims/jvmtiExport.hpp"
  45 #include "runtime/arguments.hpp"
  46 #include "runtime/biasedLocking.hpp"
  47 #include "runtime/compilationPolicy.hpp"
  48 #include "runtime/fprofiler.hpp"
  49 #include "runtime/init.hpp"
  50 #include "runtime/interfaceSupport.hpp"
  51 #include "runtime/java.hpp"
  52 #include "runtime/memprofiler.hpp"
  53 #include "runtime/sharedRuntime.hpp"
  54 #include "runtime/statSampler.hpp"
  55 #include "runtime/sweeper.hpp"
  56 #include "runtime/task.hpp"
  57 #include "runtime/thread.inline.hpp"
  58 #include "runtime/timer.hpp"
  59 #include "runtime/vm_operations.hpp"
  60 #include "services/memTracker.hpp"
  61 #include "trace/tracing.hpp"
  62 #include "utilities/dtrace.hpp"
  63 #include "utilities/globalDefinitions.hpp"
  64 #include "utilities/histogram.hpp"
  65 #include "utilities/macros.hpp"
  66 #include "utilities/vmError.hpp"
  67 #ifdef TARGET_ARCH_x86
  68 # include "vm_version_x86.hpp"
  69 #endif
  70 #ifdef TARGET_ARCH_sparc
  71 # include "vm_version_sparc.hpp"
  72 #endif
  73 #ifdef TARGET_ARCH_zero
  74 # include "vm_version_zero.hpp"
  75 #endif
  76 #ifdef TARGET_ARCH_arm
  77 # include "vm_version_arm.hpp"
  78 #endif
  79 #ifdef TARGET_ARCH_ppc
  80 # include "vm_version_ppc.hpp"
  81 #endif
  82 #if INCLUDE_ALL_GCS
  83 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
  84 #include "gc_implementation/parallelScavenge/psScavenge.hpp"
  85 #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
  86 #endif // INCLUDE_ALL_GCS
  87 #ifdef COMPILER1
  88 #include "c1/c1_Compiler.hpp"
  89 #include "c1/c1_Runtime1.hpp"
  90 #endif
  91 #ifdef COMPILER2
  92 #include "code/compiledIC.hpp"
  93 #include "compiler/methodLiveness.hpp"
  94 #include "opto/compile.hpp"
  95 #include "opto/indexSet.hpp"
  96 #include "opto/runtime.hpp"
  97 #endif



  98 
  99 #ifndef USDT2
 100 HS_DTRACE_PROBE_DECL(hotspot, vm__shutdown);
 101 #endif /* !USDT2 */
 102 
 103 #ifndef PRODUCT
 104 
 105 // Statistics printing (method invocation histogram)
 106 
 107 GrowableArray<Method*>* collected_invoked_methods;
 108 
 109 void collect_invoked_methods(Method* m) {
 110   if (m->invocation_count() + m->compiled_invocation_count() >= 1 ) {
 111     collected_invoked_methods->push(m);
 112   }
 113 }
 114 
 115 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 116 
 117 GrowableArray<Method*>* collected_profiled_methods;


 506   // Print GC/heap related information.
 507   if (PrintGCDetails) {
 508     Universe::print();
 509     AdaptiveSizePolicyOutput(0);
 510     if (Verbose) {
 511       ClassLoaderDataGraph::dump_on(gclog_or_tty);
 512     }
 513   }
 514 
 515   if (PrintBytecodeHistogram) {
 516     BytecodeHistogram::print();
 517   }
 518 
 519   if (JvmtiExport::should_post_thread_life()) {
 520     JvmtiExport::post_thread_end(thread);
 521   }
 522 
 523 
 524   EventThreadEnd event;
 525   if (event.should_commit()) {
 526       event.set_javalangthread(java_lang_Thread::thread_id(thread->threadObj()));
 527       event.commit();
 528   }
 529 


 530   // Always call even when there are not JVMTI environments yet, since environments
 531   // may be attached late and JVMTI must track phases of VM execution
 532   JvmtiExport::post_vm_death();
 533   Threads::shutdown_vm_agents();
 534 
 535   // Terminate the signal thread
 536   // Note: we don't wait until it actually dies.
 537   os::terminate_signal_thread();
 538 
 539   print_statistics();
 540   Universe::heap()->print_tracing_info();
 541 
 542   { MutexLocker ml(BeforeExit_lock);
 543     _before_exit_status = BEFORE_EXIT_DONE;
 544     BeforeExit_lock->notify_all();
 545   }
 546 
 547   if (VerifyStringTableAtExit) {
 548     int fail_cnt = 0;
 549     {




  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "classfile/classLoader.hpp"
  27 #include "classfile/symbolTable.hpp"
  28 #include "classfile/systemDictionary.hpp"
  29 #include "code/codeCache.hpp"
  30 #include "compiler/compileBroker.hpp"
  31 #include "compiler/compilerOracle.hpp"
  32 #include "interpreter/bytecodeHistogram.hpp"
  33 #include "jfr/jfrEvents.hpp"
  34 #include "jfr/support/jfrThreadId.hpp"
  35 #include "memory/genCollectedHeap.hpp"
  36 #include "memory/oopFactory.hpp"
  37 #include "memory/universe.hpp"
  38 #include "oops/constantPool.hpp"
  39 #include "oops/generateOopMap.hpp"
  40 #include "oops/instanceKlass.hpp"
  41 #include "oops/instanceOop.hpp"
  42 #include "oops/method.hpp"
  43 #include "oops/objArrayOop.hpp"
  44 #include "oops/oop.inline.hpp"
  45 #include "oops/symbol.hpp"
  46 #include "prims/jvmtiExport.hpp"
  47 #include "runtime/arguments.hpp"
  48 #include "runtime/biasedLocking.hpp"
  49 #include "runtime/compilationPolicy.hpp"
  50 #include "runtime/fprofiler.hpp"
  51 #include "runtime/init.hpp"
  52 #include "runtime/interfaceSupport.hpp"
  53 #include "runtime/java.hpp"
  54 #include "runtime/memprofiler.hpp"
  55 #include "runtime/sharedRuntime.hpp"
  56 #include "runtime/statSampler.hpp"
  57 #include "runtime/sweeper.hpp"
  58 #include "runtime/task.hpp"
  59 #include "runtime/thread.inline.hpp"
  60 #include "runtime/timer.hpp"
  61 #include "runtime/vm_operations.hpp"
  62 #include "services/memTracker.hpp"

  63 #include "utilities/dtrace.hpp"
  64 #include "utilities/globalDefinitions.hpp"
  65 #include "utilities/histogram.hpp"
  66 #include "utilities/macros.hpp"
  67 #include "utilities/vmError.hpp"
  68 #ifdef TARGET_ARCH_x86
  69 # include "vm_version_x86.hpp"
  70 #endif
  71 #ifdef TARGET_ARCH_sparc
  72 # include "vm_version_sparc.hpp"
  73 #endif
  74 #ifdef TARGET_ARCH_zero
  75 # include "vm_version_zero.hpp"
  76 #endif
  77 #ifdef TARGET_ARCH_arm
  78 # include "vm_version_arm.hpp"
  79 #endif
  80 #ifdef TARGET_ARCH_ppc
  81 # include "vm_version_ppc.hpp"
  82 #endif
  83 #if INCLUDE_ALL_GCS
  84 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
  85 #include "gc_implementation/parallelScavenge/psScavenge.hpp"
  86 #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
  87 #endif // INCLUDE_ALL_GCS
  88 #ifdef COMPILER1
  89 #include "c1/c1_Compiler.hpp"
  90 #include "c1/c1_Runtime1.hpp"
  91 #endif
  92 #ifdef COMPILER2
  93 #include "code/compiledIC.hpp"
  94 #include "compiler/methodLiveness.hpp"
  95 #include "opto/compile.hpp"
  96 #include "opto/indexSet.hpp"
  97 #include "opto/runtime.hpp"
  98 #endif
  99 #if INCLUDE_JFR
 100 #include "jfr/jfr.hpp"
 101 #endif
 102 
 103 #ifndef USDT2
 104 HS_DTRACE_PROBE_DECL(hotspot, vm__shutdown);
 105 #endif /* !USDT2 */
 106 
 107 #ifndef PRODUCT
 108 
 109 // Statistics printing (method invocation histogram)
 110 
 111 GrowableArray<Method*>* collected_invoked_methods;
 112 
 113 void collect_invoked_methods(Method* m) {
 114   if (m->invocation_count() + m->compiled_invocation_count() >= 1 ) {
 115     collected_invoked_methods->push(m);
 116   }
 117 }
 118 
 119 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 120 
 121 GrowableArray<Method*>* collected_profiled_methods;


 510   // Print GC/heap related information.
 511   if (PrintGCDetails) {
 512     Universe::print();
 513     AdaptiveSizePolicyOutput(0);
 514     if (Verbose) {
 515       ClassLoaderDataGraph::dump_on(gclog_or_tty);
 516     }
 517   }
 518 
 519   if (PrintBytecodeHistogram) {
 520     BytecodeHistogram::print();
 521   }
 522 
 523   if (JvmtiExport::should_post_thread_life()) {
 524     JvmtiExport::post_thread_end(thread);
 525   }
 526 
 527 
 528   EventThreadEnd event;
 529   if (event.should_commit()) {
 530     event.set_thread(JFR_THREAD_ID(thread));
 531     event.commit();
 532   }
 533 
 534   JFR_ONLY(Jfr::on_vm_shutdown();)
 535   
 536   // Always call even when there are not JVMTI environments yet, since environments
 537   // may be attached late and JVMTI must track phases of VM execution
 538   JvmtiExport::post_vm_death();
 539   Threads::shutdown_vm_agents();
 540 
 541   // Terminate the signal thread
 542   // Note: we don't wait until it actually dies.
 543   os::terminate_signal_thread();
 544 
 545   print_statistics();
 546   Universe::heap()->print_tracing_info();
 547 
 548   { MutexLocker ml(BeforeExit_lock);
 549     _before_exit_status = BEFORE_EXIT_DONE;
 550     BeforeExit_lock->notify_all();
 551   }
 552 
 553   if (VerifyStringTableAtExit) {
 554     int fail_cnt = 0;
 555     {


< prev index next >