src/hotspot/share/compiler/disassembler.cpp
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 55051 fb9758536458
child 58679 9c3209ff7550
--- a/src/hotspot/share/compiler/disassembler.cpp	Thu Oct 17 20:27:44 2019 +0100
+++ b/src/hotspot/share/compiler/disassembler.cpp	Thu Oct 17 20:53:35 2019 +0100
@@ -147,7 +147,10 @@
 
     if (AbstractDisassembler::show_comment()) {
       if ((_nm != NULL) && _nm->has_code_comment(pc0, pc)) {
-        _nm->print_code_comment_on(st, _post_decode_alignment, pc0, pc);
+        _nm->print_code_comment_on
+               (st,
+                _post_decode_alignment ? _post_decode_alignment : COMMENT_COLUMN,
+                pc0, pc);
         // this calls reloc_string_for which calls oop::print_value_on
       }
       print_hook_comments(pc0, _nm != NULL);
@@ -312,56 +315,96 @@
   }
 }
 
-decode_env::decode_env(CodeBuffer* code, outputStream* output) {
-  memset(this, 0, sizeof(*this));
-  _output = output ? output : tty;
-  _codeBlob    = NULL;
-  _codeBuffer  = code;
-  _helpPrinted = false;
+decode_env::decode_env(CodeBuffer* code, outputStream* output) :
+  _output(output ? output : tty),
+  _codeBuffer(code),
+  _codeBlob(NULL),
+  _nm(NULL),
+  _strings(),
+  _start(NULL),
+  _end(NULL),
+  _option_buf(),
+  _print_raw(0),
+  _cur_insn(NULL),
+  _bytes_per_line(0),
+  _pre_decode_alignment(0),
+  _post_decode_alignment(0),
+  _print_file_name(false),
+  _print_help(false),
+  _helpPrinted(false) {
 
+  memset(_option_buf, 0, sizeof(_option_buf));
   process_options(_output);
 }
 
-decode_env::decode_env(CodeBlob* code, outputStream* output, CodeStrings c) {
-   memset(this, 0, sizeof(*this)); // Beware, this zeroes bits of fields.
-   _output = output ? output : tty;
-  _codeBlob    = code;
-  _codeBuffer  = NULL;
-  _helpPrinted = false;
-  if (_codeBlob != NULL && _codeBlob->is_nmethod()) {
-    _nm = (nmethod*) code;
-  }
+decode_env::decode_env(CodeBlob* code, outputStream* output, CodeStrings c) :
+  _output(output ? output : tty),
+  _codeBuffer(NULL),
+  _codeBlob(code),
+  _nm(_codeBlob != NULL && _codeBlob->is_nmethod() ? (nmethod*) code : NULL),
+  _strings(),
+  _start(NULL),
+  _end(NULL),
+  _option_buf(),
+  _print_raw(0),
+  _cur_insn(NULL),
+  _bytes_per_line(0),
+  _pre_decode_alignment(0),
+  _post_decode_alignment(0),
+  _print_file_name(false),
+  _print_help(false),
+  _helpPrinted(false) {
+
+  memset(_option_buf, 0, sizeof(_option_buf));
   _strings.copy(c);
-
   process_options(_output);
 }
 
-decode_env::decode_env(nmethod* code, outputStream* output, CodeStrings c) {
-  memset(this, 0, sizeof(*this)); // Beware, this zeroes bits of fields.
-  _output = output ? output : tty;
-  _codeBlob    = NULL;
-  _codeBuffer  = NULL;
-  _nm          = code;
-  _start       = _nm->code_begin();
-  _end         = _nm->code_end();
-  _helpPrinted = false;
+decode_env::decode_env(nmethod* code, outputStream* output, CodeStrings c) :
+  _output(output ? output : tty),
+  _codeBuffer(NULL),
+  _codeBlob(NULL),
+  _nm(code),
+  _strings(),
+  _start(_nm->code_begin()),
+  _end(_nm->code_end()),
+  _option_buf(),
+  _print_raw(0),
+  _cur_insn(NULL),
+  _bytes_per_line(0),
+  _pre_decode_alignment(0),
+  _post_decode_alignment(0),
+  _print_file_name(false),
+  _print_help(false),
+  _helpPrinted(false) {
+
+  memset(_option_buf, 0, sizeof(_option_buf));
   _strings.copy(c);
-
   process_options(_output);
 }
 
 // Constructor for a 'decode_env' to decode a memory range [start, end)
 // of unknown origin, assuming it contains code.
-decode_env::decode_env(address start, address end, outputStream* output) {
+decode_env::decode_env(address start, address end, outputStream* output) :
+  _output(output ? output : tty),
+  _codeBuffer(NULL),
+  _codeBlob(NULL),
+  _nm(NULL),
+  _strings(),
+  _start(start),
+  _end(end),
+  _option_buf(),
+  _print_raw(0),
+  _cur_insn(NULL),
+  _bytes_per_line(0),
+  _pre_decode_alignment(0),
+  _post_decode_alignment(0),
+  _print_file_name(false),
+  _print_help(false),
+  _helpPrinted(false) {
+
   assert(start < end, "Range must have a positive size, [" PTR_FORMAT ".." PTR_FORMAT ").", p2i(start), p2i(end));
-  memset(this, 0, sizeof(*this));
-  _output = output ? output : tty;
-  _codeBlob    = NULL;
-  _codeBuffer  = NULL;
-  _start       = start;
-  _end         = end;
-  _helpPrinted = false;
-
+  memset(_option_buf, 0, sizeof(_option_buf));
   process_options(_output);
 }