src/share/vm/code/nmethod.cpp

Print this page
rev 6559 : 8046231: G1: Code root location ... from nmethod ... not in strong code roots for region
Reviewed-by:


 651     _consts_offset           = data_offset();
 652     _stub_offset             = data_offset();
 653     _oops_offset             = data_offset();
 654     _metadata_offset         = _oops_offset         + round_to(code_buffer->total_oop_size(), oopSize);
 655     _scopes_data_offset      = _metadata_offset     + round_to(code_buffer->total_metadata_size(), wordSize);
 656     _scopes_pcs_offset       = _scopes_data_offset;
 657     _dependencies_offset     = _scopes_pcs_offset;
 658     _handler_table_offset    = _dependencies_offset;
 659     _nul_chk_table_offset    = _handler_table_offset;
 660     _nmethod_end_offset      = _nul_chk_table_offset;
 661     _compile_id              = compile_id;
 662     _comp_level              = CompLevel_none;
 663     _entry_point             = code_begin()          + offsets->value(CodeOffsets::Entry);
 664     _verified_entry_point    = code_begin()          + offsets->value(CodeOffsets::Verified_Entry);
 665     _osr_entry_point         = NULL;
 666     _exception_cache         = NULL;
 667     _pc_desc_cache.reset_to(NULL);
 668     _hotness_counter         = NMethodSweeper::hotness_counter_reset_val();
 669 
 670     code_buffer->copy_values_to(this);
 671     if (ScavengeRootsInCode && detect_scavenge_root_oops()) {

 672       CodeCache::add_scavenge_root_nmethod(this);

 673       Universe::heap()->register_nmethod(this);
 674     }
 675     debug_only(verify_scavenge_root_oops());
 676     CodeCache::commit(this);
 677   }
 678 
 679   if (PrintNativeNMethods || PrintDebugInfo || PrintRelocations || PrintDependencies) {
 680     ttyLocker ttyl;  // keep the following output all in one block
 681     // This output goes directly to the tty, not the compiler log.
 682     // To enable tools to match it up with the compilation activity,
 683     // be sure to tag this tty output with the compile ID.
 684     if (xtty != NULL) {
 685       xtty->begin_head("print_native_nmethod");
 686       xtty->method(_method);
 687       xtty->stamp();
 688       xtty->end_head(" address='" INTPTR_FORMAT "'", (intptr_t) this);
 689     }
 690     // print the header part first
 691     print();
 692     // then print the requested information


 736     _consts_offset           = data_offset();
 737     _stub_offset             = data_offset();
 738     _oops_offset             = data_offset();
 739     _metadata_offset         = _oops_offset         + round_to(code_buffer->total_oop_size(), oopSize);
 740     _scopes_data_offset      = _metadata_offset     + round_to(code_buffer->total_metadata_size(), wordSize);
 741     _scopes_pcs_offset       = _scopes_data_offset;
 742     _dependencies_offset     = _scopes_pcs_offset;
 743     _handler_table_offset    = _dependencies_offset;
 744     _nul_chk_table_offset    = _handler_table_offset;
 745     _nmethod_end_offset      = _nul_chk_table_offset;
 746     _compile_id              = 0;  // default
 747     _comp_level              = CompLevel_none;
 748     _entry_point             = code_begin()          + offsets->value(CodeOffsets::Entry);
 749     _verified_entry_point    = code_begin()          + offsets->value(CodeOffsets::Verified_Entry);
 750     _osr_entry_point         = NULL;
 751     _exception_cache         = NULL;
 752     _pc_desc_cache.reset_to(NULL);
 753     _hotness_counter         = NMethodSweeper::hotness_counter_reset_val();
 754 
 755     code_buffer->copy_values_to(this);
 756     if (ScavengeRootsInCode && detect_scavenge_root_oops()) {

 757       CodeCache::add_scavenge_root_nmethod(this);

 758       Universe::heap()->register_nmethod(this);
 759     }
 760     DEBUG_ONLY(verify_scavenge_root_oops();)
 761     CodeCache::commit(this);
 762   }
 763 
 764   if (PrintNMethods || PrintDebugInfo || PrintRelocations || PrintDependencies) {
 765     ttyLocker ttyl;  // keep the following output all in one block
 766     // This output goes directly to the tty, not the compiler log.
 767     // To enable tools to match it up with the compilation activity,
 768     // be sure to tag this tty output with the compile ID.
 769     if (xtty != NULL) {
 770       xtty->begin_head("print_dtrace_nmethod");
 771       xtty->method(_method);
 772       xtty->stamp();
 773       xtty->end_head(" address='" INTPTR_FORMAT "'", (intptr_t) this);
 774     }
 775     // print the header part first
 776     print();
 777     // then print the requested information


 852     _oops_offset             = data_offset();
 853     _metadata_offset         = _oops_offset          + round_to(code_buffer->total_oop_size(), oopSize);
 854     _scopes_data_offset      = _metadata_offset      + round_to(code_buffer->total_metadata_size(), wordSize);
 855 
 856     _scopes_pcs_offset       = _scopes_data_offset   + round_to(debug_info->data_size       (), oopSize);
 857     _dependencies_offset     = _scopes_pcs_offset    + adjust_pcs_size(debug_info->pcs_size());
 858     _handler_table_offset    = _dependencies_offset  + round_to(dependencies->size_in_bytes (), oopSize);
 859     _nul_chk_table_offset    = _handler_table_offset + round_to(handler_table->size_in_bytes(), oopSize);
 860     _nmethod_end_offset      = _nul_chk_table_offset + round_to(nul_chk_table->size_in_bytes(), oopSize);
 861 
 862     _entry_point             = code_begin()          + offsets->value(CodeOffsets::Entry);
 863     _verified_entry_point    = code_begin()          + offsets->value(CodeOffsets::Verified_Entry);
 864     _osr_entry_point         = code_begin()          + offsets->value(CodeOffsets::OSR_Entry);
 865     _exception_cache         = NULL;
 866     _pc_desc_cache.reset_to(scopes_pcs_begin());
 867 
 868     // Copy contents of ScopeDescRecorder to nmethod
 869     code_buffer->copy_values_to(this);
 870     debug_info->copy_to(this);
 871     dependencies->copy_to(this);
 872     if (ScavengeRootsInCode && detect_scavenge_root_oops()) {

 873       CodeCache::add_scavenge_root_nmethod(this);

 874       Universe::heap()->register_nmethod(this);
 875     }
 876     debug_only(verify_scavenge_root_oops());
 877 
 878     CodeCache::commit(this);
 879 
 880     // Copy contents of ExceptionHandlerTable to nmethod
 881     handler_table->copy_to(this);
 882     nul_chk_table->copy_to(this);
 883 
 884     // we use the information of entry points to find out if a method is
 885     // static or non static
 886     assert(compiler->is_c2() ||
 887            _method->is_static() == (entry_point() == _verified_entry_point),
 888            " entry points must be same for static methods and vice versa");
 889   }
 890 
 891   bool printnmethods = PrintNMethods
 892     || CompilerOracle::should_print(_method)
 893     || CompilerOracle::has_option_string(_method, "PrintNMethods");




 651     _consts_offset           = data_offset();
 652     _stub_offset             = data_offset();
 653     _oops_offset             = data_offset();
 654     _metadata_offset         = _oops_offset         + round_to(code_buffer->total_oop_size(), oopSize);
 655     _scopes_data_offset      = _metadata_offset     + round_to(code_buffer->total_metadata_size(), wordSize);
 656     _scopes_pcs_offset       = _scopes_data_offset;
 657     _dependencies_offset     = _scopes_pcs_offset;
 658     _handler_table_offset    = _dependencies_offset;
 659     _nul_chk_table_offset    = _handler_table_offset;
 660     _nmethod_end_offset      = _nul_chk_table_offset;
 661     _compile_id              = compile_id;
 662     _comp_level              = CompLevel_none;
 663     _entry_point             = code_begin()          + offsets->value(CodeOffsets::Entry);
 664     _verified_entry_point    = code_begin()          + offsets->value(CodeOffsets::Verified_Entry);
 665     _osr_entry_point         = NULL;
 666     _exception_cache         = NULL;
 667     _pc_desc_cache.reset_to(NULL);
 668     _hotness_counter         = NMethodSweeper::hotness_counter_reset_val();
 669 
 670     code_buffer->copy_values_to(this);
 671     if (ScavengeRootsInCode) {
 672       if (detect_scavenge_root_oops()) {
 673         CodeCache::add_scavenge_root_nmethod(this);
 674       }
 675       Universe::heap()->register_nmethod(this);
 676     }
 677     debug_only(verify_scavenge_root_oops());
 678     CodeCache::commit(this);
 679   }
 680 
 681   if (PrintNativeNMethods || PrintDebugInfo || PrintRelocations || PrintDependencies) {
 682     ttyLocker ttyl;  // keep the following output all in one block
 683     // This output goes directly to the tty, not the compiler log.
 684     // To enable tools to match it up with the compilation activity,
 685     // be sure to tag this tty output with the compile ID.
 686     if (xtty != NULL) {
 687       xtty->begin_head("print_native_nmethod");
 688       xtty->method(_method);
 689       xtty->stamp();
 690       xtty->end_head(" address='" INTPTR_FORMAT "'", (intptr_t) this);
 691     }
 692     // print the header part first
 693     print();
 694     // then print the requested information


 738     _consts_offset           = data_offset();
 739     _stub_offset             = data_offset();
 740     _oops_offset             = data_offset();
 741     _metadata_offset         = _oops_offset         + round_to(code_buffer->total_oop_size(), oopSize);
 742     _scopes_data_offset      = _metadata_offset     + round_to(code_buffer->total_metadata_size(), wordSize);
 743     _scopes_pcs_offset       = _scopes_data_offset;
 744     _dependencies_offset     = _scopes_pcs_offset;
 745     _handler_table_offset    = _dependencies_offset;
 746     _nul_chk_table_offset    = _handler_table_offset;
 747     _nmethod_end_offset      = _nul_chk_table_offset;
 748     _compile_id              = 0;  // default
 749     _comp_level              = CompLevel_none;
 750     _entry_point             = code_begin()          + offsets->value(CodeOffsets::Entry);
 751     _verified_entry_point    = code_begin()          + offsets->value(CodeOffsets::Verified_Entry);
 752     _osr_entry_point         = NULL;
 753     _exception_cache         = NULL;
 754     _pc_desc_cache.reset_to(NULL);
 755     _hotness_counter         = NMethodSweeper::hotness_counter_reset_val();
 756 
 757     code_buffer->copy_values_to(this);
 758     if (ScavengeRootsInCode) {
 759       if (detect_scavenge_root_oops()) {
 760         CodeCache::add_scavenge_root_nmethod(this);
 761       }
 762       Universe::heap()->register_nmethod(this);
 763     }
 764     DEBUG_ONLY(verify_scavenge_root_oops();)
 765     CodeCache::commit(this);
 766   }
 767 
 768   if (PrintNMethods || PrintDebugInfo || PrintRelocations || PrintDependencies) {
 769     ttyLocker ttyl;  // keep the following output all in one block
 770     // This output goes directly to the tty, not the compiler log.
 771     // To enable tools to match it up with the compilation activity,
 772     // be sure to tag this tty output with the compile ID.
 773     if (xtty != NULL) {
 774       xtty->begin_head("print_dtrace_nmethod");
 775       xtty->method(_method);
 776       xtty->stamp();
 777       xtty->end_head(" address='" INTPTR_FORMAT "'", (intptr_t) this);
 778     }
 779     // print the header part first
 780     print();
 781     // then print the requested information


 856     _oops_offset             = data_offset();
 857     _metadata_offset         = _oops_offset          + round_to(code_buffer->total_oop_size(), oopSize);
 858     _scopes_data_offset      = _metadata_offset      + round_to(code_buffer->total_metadata_size(), wordSize);
 859 
 860     _scopes_pcs_offset       = _scopes_data_offset   + round_to(debug_info->data_size       (), oopSize);
 861     _dependencies_offset     = _scopes_pcs_offset    + adjust_pcs_size(debug_info->pcs_size());
 862     _handler_table_offset    = _dependencies_offset  + round_to(dependencies->size_in_bytes (), oopSize);
 863     _nul_chk_table_offset    = _handler_table_offset + round_to(handler_table->size_in_bytes(), oopSize);
 864     _nmethod_end_offset      = _nul_chk_table_offset + round_to(nul_chk_table->size_in_bytes(), oopSize);
 865 
 866     _entry_point             = code_begin()          + offsets->value(CodeOffsets::Entry);
 867     _verified_entry_point    = code_begin()          + offsets->value(CodeOffsets::Verified_Entry);
 868     _osr_entry_point         = code_begin()          + offsets->value(CodeOffsets::OSR_Entry);
 869     _exception_cache         = NULL;
 870     _pc_desc_cache.reset_to(scopes_pcs_begin());
 871 
 872     // Copy contents of ScopeDescRecorder to nmethod
 873     code_buffer->copy_values_to(this);
 874     debug_info->copy_to(this);
 875     dependencies->copy_to(this);
 876     if (ScavengeRootsInCode) {
 877       if (detect_scavenge_root_oops()) {
 878         CodeCache::add_scavenge_root_nmethod(this);
 879       }
 880       Universe::heap()->register_nmethod(this);
 881     }
 882     debug_only(verify_scavenge_root_oops());
 883 
 884     CodeCache::commit(this);
 885 
 886     // Copy contents of ExceptionHandlerTable to nmethod
 887     handler_table->copy_to(this);
 888     nul_chk_table->copy_to(this);
 889 
 890     // we use the information of entry points to find out if a method is
 891     // static or non static
 892     assert(compiler->is_c2() ||
 893            _method->is_static() == (entry_point() == _verified_entry_point),
 894            " entry points must be same for static methods and vice versa");
 895   }
 896 
 897   bool printnmethods = PrintNMethods
 898     || CompilerOracle::should_print(_method)
 899     || CompilerOracle::has_option_string(_method, "PrintNMethods");