src/share/vm/code/nmethod.cpp

Print this page
rev 9627 : 8144853: Print the names of callees in PrintAssembly/PrintInterpreter
Reviewed-by: xxx, yyy


  24 
  25 #include "precompiled.hpp"
  26 #include "code/codeCache.hpp"
  27 #include "code/compiledIC.hpp"
  28 #include "code/dependencies.hpp"
  29 #include "code/nativeInst.hpp"
  30 #include "code/nmethod.hpp"
  31 #include "code/scopeDesc.hpp"
  32 #include "compiler/abstractCompiler.hpp"
  33 #include "compiler/compileBroker.hpp"
  34 #include "compiler/compileLog.hpp"
  35 #include "compiler/compilerDirectives.hpp"
  36 #include "compiler/disassembler.hpp"
  37 #include "interpreter/bytecode.hpp"
  38 #include "oops/methodData.hpp"
  39 #include "oops/oop.inline.hpp"
  40 #include "prims/jvmtiRedefineClassesTrace.hpp"
  41 #include "prims/jvmtiImpl.hpp"
  42 #include "runtime/atomic.inline.hpp"
  43 #include "runtime/orderAccess.inline.hpp"

  44 #include "runtime/sharedRuntime.hpp"
  45 #include "runtime/sweeper.hpp"
  46 #include "utilities/resourceHash.hpp"
  47 #include "utilities/dtrace.hpp"
  48 #include "utilities/events.hpp"
  49 #include "utilities/xmlstream.hpp"
  50 #ifdef TARGET_ARCH_x86
  51 # include "nativeInst_x86.hpp"
  52 #endif
  53 #ifdef TARGET_ARCH_sparc
  54 # include "nativeInst_sparc.hpp"
  55 #endif
  56 #ifdef TARGET_ARCH_zero
  57 # include "nativeInst_zero.hpp"
  58 #endif
  59 #ifdef TARGET_ARCH_arm
  60 # include "nativeInst_arm.hpp"
  61 #endif
  62 #ifdef TARGET_ARCH_ppc
  63 # include "nativeInst_ppc.hpp"


3033           return st.as_string();
3034         }
3035         case relocInfo::metadata_type: {
3036           stringStream st;
3037           metadata_Relocation* r = iter.metadata_reloc();
3038           Metadata* obj = r->metadata_value();
3039           st.print("metadata(");
3040           if (obj == NULL) st.print("NULL");
3041           else obj->print_value_on(&st);
3042           st.print(")");
3043           return st.as_string();
3044         }
3045         case relocInfo::runtime_call_type: {
3046           stringStream st;
3047           st.print("runtime_call");
3048           runtime_call_Relocation* r = iter.runtime_call_reloc();
3049           address dest = r->destination();
3050           CodeBlob* cb = CodeCache::find_blob(dest);
3051           if (cb != NULL) {
3052             st.print(" %s", cb->name());











3053           }
3054           return st.as_string();
3055         }
3056         case relocInfo::virtual_call_type:     return "virtual_call";
3057         case relocInfo::opt_virtual_call_type: return "optimized virtual_call";
3058         case relocInfo::static_call_type:      return "static_call";
3059         case relocInfo::static_stub_type:      return "static_stub";
3060         case relocInfo::external_word_type:    return "external_word";
3061         case relocInfo::internal_word_type:    return "internal_word";
3062         case relocInfo::section_word_type:     return "section_word";
3063         case relocInfo::poll_type:             return "poll";
3064         case relocInfo::poll_return_type:      return "poll_return";
3065         case relocInfo::type_mask:             return "type_bit_mask";
3066     }
3067   }
3068   return have_one ? "other" : NULL;
3069 }
3070 
3071 // Return a the last scope in (begin..end]
3072 ScopeDesc* nmethod::scope_desc_in(address begin, address end) {




  24 
  25 #include "precompiled.hpp"
  26 #include "code/codeCache.hpp"
  27 #include "code/compiledIC.hpp"
  28 #include "code/dependencies.hpp"
  29 #include "code/nativeInst.hpp"
  30 #include "code/nmethod.hpp"
  31 #include "code/scopeDesc.hpp"
  32 #include "compiler/abstractCompiler.hpp"
  33 #include "compiler/compileBroker.hpp"
  34 #include "compiler/compileLog.hpp"
  35 #include "compiler/compilerDirectives.hpp"
  36 #include "compiler/disassembler.hpp"
  37 #include "interpreter/bytecode.hpp"
  38 #include "oops/methodData.hpp"
  39 #include "oops/oop.inline.hpp"
  40 #include "prims/jvmtiRedefineClassesTrace.hpp"
  41 #include "prims/jvmtiImpl.hpp"
  42 #include "runtime/atomic.inline.hpp"
  43 #include "runtime/orderAccess.inline.hpp"
  44 #include "runtime/os.hpp"
  45 #include "runtime/sharedRuntime.hpp"
  46 #include "runtime/sweeper.hpp"
  47 #include "utilities/resourceHash.hpp"
  48 #include "utilities/dtrace.hpp"
  49 #include "utilities/events.hpp"
  50 #include "utilities/xmlstream.hpp"
  51 #ifdef TARGET_ARCH_x86
  52 # include "nativeInst_x86.hpp"
  53 #endif
  54 #ifdef TARGET_ARCH_sparc
  55 # include "nativeInst_sparc.hpp"
  56 #endif
  57 #ifdef TARGET_ARCH_zero
  58 # include "nativeInst_zero.hpp"
  59 #endif
  60 #ifdef TARGET_ARCH_arm
  61 # include "nativeInst_arm.hpp"
  62 #endif
  63 #ifdef TARGET_ARCH_ppc
  64 # include "nativeInst_ppc.hpp"


3034           return st.as_string();
3035         }
3036         case relocInfo::metadata_type: {
3037           stringStream st;
3038           metadata_Relocation* r = iter.metadata_reloc();
3039           Metadata* obj = r->metadata_value();
3040           st.print("metadata(");
3041           if (obj == NULL) st.print("NULL");
3042           else obj->print_value_on(&st);
3043           st.print(")");
3044           return st.as_string();
3045         }
3046         case relocInfo::runtime_call_type: {
3047           stringStream st;
3048           st.print("runtime_call");
3049           runtime_call_Relocation* r = iter.runtime_call_reloc();
3050           address dest = r->destination();
3051           CodeBlob* cb = CodeCache::find_blob(dest);
3052           if (cb != NULL) {
3053             st.print(" %s", cb->name());
3054           } else {
3055             ResourceMark rm;
3056             const int buflen = 1024;
3057             char* buf = NEW_RESOURCE_ARRAY(char, buflen);
3058             int offset;
3059             if (os::dll_address_to_function_name(dest, buf, buflen, &offset)) {
3060               st.print(" %s", buf);
3061               if (offset != 0) {
3062                 st.print("+%d", offset);
3063               }
3064             }
3065           }
3066           return st.as_string();
3067         }
3068         case relocInfo::virtual_call_type:     return "virtual_call";
3069         case relocInfo::opt_virtual_call_type: return "optimized virtual_call";
3070         case relocInfo::static_call_type:      return "static_call";
3071         case relocInfo::static_stub_type:      return "static_stub";
3072         case relocInfo::external_word_type:    return "external_word";
3073         case relocInfo::internal_word_type:    return "internal_word";
3074         case relocInfo::section_word_type:     return "section_word";
3075         case relocInfo::poll_type:             return "poll";
3076         case relocInfo::poll_return_type:      return "poll_return";
3077         case relocInfo::type_mask:             return "type_bit_mask";
3078     }
3079   }
3080   return have_one ? "other" : NULL;
3081 }
3082 
3083 // Return a the last scope in (begin..end]
3084 ScopeDesc* nmethod::scope_desc_in(address begin, address end) {