Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/java.cpp @ 18041:52b4284cb496
Merge with jdk8u20-b26
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 15 Oct 2014 16:02:50 +0200 |
parents | 4481cf549cfc a45a4f5a9609 |
children | 3ad5d7a6adb5 |
comparison
equal
deleted
inserted
replaced
17606:45d7b2c7029d | 18041:52b4284cb496 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
54 #include "runtime/interfaceSupport.hpp" | 54 #include "runtime/interfaceSupport.hpp" |
55 #include "runtime/java.hpp" | 55 #include "runtime/java.hpp" |
56 #include "runtime/memprofiler.hpp" | 56 #include "runtime/memprofiler.hpp" |
57 #include "runtime/sharedRuntime.hpp" | 57 #include "runtime/sharedRuntime.hpp" |
58 #include "runtime/statSampler.hpp" | 58 #include "runtime/statSampler.hpp" |
59 #include "runtime/sweeper.hpp" | |
59 #include "runtime/task.hpp" | 60 #include "runtime/task.hpp" |
60 #include "runtime/thread.inline.hpp" | 61 #include "runtime/thread.inline.hpp" |
61 #include "runtime/timer.hpp" | 62 #include "runtime/timer.hpp" |
62 #include "runtime/vm_operations.hpp" | 63 #include "runtime/vm_operations.hpp" |
63 #include "services/memReporter.hpp" | 64 #include "services/memReporter.hpp" |
114 if (m->invocation_count() + m->compiled_invocation_count() >= 1 ) { | 115 if (m->invocation_count() + m->compiled_invocation_count() >= 1 ) { |
115 collected_invoked_methods->push(m); | 116 collected_invoked_methods->push(m); |
116 } | 117 } |
117 } | 118 } |
118 | 119 |
120 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC | |
119 | 121 |
120 GrowableArray<Method*>* collected_profiled_methods; | 122 GrowableArray<Method*>* collected_profiled_methods; |
121 | 123 |
122 void collect_profiled_methods(Method* m) { | 124 void collect_profiled_methods(Method* m) { |
123 Thread* thread = Thread::current(); | 125 Thread* thread = Thread::current(); |
219 AllocStats alloc_stats; | 221 AllocStats alloc_stats; |
220 | 222 |
221 | 223 |
222 | 224 |
223 // General statistics printing (profiling ...) | 225 // General statistics printing (profiling ...) |
224 | |
225 void print_statistics() { | 226 void print_statistics() { |
226 | |
227 #ifdef ASSERT | 227 #ifdef ASSERT |
228 | 228 |
229 if (CountRuntimeCalls) { | 229 if (CountRuntimeCalls) { |
230 extern Histogram *RuntimeHistogram; | 230 extern Histogram *RuntimeHistogram; |
231 RuntimeHistogram->print(); | 231 RuntimeHistogram->print(); |
269 SharedRuntime::print_statistics(); | 269 SharedRuntime::print_statistics(); |
270 #endif //COMPILER1 | 270 #endif //COMPILER1 |
271 os::print_statistics(); | 271 os::print_statistics(); |
272 } | 272 } |
273 | 273 |
274 if (PrintLockStatistics || PrintPreciseBiasedLockingStatistics) { | 274 if (PrintLockStatistics || PrintPreciseBiasedLockingStatistics || PrintPreciseRTMLockingStatistics) { |
275 OptoRuntime::print_named_counters(); | 275 OptoRuntime::print_named_counters(); |
276 } | 276 } |
277 | 277 |
278 if (TimeLivenessAnalysis) { | 278 if (TimeLivenessAnalysis) { |
279 MethodLiveness::print_times(); | 279 MethodLiveness::print_times(); |
317 } | 317 } |
318 | 318 |
319 if (PrintCodeCache) { | 319 if (PrintCodeCache) { |
320 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); | 320 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); |
321 CodeCache::print(); | 321 CodeCache::print(); |
322 } | |
323 | |
324 if (PrintMethodFlushingStatistics) { | |
325 NMethodSweeper::print(); | |
322 } | 326 } |
323 | 327 |
324 if (PrintCodeCache2) { | 328 if (PrintCodeCache2) { |
325 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); | 329 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); |
326 CodeCache::print_internals(); | 330 CodeCache::print_internals(); |
368 if (PrintNMTStatistics) { | 372 if (PrintNMTStatistics) { |
369 if (MemTracker::is_on()) { | 373 if (MemTracker::is_on()) { |
370 BaselineTTYOutputer outputer(tty); | 374 BaselineTTYOutputer outputer(tty); |
371 MemTracker::print_memory_usage(outputer, K, false); | 375 MemTracker::print_memory_usage(outputer, K, false); |
372 } else { | 376 } else { |
373 tty->print_cr(MemTracker::reason()); | 377 tty->print_cr("%s", MemTracker::reason()); |
374 } | 378 } |
375 } | 379 } |
376 } | 380 } |
377 | 381 |
378 #else // PRODUCT MODE STATISTICS | 382 #else // PRODUCT MODE STATISTICS |
386 if (PrintCodeCache) { | 390 if (PrintCodeCache) { |
387 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); | 391 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); |
388 CodeCache::print(); | 392 CodeCache::print(); |
389 } | 393 } |
390 | 394 |
395 if (PrintMethodFlushingStatistics) { | |
396 NMethodSweeper::print(); | |
397 } | |
398 | |
391 #ifdef COMPILER2 | 399 #ifdef COMPILER2 |
392 if (PrintPreciseBiasedLockingStatistics) { | 400 if (PrintPreciseBiasedLockingStatistics || PrintPreciseRTMLockingStatistics) { |
393 OptoRuntime::print_named_counters(); | 401 OptoRuntime::print_named_counters(); |
394 } | 402 } |
395 #endif | 403 #endif |
396 if (PrintBiasedLockingStatistics) { | 404 if (PrintBiasedLockingStatistics) { |
397 BiasedLocking::print_counters(); | 405 BiasedLocking::print_counters(); |
404 if (PrintNMTStatistics) { | 412 if (PrintNMTStatistics) { |
405 if (MemTracker::is_on()) { | 413 if (MemTracker::is_on()) { |
406 BaselineTTYOutputer outputer(tty); | 414 BaselineTTYOutputer outputer(tty); |
407 MemTracker::print_memory_usage(outputer, K, false); | 415 MemTracker::print_memory_usage(outputer, K, false); |
408 } else { | 416 } else { |
409 tty->print_cr(MemTracker::reason()); | 417 tty->print_cr("%s", MemTracker::reason()); |
410 } | 418 } |
411 } | 419 } |
412 } | 420 } |
413 | 421 |
414 #endif | 422 #endif |
514 | 522 |
515 // shut down the StatSampler task | 523 // shut down the StatSampler task |
516 StatSampler::disengage(); | 524 StatSampler::disengage(); |
517 StatSampler::destroy(); | 525 StatSampler::destroy(); |
518 | 526 |
519 // We do not need to explicitly stop concurrent GC threads because the | 527 // Stop concurrent GC threads |
520 // JVM will be taken down at a safepoint when such threads are inactive -- | 528 Universe::heap()->stop(); |
521 // except for some concurrent G1 threads, see (comment in) | |
522 // Threads::destroy_vm(). | |
523 | 529 |
524 // Print GC/heap related information. | 530 // Print GC/heap related information. |
525 if (PrintGCDetails) { | 531 if (PrintGCDetails) { |
526 Universe::print(); | 532 Universe::print(); |
527 AdaptiveSizePolicyOutput(0); | 533 AdaptiveSizePolicyOutput(0); |