< prev index next >

src/hotspot/share/compiler/disassembler.cpp

Print this page




 344         newline = true;
 345       }
 346 
 347       int index = line - 1; // 1-based line number -> 0-based index.
 348       if (index >= _cached_src_lines->length()) {
 349         // This could happen if source file is mismatched.
 350       } else {
 351         const char* source_line = _cached_src_lines->at(index);
 352         if (newline) {
 353           st->cr();
 354         }
 355         st->move_to(COMMENT_COLUMN);
 356         st->print(";;%5d: %s", line, source_line);
 357         newline = true;
 358       }
 359     }
 360   }
 361 }
 362 
 363 decode_env::decode_env(CodeBlob* code, outputStream* output, CodeStrings c,
 364                        ptrdiff_t offset) {
 365   memset(this, 0, sizeof(*this)); // Beware, this zeroes bits of fields.




 366   _output = output ? output : tty;
 367   _code = code;
 368   if (code != NULL && code->is_nmethod())
 369     _nm = (nmethod*) code;
 370   _strings.copy(c);
 371   _offset = offset;
 372 
 373   // by default, output pc but not bytes:
 374   _print_pc       = true;
 375   _print_bytes    = false;
 376   _bytes_per_line = Disassembler::pd_instruction_alignment();
 377   _print_file_name= true;
 378 
 379   // parse the global option string:
 380   collect_options(Disassembler::pd_cpu_opts());
 381   collect_options(PrintAssemblyOptions);
 382 
 383   if (strstr(options(), "hsdis-")) {
 384     if (strstr(options(), "hsdis-print-raw"))
 385       _print_raw = (strstr(options(), "xml") ? 2 : 1);




 344         newline = true;
 345       }
 346 
 347       int index = line - 1; // 1-based line number -> 0-based index.
 348       if (index >= _cached_src_lines->length()) {
 349         // This could happen if source file is mismatched.
 350       } else {
 351         const char* source_line = _cached_src_lines->at(index);
 352         if (newline) {
 353           st->cr();
 354         }
 355         st->move_to(COMMENT_COLUMN);
 356         st->print(";;%5d: %s", line, source_line);
 357         newline = true;
 358       }
 359     }
 360   }
 361 }
 362 
 363 decode_env::decode_env(CodeBlob* code, outputStream* output, CodeStrings c,
 364                        ptrdiff_t offset) : _nm(NULL),
 365                                            _start(NULL),
 366                                            _end(NULL),
 367                                            _option_buf(),
 368                                            _print_raw('\0'),
 369                                            _cur_insn(NULL) {
 370   _output = output ? output : tty;
 371   _code = code;
 372   if (code != NULL && code->is_nmethod())
 373     _nm = (nmethod*) code;
 374   _strings.copy(c);
 375   _offset = offset;
 376 
 377   // by default, output pc but not bytes:
 378   _print_pc       = true;
 379   _print_bytes    = false;
 380   _bytes_per_line = Disassembler::pd_instruction_alignment();
 381   _print_file_name= true;
 382 
 383   // parse the global option string:
 384   collect_options(Disassembler::pd_cpu_opts());
 385   collect_options(PrintAssemblyOptions);
 386 
 387   if (strstr(options(), "hsdis-")) {
 388     if (strstr(options(), "hsdis-print-raw"))
 389       _print_raw = (strstr(options(), "xml") ? 2 : 1);


< prev index next >