8219214: Infinite Loop in CodeSection::dump()
authorlucy
Wed, 06 Mar 2019 12:14:47 +0100
changeset 54010 17fb726e6d8e
parent 54009 13acb4339895
child 54011 21ea4076a275
child 57244 a535e674d50d
8219214: Infinite Loop in CodeSection::dump() Reviewed-by: kvn, thartmann
src/hotspot/share/asm/codeBuffer.cpp
src/hotspot/share/asm/codeBuffer.hpp
--- a/src/hotspot/share/asm/codeBuffer.cpp	Wed Mar 06 11:15:16 2019 +0100
+++ b/src/hotspot/share/asm/codeBuffer.cpp	Wed Mar 06 12:14:47 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1029,26 +1029,10 @@
 
 #ifndef PRODUCT
 
-void CodeSection::dump() {
-  address ptr = start();
-  for (csize_t step; ptr < end(); ptr += step) {
-    step = end() - ptr;
-    if (step > jintSize * 4)  step = jintSize * 4;
-    tty->print(INTPTR_FORMAT ": ", p2i(ptr));
-    while (step > 0) {
-      tty->print(" " PTR32_FORMAT, *(jint*)ptr);
-      ptr += jintSize;
-    }
-    tty->cr();
-  }
-}
-
-
 void CodeSection::decode() {
   Disassembler::decode(start(), end());
 }
 
-
 void CodeBuffer::block_comment(intptr_t offset, const char * comment) {
   _code_strings.add_comment(offset, comment);
 }
@@ -1205,26 +1189,6 @@
   _decode_begin = insts_end();
 }
 
-
-void CodeBuffer::skip_decode() {
-  _decode_begin = insts_end();
-}
-
-
-void CodeBuffer::decode_all() {
-  ttyLocker ttyl;
-  for (int n = 0; n < (int)SECT_LIMIT; n++) {
-    // dump contents of each section
-    CodeSection* cs = code_section(n);
-    tty->print_cr("! %s:", code_section_name(n));
-    if (cs != consts())
-      cs->decode();
-    else
-      cs->dump();
-  }
-}
-
-
 void CodeSection::print(const char* name) {
   csize_t locs_size = locs_end() - locs_start();
   tty->print_cr(" %7s.code = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d)%s",
--- a/src/hotspot/share/asm/codeBuffer.hpp	Wed Mar 06 11:15:16 2019 +0100
+++ b/src/hotspot/share/asm/codeBuffer.hpp	Wed Mar 06 12:14:47 2019 +0100
@@ -240,7 +240,6 @@
 
 #ifndef PRODUCT
   void decode();
-  void dump();
   void print(const char* name);
 #endif //PRODUCT
 };
@@ -649,8 +648,6 @@
   // Printing / Decoding
   // decodes from decode_begin() to code_end() and sets decode_begin to end
   void    decode();
-  void    decode_all();         // decodes all the code
-  void    skip_decode();        // sets decode_begin to code_end();
   void    print();
 #endif