src/share/vm/compiler/disassembler.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/compiler

src/share/vm/compiler/disassembler.cpp

Print this page
rev 6626 : 8054292: code comments leak in fastdebug builds
Summary: Added deallocation to destructor; hardened interface against misuse
Reviewed-by: kvn


 228         if (bucket_count != 0) {
 229           st->bol();
 230           st->print_cr("%3.1f%% [%d]", bucket_count*100.0/total_ticks(), bucket_count);
 231         }
 232       }
 233     }
 234     // follow each complete insn by a nice newline
 235     st->cr();
 236   }
 237 
 238   address handle_event(const char* event, address arg);
 239 
 240   outputStream* output() { return _output; }
 241   address cur_insn() { return _cur_insn; }
 242   int total_ticks() { return _total_ticks; }
 243   void set_total_ticks(int n) { _total_ticks = n; }
 244   const char* options() { return _option_buf; }
 245 };
 246 
 247 decode_env::decode_env(CodeBlob* code, outputStream* output, CodeStrings c) {
 248   memset(this, 0, sizeof(*this));
 249   _output = output ? output : tty;
 250   _code = code;
 251   if (code != NULL && code->is_nmethod())
 252     _nm = (nmethod*) code;
 253   _strings.assign(c);
 254 
 255   // by default, output pc but not bytes:
 256   _print_pc       = true;
 257   _print_bytes    = false;
 258   _bytes_per_line = Disassembler::pd_instruction_alignment();
 259 
 260   // parse the global option string:
 261   collect_options(Disassembler::pd_cpu_opts());
 262   collect_options(PrintAssemblyOptions);
 263 
 264   if (strstr(options(), "hsdis-")) {
 265     if (strstr(options(), "hsdis-print-raw"))
 266       _print_raw = (strstr(options(), "xml") ? 2 : 1);
 267     if (strstr(options(), "hsdis-print-pc"))
 268       _print_pc = !_print_pc;
 269     if (strstr(options(), "hsdis-print-bytes"))
 270       _print_bytes = !_print_bytes;
 271   }
 272   if (strstr(options(), "help")) {
 273     tty->print_cr("PrintAssemblyOptions help:");




 228         if (bucket_count != 0) {
 229           st->bol();
 230           st->print_cr("%3.1f%% [%d]", bucket_count*100.0/total_ticks(), bucket_count);
 231         }
 232       }
 233     }
 234     // follow each complete insn by a nice newline
 235     st->cr();
 236   }
 237 
 238   address handle_event(const char* event, address arg);
 239 
 240   outputStream* output() { return _output; }
 241   address cur_insn() { return _cur_insn; }
 242   int total_ticks() { return _total_ticks; }
 243   void set_total_ticks(int n) { _total_ticks = n; }
 244   const char* options() { return _option_buf; }
 245 };
 246 
 247 decode_env::decode_env(CodeBlob* code, outputStream* output, CodeStrings c) {
 248   memset(this, 0, sizeof(*this)); // Beware, this zeroes bits of fields.
 249   _output = output ? output : tty;
 250   _code = code;
 251   if (code != NULL && code->is_nmethod())
 252     _nm = (nmethod*) code;
 253   _strings.copy(c);
 254 
 255   // by default, output pc but not bytes:
 256   _print_pc       = true;
 257   _print_bytes    = false;
 258   _bytes_per_line = Disassembler::pd_instruction_alignment();
 259 
 260   // parse the global option string:
 261   collect_options(Disassembler::pd_cpu_opts());
 262   collect_options(PrintAssemblyOptions);
 263 
 264   if (strstr(options(), "hsdis-")) {
 265     if (strstr(options(), "hsdis-print-raw"))
 266       _print_raw = (strstr(options(), "xml") ? 2 : 1);
 267     if (strstr(options(), "hsdis-print-pc"))
 268       _print_pc = !_print_pc;
 269     if (strstr(options(), "hsdis-print-bytes"))
 270       _print_bytes = !_print_bytes;
 271   }
 272   if (strstr(options(), "help")) {
 273     tty->print_cr("PrintAssemblyOptions help:");


src/share/vm/compiler/disassembler.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File