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