src/hotspot/share/code/codeBlob.cpp
changeset 52014 1aa9beac610e
parent 51333 f6641fcf7b7e
child 54623 1126f0607c70
equal deleted inserted replaced
52013:92383597fa21 52014:1aa9beac610e
    24 
    24 
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
    26 #include "jvm.h"
    26 #include "jvm.h"
    27 #include "code/codeBlob.hpp"
    27 #include "code/codeBlob.hpp"
    28 #include "code/codeCache.hpp"
    28 #include "code/codeCache.hpp"
       
    29 #include "code/icBuffer.hpp"
    29 #include "code/relocInfo.hpp"
    30 #include "code/relocInfo.hpp"
       
    31 #include "code/vtableStubs.hpp"
    30 #include "compiler/disassembler.hpp"
    32 #include "compiler/disassembler.hpp"
    31 #include "interpreter/bytecode.hpp"
    33 #include "interpreter/bytecode.hpp"
    32 #include "memory/allocation.inline.hpp"
    34 #include "memory/allocation.inline.hpp"
    33 #include "memory/heap.hpp"
    35 #include "memory/heap.hpp"
    34 #include "memory/resourceArea.hpp"
    36 #include "memory/resourceArea.hpp"
   557 
   559 
   558 void CodeBlob::print_value_on(outputStream* st) const {
   560 void CodeBlob::print_value_on(outputStream* st) const {
   559   st->print_cr("[CodeBlob]");
   561   st->print_cr("[CodeBlob]");
   560 }
   562 }
   561 
   563 
       
   564 void CodeBlob::dump_for_addr(address addr, outputStream* st, bool verbose) const {
       
   565   if (is_buffer_blob()) {
       
   566     // the interpreter is generated into a buffer blob
       
   567     InterpreterCodelet* i = Interpreter::codelet_containing(addr);
       
   568     if (i != NULL) {
       
   569       st->print_cr(INTPTR_FORMAT " is at code_begin+%d in an Interpreter codelet", p2i(addr), (int)(addr - i->code_begin()));
       
   570       i->print_on(st);
       
   571       return;
       
   572     }
       
   573     if (Interpreter::contains(addr)) {
       
   574       st->print_cr(INTPTR_FORMAT " is pointing into interpreter code"
       
   575                    " (not bytecode specific)", p2i(addr));
       
   576       return;
       
   577     }
       
   578     //
       
   579     if (AdapterHandlerLibrary::contains(this)) {
       
   580       st->print_cr(INTPTR_FORMAT " is at code_begin+%d in an AdapterHandler", p2i(addr), (int)(addr - code_begin()));
       
   581       AdapterHandlerLibrary::print_handler_on(st, this);
       
   582     }
       
   583     // the stubroutines are generated into a buffer blob
       
   584     StubCodeDesc* d = StubCodeDesc::desc_for(addr);
       
   585     if (d != NULL) {
       
   586       st->print_cr(INTPTR_FORMAT " is at begin+%d in a stub", p2i(addr), (int)(addr - d->begin()));
       
   587       d->print_on(st);
       
   588       st->cr();
       
   589       return;
       
   590     }
       
   591     if (StubRoutines::contains(addr)) {
       
   592       st->print_cr(INTPTR_FORMAT " is pointing to an (unnamed) stub routine", p2i(addr));
       
   593       return;
       
   594     }
       
   595     // the InlineCacheBuffer is using stubs generated into a buffer blob
       
   596     if (InlineCacheBuffer::contains(addr)) {
       
   597       st->print_cr(INTPTR_FORMAT " is pointing into InlineCacheBuffer", p2i(addr));
       
   598       return;
       
   599     }
       
   600     VtableStub* v = VtableStubs::stub_containing(addr);
       
   601     if (v != NULL) {
       
   602       st->print_cr(INTPTR_FORMAT " is at entry_point+%d in a vtable stub", p2i(addr), (int)(addr - v->entry_point()));
       
   603       v->print_on(st);
       
   604       st->cr();
       
   605       return;
       
   606     }
       
   607   }
       
   608   if (is_nmethod()) {
       
   609     nmethod* nm = (nmethod*)this;
       
   610     ResourceMark rm;
       
   611     st->print(INTPTR_FORMAT " is at entry_point+%d in (nmethod*)" INTPTR_FORMAT,
       
   612               p2i(addr), (int)(addr - nm->entry_point()), p2i(nm));
       
   613     if (verbose) {
       
   614       st->print(" for ");
       
   615       nm->method()->print_value_on(st);
       
   616     }
       
   617     st->cr();
       
   618     nm->print_nmethod(verbose);
       
   619     return;
       
   620   }
       
   621   st->print_cr(INTPTR_FORMAT " is at code_begin+%d in ", p2i(addr), (int)(addr - code_begin()));
       
   622   print_on(st);
       
   623 }
       
   624 
   562 void RuntimeBlob::verify() {
   625 void RuntimeBlob::verify() {
   563   ShouldNotReachHere();
   626   ShouldNotReachHere();
   564 }
   627 }
   565 
   628 
   566 void BufferBlob::verify() {
   629 void BufferBlob::verify() {