src/share/vm/code/nmethod.cpp

Print this page
rev 5099 : dummy


 666     _deoptimize_mh_offset    = 0;
 667     _orig_pc_offset          = 0;
 668 
 669     _consts_offset           = data_offset();
 670     _stub_offset             = data_offset();
 671     _oops_offset             = data_offset();
 672     _metadata_offset         = _oops_offset         + round_to(code_buffer->total_oop_size(), oopSize);
 673     _scopes_data_offset      = _metadata_offset     + round_to(code_buffer->total_metadata_size(), wordSize);
 674     _scopes_pcs_offset       = _scopes_data_offset;
 675     _dependencies_offset     = _scopes_pcs_offset;
 676     _handler_table_offset    = _dependencies_offset;
 677     _nul_chk_table_offset    = _handler_table_offset;
 678     _nmethod_end_offset      = _nul_chk_table_offset;
 679     _compile_id              = compile_id;
 680     _comp_level              = CompLevel_none;
 681     _entry_point             = code_begin()          + offsets->value(CodeOffsets::Entry);
 682     _verified_entry_point    = code_begin()          + offsets->value(CodeOffsets::Verified_Entry);
 683     _osr_entry_point         = NULL;
 684     _exception_cache         = NULL;
 685     _pc_desc_cache.reset_to(NULL);

 686 
 687     code_buffer->copy_values_to(this);
 688     if (ScavengeRootsInCode && detect_scavenge_root_oops()) {
 689       CodeCache::add_scavenge_root_nmethod(this);
 690     }
 691     debug_only(verify_scavenge_root_oops());
 692     CodeCache::commit(this);
 693   }
 694 
 695   if (PrintNativeNMethods || PrintDebugInfo || PrintRelocations || PrintDependencies) {
 696     ttyLocker ttyl;  // keep the following output all in one block
 697     // This output goes directly to the tty, not the compiler log.
 698     // To enable tools to match it up with the compilation activity,
 699     // be sure to tag this tty output with the compile ID.
 700     if (xtty != NULL) {
 701       xtty->begin_head("print_native_nmethod");
 702       xtty->method(_method);
 703       xtty->stamp();
 704       xtty->end_head(" address='" INTPTR_FORMAT "'", (intptr_t) this);
 705     }


 749     _unwind_handler_offset   = -1;
 750     _trap_offset             = offsets->value(CodeOffsets::Dtrace_trap);
 751     _orig_pc_offset          = 0;
 752     _consts_offset           = data_offset();
 753     _stub_offset             = data_offset();
 754     _oops_offset             = data_offset();
 755     _metadata_offset         = _oops_offset         + round_to(code_buffer->total_oop_size(), oopSize);
 756     _scopes_data_offset      = _metadata_offset     + round_to(code_buffer->total_metadata_size(), wordSize);
 757     _scopes_pcs_offset       = _scopes_data_offset;
 758     _dependencies_offset     = _scopes_pcs_offset;
 759     _handler_table_offset    = _dependencies_offset;
 760     _nul_chk_table_offset    = _handler_table_offset;
 761     _nmethod_end_offset      = _nul_chk_table_offset;
 762     _compile_id              = 0;  // default
 763     _comp_level              = CompLevel_none;
 764     _entry_point             = code_begin()          + offsets->value(CodeOffsets::Entry);
 765     _verified_entry_point    = code_begin()          + offsets->value(CodeOffsets::Verified_Entry);
 766     _osr_entry_point         = NULL;
 767     _exception_cache         = NULL;
 768     _pc_desc_cache.reset_to(NULL);

 769 
 770     code_buffer->copy_values_to(this);
 771     debug_only(verify_scavenge_root_oops());
 772     CodeCache::commit(this);
 773   }
 774 
 775   if (PrintNMethods || PrintDebugInfo || PrintRelocations || PrintDependencies) {
 776     ttyLocker ttyl;  // keep the following output all in one block
 777     // This output goes directly to the tty, not the compiler log.
 778     // To enable tools to match it up with the compilation activity,
 779     // be sure to tag this tty output with the compile ID.
 780     if (xtty != NULL) {
 781       xtty->begin_head("print_dtrace_nmethod");
 782       xtty->method(_method);
 783       xtty->stamp();
 784       xtty->end_head(" address='" INTPTR_FORMAT "'", (intptr_t) this);
 785     }
 786     // print the header part first
 787     print();
 788     // then print the requested information


 821   AbstractCompiler* compiler,
 822   int comp_level
 823   )
 824   : CodeBlob("nmethod", code_buffer, sizeof(nmethod),
 825              nmethod_size, offsets->value(CodeOffsets::Frame_Complete), frame_size, oop_maps),
 826   _native_receiver_sp_offset(in_ByteSize(-1)),
 827   _native_basic_lock_sp_offset(in_ByteSize(-1))
 828 {
 829   assert(debug_info->oop_recorder() == code_buffer->oop_recorder(), "shared OR");
 830   {
 831     debug_only(No_Safepoint_Verifier nsv;)
 832     assert_locked_or_safepoint(CodeCache_lock);
 833 
 834     init_defaults();
 835     _method                  = method;
 836     _entry_bci               = entry_bci;
 837     _compile_id              = compile_id;
 838     _comp_level              = comp_level;
 839     _compiler                = compiler;
 840     _orig_pc_offset          = orig_pc_offset;

 841 
 842     // Section offsets
 843     _consts_offset           = content_offset()      + code_buffer->total_offset_of(code_buffer->consts());
 844     _stub_offset             = content_offset()      + code_buffer->total_offset_of(code_buffer->stubs());
 845 
 846     // Exception handler and deopt handler are in the stub section
 847     assert(offsets->value(CodeOffsets::Exceptions) != -1, "must be set");
 848     assert(offsets->value(CodeOffsets::Deopt     ) != -1, "must be set");
 849     _exception_offset        = _stub_offset          + offsets->value(CodeOffsets::Exceptions);
 850     _deoptimize_offset       = _stub_offset          + offsets->value(CodeOffsets::Deopt);
 851     if (offsets->value(CodeOffsets::DeoptMH) != -1) {
 852       _deoptimize_mh_offset  = _stub_offset          + offsets->value(CodeOffsets::DeoptMH);
 853     } else {
 854       _deoptimize_mh_offset  = -1;
 855     }
 856     if (offsets->value(CodeOffsets::UnwindHandler) != -1) {
 857       _unwind_handler_offset = code_offset()         + offsets->value(CodeOffsets::UnwindHandler);
 858     } else {
 859       _unwind_handler_offset = -1;
 860     }




 666     _deoptimize_mh_offset    = 0;
 667     _orig_pc_offset          = 0;
 668 
 669     _consts_offset           = data_offset();
 670     _stub_offset             = data_offset();
 671     _oops_offset             = data_offset();
 672     _metadata_offset         = _oops_offset         + round_to(code_buffer->total_oop_size(), oopSize);
 673     _scopes_data_offset      = _metadata_offset     + round_to(code_buffer->total_metadata_size(), wordSize);
 674     _scopes_pcs_offset       = _scopes_data_offset;
 675     _dependencies_offset     = _scopes_pcs_offset;
 676     _handler_table_offset    = _dependencies_offset;
 677     _nul_chk_table_offset    = _handler_table_offset;
 678     _nmethod_end_offset      = _nul_chk_table_offset;
 679     _compile_id              = compile_id;
 680     _comp_level              = CompLevel_none;
 681     _entry_point             = code_begin()          + offsets->value(CodeOffsets::Entry);
 682     _verified_entry_point    = code_begin()          + offsets->value(CodeOffsets::Verified_Entry);
 683     _osr_entry_point         = NULL;
 684     _exception_cache         = NULL;
 685     _pc_desc_cache.reset_to(NULL);
 686     _hotness_counter         = 0;
 687 
 688     code_buffer->copy_values_to(this);
 689     if (ScavengeRootsInCode && detect_scavenge_root_oops()) {
 690       CodeCache::add_scavenge_root_nmethod(this);
 691     }
 692     debug_only(verify_scavenge_root_oops());
 693     CodeCache::commit(this);
 694   }
 695 
 696   if (PrintNativeNMethods || PrintDebugInfo || PrintRelocations || PrintDependencies) {
 697     ttyLocker ttyl;  // keep the following output all in one block
 698     // This output goes directly to the tty, not the compiler log.
 699     // To enable tools to match it up with the compilation activity,
 700     // be sure to tag this tty output with the compile ID.
 701     if (xtty != NULL) {
 702       xtty->begin_head("print_native_nmethod");
 703       xtty->method(_method);
 704       xtty->stamp();
 705       xtty->end_head(" address='" INTPTR_FORMAT "'", (intptr_t) this);
 706     }


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


 823   AbstractCompiler* compiler,
 824   int comp_level
 825   )
 826   : CodeBlob("nmethod", code_buffer, sizeof(nmethod),
 827              nmethod_size, offsets->value(CodeOffsets::Frame_Complete), frame_size, oop_maps),
 828   _native_receiver_sp_offset(in_ByteSize(-1)),
 829   _native_basic_lock_sp_offset(in_ByteSize(-1))
 830 {
 831   assert(debug_info->oop_recorder() == code_buffer->oop_recorder(), "shared OR");
 832   {
 833     debug_only(No_Safepoint_Verifier nsv;)
 834     assert_locked_or_safepoint(CodeCache_lock);
 835 
 836     init_defaults();
 837     _method                  = method;
 838     _entry_bci               = entry_bci;
 839     _compile_id              = compile_id;
 840     _comp_level              = comp_level;
 841     _compiler                = compiler;
 842     _orig_pc_offset          = orig_pc_offset;
 843     _hotness_counter         = 0;
 844 
 845     // Section offsets
 846     _consts_offset           = content_offset()      + code_buffer->total_offset_of(code_buffer->consts());
 847     _stub_offset             = content_offset()      + code_buffer->total_offset_of(code_buffer->stubs());
 848 
 849     // Exception handler and deopt handler are in the stub section
 850     assert(offsets->value(CodeOffsets::Exceptions) != -1, "must be set");
 851     assert(offsets->value(CodeOffsets::Deopt     ) != -1, "must be set");
 852     _exception_offset        = _stub_offset          + offsets->value(CodeOffsets::Exceptions);
 853     _deoptimize_offset       = _stub_offset          + offsets->value(CodeOffsets::Deopt);
 854     if (offsets->value(CodeOffsets::DeoptMH) != -1) {
 855       _deoptimize_mh_offset  = _stub_offset          + offsets->value(CodeOffsets::DeoptMH);
 856     } else {
 857       _deoptimize_mh_offset  = -1;
 858     }
 859     if (offsets->value(CodeOffsets::UnwindHandler) != -1) {
 860       _unwind_handler_offset = code_offset()         + offsets->value(CodeOffsets::UnwindHandler);
 861     } else {
 862       _unwind_handler_offset = -1;
 863     }