< prev index next >

src/hotspot/share/asm/codeBuffer.cpp

Print this page
*** 27,10 ***
--- 27,11 ---
  #include "code/compiledIC.hpp"
  #include "code/oopRecorder.inline.hpp"
  #include "compiler/disassembler.hpp"
  #include "logging/log.hpp"
  #include "oops/klass.inline.hpp"
+ #include "oops/methodCounters.hpp"
  #include "oops/methodData.hpp"
  #include "oops/oop.inline.hpp"
  #include "runtime/icache.hpp"
  #include "runtime/safepointVerifiers.hpp"
  #include "utilities/align.hpp"

*** 534,10 ***
--- 535,13 ---
            Metadata* m = md->metadata_value();
            if (oop_recorder()->is_real(m)) {
              if (m->is_methodData()) {
                m = ((MethodData*)m)->method();
              }
+             if (m->is_methodCounters()) {
+               m = ((MethodCounters*)m)->method();
+             }
              if (m->is_method()) {
                m = ((Method*)m)->method_holder();
              }
              if (m->is_klass()) {
                append_oop_references(&oops, (Klass*)m);

*** 558,10 ***
--- 562,13 ---
        Metadata* m = oop_recorder()->metadata_at(i);
        if (oop_recorder()->is_real(m)) {
          if (m->is_methodData()) {
            m = ((MethodData*)m)->method();
          }
+         if (m->is_methodCounters()) {
+           m = ((MethodCounters*)m)->method();
+         }
          if (m->is_method()) {
            m = ((Method*)m)->method_holder();
          }
          if (m->is_klass()) {
            append_oop_references(&oops, (Klass*)m);

*** 989,27 ***
        if (!other->is_allocated() || other == sect) {
          continue;
        }
        guarantee(other->disjoint(sect), "sanity");
      }
!     guarantee(sect->end() <= tend, "sanity");
!     guarantee(sect->end() <= sect->limit(), "sanity");
    }
  }
  
  void CodeBuffer::log_section_sizes(const char* name) {
    if (xtty != nullptr) {
      ttyLocker ttyl;
      // log info about buffer usage
!     xtty->print_cr("<blob name='%s' total_size='%d'>", name, _total_size);
      for (int n = (int) CodeBuffer::SECT_FIRST; n < (int) CodeBuffer::SECT_LIMIT; n++) {
        CodeSection* sect = code_section(n);
        if (!sect->is_allocated() || sect->is_empty())  continue;
!       xtty->print_cr("<sect index='%d' capacity='%d' size='%d' remaining='%d'/>",
!                      n, sect->capacity(), sect->size(), sect->remaining());
      }
!     xtty->print_cr("</blob>");
    }
  }
  
  bool CodeBuffer::finalize_stubs() {
    if (_finalize_stubs && !pd_finalize_stubs()) {
--- 996,27 ---
        if (!other->is_allocated() || other == sect) {
          continue;
        }
        guarantee(other->disjoint(sect), "sanity");
      }
!     guarantee(sect->end() <= tend, "sanity, sect_end: " PTR_FORMAT " tend: " PTR_FORMAT " size: %d", p2i(sect->end()), p2i(tend), (int)_total_size);
!     guarantee(sect->end() <= sect->limit(), "sanity, sect_end: " PTR_FORMAT " sect_limit: " PTR_FORMAT, p2i(sect->end()), p2i(sect->limit()));
    }
  }
  
  void CodeBuffer::log_section_sizes(const char* name) {
    if (xtty != nullptr) {
      ttyLocker ttyl;
      // log info about buffer usage
!     xtty->head("blob name='%s' total_size='%d'", name, _total_size);
      for (int n = (int) CodeBuffer::SECT_FIRST; n < (int) CodeBuffer::SECT_LIMIT; n++) {
        CodeSection* sect = code_section(n);
        if (!sect->is_allocated() || sect->is_empty())  continue;
!       xtty->elem("sect index='%d' capacity='%d' size='%d' remaining='%d'",
!                  n, sect->capacity(), sect->size(), sect->remaining());
      }
!     xtty->tail("blob");
    }
  }
  
  bool CodeBuffer::finalize_stubs() {
    if (_finalize_stubs && !pd_finalize_stubs()) {

*** 1060,11 ***
      iter.print();
    }
  }
  
  void CodeBuffer::print() {
!   tty->print_cr("CodeBuffer:");
    for (int n = 0; n < (int)SECT_LIMIT; n++) {
      // print each section
      CodeSection* cs = code_section(n);
      cs->print(code_section_name(n));
    }
--- 1067,18 ---
      iter.print();
    }
  }
  
  void CodeBuffer::print() {
! #if 0
+   if (this == nullptr) { // gcc complains 'nonnull' argument 'this' compared to NULL 
+     tty->print_cr("null CodeBuffer pointer");
+     return;
+   }
+ #endif
+ 
+   tty->print_cr("CodeBuffer:%s", name());
    for (int n = 0; n < (int)SECT_LIMIT; n++) {
      // print each section
      CodeSection* cs = code_section(n);
      cs->print(code_section_name(n));
    }
< prev index next >