< 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"

*** 535,10 ***
--- 536,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);

*** 559,10 ***
--- 563,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);

*** 1001,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()) {
--- 1008,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()) {

*** 1102,13 ***
--- 1109,20 ---
  AsmRemarks::AsmRemarks() : _remarks(new AsmRemarkCollection()) {
    assert(_remarks != nullptr, "Allocation failure!");
  }
  
  AsmRemarks::~AsmRemarks() {
+   if (_remarks != nullptr) {
+     clear();
+   }
    assert(_remarks == nullptr, "Must 'clear()' before deleting!");
  }
  
+ void AsmRemarks::init(AsmRemarks& asm_remarks) {
+   asm_remarks._remarks = new AsmRemarkCollection();
+ }
+ 
  const char* AsmRemarks::insert(uint offset, const char* remstr) {
    precond(remstr != nullptr);
    return _remarks->insert(offset, remstr);
  }
  

*** 1154,13 ***
--- 1168,20 ---
  DbgStrings::DbgStrings() : _strings(new DbgStringCollection()) {
    assert(_strings != nullptr, "Allocation failure!");
  }
  
  DbgStrings::~DbgStrings() {
+   if (_strings != nullptr) {
+     clear();
+   }
    assert(_strings == nullptr, "Must 'clear()' before deleting!");
  }
  
+ void DbgStrings::init(DbgStrings& dbg_strings) {
+   dbg_strings._strings = new DbgStringCollection();
+ }
+ 
  const char* DbgStrings::insert(const char* dbgstr) {
    const char* str = _strings->lookup(dbgstr);
    return str != nullptr ? str : _strings->insert(dbgstr);
  }
  
< prev index next >