1 /* |
1 /* |
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2012, 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. |
779 } |
778 } |
780 if (xtty != NULL) { |
779 if (xtty != NULL) { |
781 xtty->tail("print_dtrace_nmethod"); |
780 xtty->tail("print_dtrace_nmethod"); |
782 } |
781 } |
783 } |
782 } |
784 Events::log("Create nmethod " INTPTR_FORMAT, this); |
|
785 } |
783 } |
786 #endif // def HAVE_DTRACE_H |
784 #endif // def HAVE_DTRACE_H |
787 |
785 |
788 void* nmethod::operator new(size_t size, int nmethod_size) { |
786 void* nmethod::operator new(size_t size, int nmethod_size) { |
789 // Always leave some room in the CodeCache for I2C/C2I adapters |
787 // Always leave some room in the CodeCache for I2C/C2I adapters |
887 || CompilerOracle::should_print(_method) |
885 || CompilerOracle::should_print(_method) |
888 || CompilerOracle::has_option_string(_method, "PrintNMethods"); |
886 || CompilerOracle::has_option_string(_method, "PrintNMethods"); |
889 if (printnmethods || PrintDebugInfo || PrintRelocations || PrintDependencies || PrintExceptionHandlers) { |
887 if (printnmethods || PrintDebugInfo || PrintRelocations || PrintDependencies || PrintExceptionHandlers) { |
890 print_nmethod(printnmethods); |
888 print_nmethod(printnmethods); |
891 } |
889 } |
892 |
|
893 // Note: Do not verify in here as the CodeCache_lock is |
|
894 // taken which would conflict with the CompiledIC_lock |
|
895 // which taken during the verification of call sites. |
|
896 // (was bug - gri 10/25/99) |
|
897 |
|
898 Events::log("Create nmethod " INTPTR_FORMAT, this); |
|
899 } |
890 } |
900 |
891 |
901 |
892 |
902 // Print a short set of xml attributes to identify this nmethod. The |
893 // Print a short set of xml attributes to identify this nmethod. The |
903 // output should be embedded in some other element. |
894 // output should be embedded in some other element. |
1384 |
1375 |
1385 assert (!is_locked_by_vm(), "locked methods shouldn't be flushed"); |
1376 assert (!is_locked_by_vm(), "locked methods shouldn't be flushed"); |
1386 assert_locked_or_safepoint(CodeCache_lock); |
1377 assert_locked_or_safepoint(CodeCache_lock); |
1387 |
1378 |
1388 // completely deallocate this method |
1379 // completely deallocate this method |
1389 EventMark m("flushing nmethod " INTPTR_FORMAT " %s", this, ""); |
1380 Events::log(JavaThread::current(), "flushing nmethod " INTPTR_FORMAT, this); |
1390 if (PrintMethodFlushing) { |
1381 if (PrintMethodFlushing) { |
1391 tty->print_cr("*flushing nmethod %3d/" INTPTR_FORMAT ". Live blobs:" UINT32_FORMAT "/Free CodeCache:" SIZE_FORMAT "Kb", |
1382 tty->print_cr("*flushing nmethod %3d/" INTPTR_FORMAT ". Live blobs:" UINT32_FORMAT "/Free CodeCache:" SIZE_FORMAT "Kb", |
1392 _compile_id, this, CodeCache::nof_blobs(), CodeCache::unallocated_capacity()/1024); |
1383 _compile_id, this, CodeCache::nof_blobs(), CodeCache::unallocated_capacity()/1024); |
1393 } |
1384 } |
1394 |
1385 |