comparison src/share/vm/code/nmethod.cpp @ 18041:52b4284cb496

Merge with jdk8u20-b26
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 16:02:50 +0200
parents ded2f1abfcda 78bbf4d43a14
children 2a69cbe850a8
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.
47 #endif 47 #endif
48 #ifdef GRAAL 48 #ifdef GRAAL
49 #include "graal/graalJavaAccess.hpp" 49 #include "graal/graalJavaAccess.hpp"
50 #endif 50 #endif
51 51
52 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
53
52 #ifdef DTRACE_ENABLED 54 #ifdef DTRACE_ENABLED
53 55
54 // Only bother with this argument setup if dtrace is available 56 // Only bother with this argument setup if dtrace is available
55 57
56 #ifndef USDT2 58 #ifndef USDT2
541 _jmethod_id = NULL; 543 _jmethod_id = NULL;
542 _osr_link = NULL; 544 _osr_link = NULL;
543 _scavenge_root_link = NULL; 545 _scavenge_root_link = NULL;
544 _scavenge_root_state = 0; 546 _scavenge_root_state = 0;
545 _compiler = NULL; 547 _compiler = NULL;
548 #if INCLUDE_RTM_OPT
549 _rtm_state = NoRTM;
550 #endif
546 #ifdef GRAAL 551 #ifdef GRAAL
547 _graal_installed_code = NULL; 552 _graal_installed_code = NULL;
548 _speculation_log = NULL; 553 _speculation_log = NULL;
549 #endif 554 #endif
550 #ifdef HAVE_DTRACE_H 555 #ifdef HAVE_DTRACE_H
690 695
691 // record this nmethod as dependent on this klass 696 // record this nmethod as dependent on this klass
692 InstanceKlass::cast(klass)->add_dependent_nmethod(nm); 697 InstanceKlass::cast(klass)->add_dependent_nmethod(nm);
693 } 698 }
694 if (nm != NULL) note_java_nmethod(nm); 699 if (nm != NULL) note_java_nmethod(nm);
695 if (PrintAssembly) { 700 if (PrintAssembly || CompilerOracle::has_option_string(method, "PrintAssembly")) {
696 Disassembler::decode(nm); 701 Disassembler::decode(nm);
697 } 702 }
698 } 703 }
699 } 704 }
700 // Do verification and logging outside CodeCache_lock. 705 // Do verification and logging outside CodeCache_lock.
840 _exception_cache = NULL; 845 _exception_cache = NULL;
841 _pc_desc_cache.reset_to(NULL); 846 _pc_desc_cache.reset_to(NULL);
842 _hotness_counter = NMethodSweeper::hotness_counter_reset_val(); 847 _hotness_counter = NMethodSweeper::hotness_counter_reset_val();
843 848
844 code_buffer->copy_values_to(this); 849 code_buffer->copy_values_to(this);
845 debug_only(verify_scavenge_root_oops()); 850 if (ScavengeRootsInCode && detect_scavenge_root_oops()) {
851 CodeCache::add_scavenge_root_nmethod(this);
852 Universe::heap()->register_nmethod(this);
853 }
854 DEBUG_ONLY(verify_scavenge_root_oops();)
846 CodeCache::commit(this); 855 CodeCache::commit(this);
847 } 856 }
848 857
849 if (PrintNMethods || PrintDebugInfo || PrintRelocations || PrintDependencies) { 858 if (PrintNMethods || PrintDebugInfo || PrintRelocations || PrintDependencies) {
850 ttyLocker ttyl; // keep the following output all in one block 859 ttyLocker ttyl; // keep the following output all in one block
1042 1051
1043 LOG_OFFSET(xtty, relocation); 1052 LOG_OFFSET(xtty, relocation);
1044 LOG_OFFSET(xtty, consts); 1053 LOG_OFFSET(xtty, consts);
1045 LOG_OFFSET(xtty, insts); 1054 LOG_OFFSET(xtty, insts);
1046 LOG_OFFSET(xtty, stub); 1055 LOG_OFFSET(xtty, stub);
1047 LOG_OFFSET(xtty, oops);
1048 LOG_OFFSET(xtty, metadata);
1049 LOG_OFFSET(xtty, scopes_data); 1056 LOG_OFFSET(xtty, scopes_data);
1050 LOG_OFFSET(xtty, scopes_pcs); 1057 LOG_OFFSET(xtty, scopes_pcs);
1051 LOG_OFFSET(xtty, dependencies); 1058 LOG_OFFSET(xtty, dependencies);
1052 LOG_OFFSET(xtty, handler_table); 1059 LOG_OFFSET(xtty, handler_table);
1053 LOG_OFFSET(xtty, nul_chk_table); 1060 LOG_OFFSET(xtty, nul_chk_table);
1061 LOG_OFFSET(xtty, oops);
1062 LOG_OFFSET(xtty, metadata);
1054 1063
1055 xtty->method(method()); 1064 xtty->method(method());
1056 xtty->stamp(); 1065 xtty->stamp();
1057 xtty->end_elem(); 1066 xtty->end_elem();
1058 } 1067 }
1445 } 1454 }
1446 1455
1447 // The caller can be calling the method statically or through an inline 1456 // The caller can be calling the method statically or through an inline
1448 // cache call. 1457 // cache call.
1449 if (!is_osr_method() && !is_not_entrant()) { 1458 if (!is_osr_method() && !is_not_entrant()) {
1450 address stub = SharedRuntime::get_handle_wrong_method_stub(); 1459 NativeJump::patch_verified_entry(entry_point(), verified_entry_point(),
1451 NativeJump::patch_verified_entry(entry_point(), verified_entry_point(), stub); 1460 SharedRuntime::get_handle_wrong_method_stub());
1452 } 1461 }
1453 1462
1454 if (is_in_use()) { 1463 if (is_in_use()) {
1455 // It's a true state change, so mark the method as decompiled. 1464 // It's a true state change, so mark the method as decompiled.
1456 // Do it only for transition from alive. 1465 // Do it only for transition from alive.