< prev index next >

src/share/vm/compiler/disassembler.cpp

Print this page
rev 12906 : [mq]: gc_interface


   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "classfile/javaClasses.hpp"
  27 #include "code/codeCache.hpp"
  28 #include "compiler/disassembler.hpp"

  29 #include "gc/shared/cardTableModRefBS.hpp"
  30 #include "gc/shared/collectedHeap.hpp"
  31 #include "memory/resourceArea.hpp"
  32 #include "oops/oop.inline.hpp"
  33 #include "runtime/fprofiler.hpp"
  34 #include "runtime/handles.inline.hpp"
  35 #include "runtime/os.hpp"
  36 #include "runtime/stubCodeGenerator.hpp"
  37 #include "runtime/stubRoutines.hpp"
  38 #include CPU_HEADER(depChecker)
  39 #ifdef SHARK
  40 #include "shark/sharkEntry.hpp"
  41 #endif
  42 
  43 void*       Disassembler::_library               = NULL;
  44 bool        Disassembler::_tried_to_load_library = false;
  45 
  46 // This routine is in the shared library:
  47 Disassembler::decode_func_virtual Disassembler::_decode_instructions_virtual = NULL;
  48 Disassembler::decode_func Disassembler::_decode_instructions = NULL;


 320     if (StubRoutines::contains(adr)) {
 321       StubCodeDesc* desc = StubCodeDesc::desc_for(adr);
 322       if (desc == NULL) {
 323         desc = StubCodeDesc::desc_for(adr + frame::pc_return_offset);
 324       }
 325       if (desc != NULL) {
 326         st->print("Stub::%s", desc->name());
 327         if (desc->begin() != adr) {
 328           st->print(INTX_FORMAT_W(+) " " PTR_FORMAT, adr - desc->begin(), p2i(adr));
 329         } else if (WizardMode) {
 330           st->print(" " PTR_FORMAT, p2i(adr));
 331         }
 332         return;
 333       }
 334       st->print("Stub::<unknown> " PTR_FORMAT, p2i(adr));
 335       return;
 336     }
 337 
 338     BarrierSet* bs = Universe::heap()->barrier_set();
 339     if (bs->is_a(BarrierSet::CardTableModRef) &&
 340         adr == (address)(barrier_set_cast<CardTableModRefBS>(bs)->byte_map_base)) {
 341       st->print("word_map_base");
 342       if (WizardMode) st->print(" " INTPTR_FORMAT, p2i(adr));
 343       return;
 344     }
 345   }
 346 
 347   if (_nm == NULL) {
 348     // Don't do this for native methods, as the function name will be printed in
 349     // nmethod::reloc_string_for().
 350     ResourceMark rm;
 351     const int buflen = 1024;
 352     char* buf = NEW_RESOURCE_ARRAY(char, buflen);
 353     int offset;
 354     if (os::dll_address_to_function_name(adr, buf, buflen, &offset)) {
 355       st->print(PTR_FORMAT " = %s",  p2i(adr), buf);
 356       if (offset != 0) {
 357         st->print("+%d", offset);
 358       }
 359       return;
 360     }
 361   }




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "classfile/javaClasses.hpp"
  27 #include "code/codeCache.hpp"
  28 #include "compiler/disassembler.hpp"
  29 #include "gc/shared/cardTable.hpp"
  30 #include "gc/shared/cardTableModRefBS.hpp"
  31 #include "gc/shared/collectedHeap.hpp"
  32 #include "memory/resourceArea.hpp"
  33 #include "oops/oop.inline.hpp"
  34 #include "runtime/fprofiler.hpp"
  35 #include "runtime/handles.inline.hpp"
  36 #include "runtime/os.hpp"
  37 #include "runtime/stubCodeGenerator.hpp"
  38 #include "runtime/stubRoutines.hpp"
  39 #include CPU_HEADER(depChecker)
  40 #ifdef SHARK
  41 #include "shark/sharkEntry.hpp"
  42 #endif
  43 
  44 void*       Disassembler::_library               = NULL;
  45 bool        Disassembler::_tried_to_load_library = false;
  46 
  47 // This routine is in the shared library:
  48 Disassembler::decode_func_virtual Disassembler::_decode_instructions_virtual = NULL;
  49 Disassembler::decode_func Disassembler::_decode_instructions = NULL;


 321     if (StubRoutines::contains(adr)) {
 322       StubCodeDesc* desc = StubCodeDesc::desc_for(adr);
 323       if (desc == NULL) {
 324         desc = StubCodeDesc::desc_for(adr + frame::pc_return_offset);
 325       }
 326       if (desc != NULL) {
 327         st->print("Stub::%s", desc->name());
 328         if (desc->begin() != adr) {
 329           st->print(INTX_FORMAT_W(+) " " PTR_FORMAT, adr - desc->begin(), p2i(adr));
 330         } else if (WizardMode) {
 331           st->print(" " PTR_FORMAT, p2i(adr));
 332         }
 333         return;
 334       }
 335       st->print("Stub::<unknown> " PTR_FORMAT, p2i(adr));
 336       return;
 337     }
 338 
 339     BarrierSet* bs = Universe::heap()->barrier_set();
 340     if (bs->is_a(BarrierSet::CardTableModRef) &&
 341         adr == (address)(barrier_set_cast<CardTableModRefBS>(bs)->card_table()->byte_map_base())) {
 342       st->print("byte_map_base");
 343       if (WizardMode) st->print(" " INTPTR_FORMAT, p2i(adr));
 344       return;
 345     }
 346   }
 347 
 348   if (_nm == NULL) {
 349     // Don't do this for native methods, as the function name will be printed in
 350     // nmethod::reloc_string_for().
 351     ResourceMark rm;
 352     const int buflen = 1024;
 353     char* buf = NEW_RESOURCE_ARRAY(char, buflen);
 354     int offset;
 355     if (os::dll_address_to_function_name(adr, buf, buflen, &offset)) {
 356       st->print(PTR_FORMAT " = %s",  p2i(adr), buf);
 357       if (offset != 0) {
 358         st->print("+%d", offset);
 359       }
 360       return;
 361     }
 362   }


< prev index next >