comparison src/share/vm/code/nmethod.cpp @ 4970:33df1aeaebbf

Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Mon, 27 Feb 2012 13:10:13 +0100
parents ef00461e29af 0382d2b469b2
children 8e6db1a5c537
comparison
equal deleted inserted replaced
4703:2cfb7fb2dce7 4970:33df1aeaebbf
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.
461 _marked_for_reclamation = 0; 461 _marked_for_reclamation = 0;
462 _has_flushed_dependencies = 0; 462 _has_flushed_dependencies = 0;
463 _speculatively_disconnected = 0; 463 _speculatively_disconnected = 0;
464 _has_unsafe_access = 0; 464 _has_unsafe_access = 0;
465 _has_method_handle_invokes = 0; 465 _has_method_handle_invokes = 0;
466 _lazy_critical_native = 0;
466 _marked_for_deoptimization = 0; 467 _marked_for_deoptimization = 0;
467 _lock_count = 0; 468 _lock_count = 0;
468 _stack_traversal_mark = 0; 469 _stack_traversal_mark = 0;
469 _unload_reported = false; // jvmti state 470 _unload_reported = false; // jvmti state
470 471
705 } 706 }
706 if (xtty != NULL) { 707 if (xtty != NULL) {
707 xtty->tail("print_native_nmethod"); 708 xtty->tail("print_native_nmethod");
708 } 709 }
709 } 710 }
710 Events::log("Create nmethod " INTPTR_FORMAT, this);
711 } 711 }
712 712
713 // For dtrace wrappers 713 // For dtrace wrappers
714 #ifdef HAVE_DTRACE_H 714 #ifdef HAVE_DTRACE_H
715 nmethod::nmethod( 715 nmethod::nmethod(
782 } 782 }
783 if (xtty != NULL) { 783 if (xtty != NULL) {
784 xtty->tail("print_dtrace_nmethod"); 784 xtty->tail("print_dtrace_nmethod");
785 } 785 }
786 } 786 }
787 Events::log("Create nmethod " INTPTR_FORMAT, this);
788 } 787 }
789 #endif // def HAVE_DTRACE_H 788 #endif // def HAVE_DTRACE_H
790 789
791 void* nmethod::operator new(size_t size, int nmethod_size) { 790 void* nmethod::operator new(size_t size, int nmethod_size) {
792 // Always leave some room in the CodeCache for I2C/C2I adapters 791 // Always leave some room in the CodeCache for I2C/C2I adapters
901 || CompilerOracle::should_print(_method) 900 || CompilerOracle::should_print(_method)
902 || CompilerOracle::has_option_string(_method, "PrintNMethods"); 901 || CompilerOracle::has_option_string(_method, "PrintNMethods");
903 if (printnmethods || PrintDebugInfo || PrintRelocations || PrintDependencies || PrintExceptionHandlers) { 902 if (printnmethods || PrintDebugInfo || PrintRelocations || PrintDependencies || PrintExceptionHandlers) {
904 print_nmethod(printnmethods); 903 print_nmethod(printnmethods);
905 } 904 }
906
907 // Note: Do not verify in here as the CodeCache_lock is
908 // taken which would conflict with the CompiledIC_lock
909 // which taken during the verification of call sites.
910 // (was bug - gri 10/25/99)
911
912 Events::log("Create nmethod " INTPTR_FORMAT, this);
913 } 905 }
914 906
915 907
916 // Print a short set of xml attributes to identify this nmethod. The 908 // Print a short set of xml attributes to identify this nmethod. The
917 // output should be embedded in some other element. 909 // output should be embedded in some other element.
1413 1405
1414 assert (!is_locked_by_vm(), "locked methods shouldn't be flushed"); 1406 assert (!is_locked_by_vm(), "locked methods shouldn't be flushed");
1415 assert_locked_or_safepoint(CodeCache_lock); 1407 assert_locked_or_safepoint(CodeCache_lock);
1416 1408
1417 // completely deallocate this method 1409 // completely deallocate this method
1418 EventMark m("flushing nmethod " INTPTR_FORMAT " %s", this, ""); 1410 Events::log(JavaThread::current(), "flushing nmethod " INTPTR_FORMAT, this);
1419 if (PrintMethodFlushing) { 1411 if (PrintMethodFlushing) {
1420 tty->print_cr("*flushing nmethod %3d/" INTPTR_FORMAT ". Live blobs:" UINT32_FORMAT "/Free CodeCache:" SIZE_FORMAT "Kb", 1412 tty->print_cr("*flushing nmethod %3d/" INTPTR_FORMAT ". Live blobs:" UINT32_FORMAT "/Free CodeCache:" SIZE_FORMAT "Kb",
1421 _compile_id, this, CodeCache::nof_blobs(), CodeCache::unallocated_capacity()/1024); 1413 _compile_id, this, CodeCache::nof_blobs(), CodeCache::unallocated_capacity()/1024);
1422 } 1414 }
1423 1415