< prev index next >

src/hotspot/share/asm/codeBuffer.cpp

Print this page
*** 1004,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()) {
--- 1004,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()) {

*** 1106,11 ***
    init();
    assert(_remarks != nullptr, "Allocation failure!");
  }
  
  AsmRemarks::~AsmRemarks() {
!   assert(_remarks == nullptr, "Must 'clear()' before deleting!");
  }
  
  void AsmRemarks::init() {
    _remarks = new AsmRemarkCollection();
  }
--- 1106,14 ---
    init();
    assert(_remarks != nullptr, "Allocation failure!");
  }
  
  AsmRemarks::~AsmRemarks() {
!   if (_remarks != nullptr) {
+     clear();
+   }
+   assert(_remarks == nullptr, "must be");
  }
  
  void AsmRemarks::init() {
    _remarks = new AsmRemarkCollection();
  }

*** 1163,11 ***
    init();
    assert(_strings != nullptr, "Allocation failure!");
  }
  
  DbgStrings::~DbgStrings() {
!   assert(_strings == nullptr, "Must 'clear()' before deleting!");
  }
  
  void DbgStrings::init() {
    _strings = new DbgStringCollection();
  }
--- 1166,14 ---
    init();
    assert(_strings != nullptr, "Allocation failure!");
  }
  
  DbgStrings::~DbgStrings() {
!   if (_strings != nullptr) {
+     clear();
+   }
+   assert(_strings == nullptr, "must be");
  }
  
  void DbgStrings::init() {
    _strings = new DbgStringCollection();
  }
< prev index next >