hotspot/src/share/vm/interpreter/bytecodeTracer.cpp
changeset 33604 ad1cd9269bd4
parent 33593 60764a78fa5c
child 35898 ddc274f0052f
equal deleted inserted replaced
33603:450d454670a7 33604:ad1cd9269bd4
   388     st->print_cr(" %d <%s%s%s>", i, name->as_C_string(), sep, signature->as_C_string());
   388     st->print_cr(" %d <%s%s%s>", i, name->as_C_string(), sep, signature->as_C_string());
   389   }
   389   }
   390 }
   390 }
   391 
   391 
   392 
   392 
   393 PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
       
   394 void BytecodePrinter::print_attributes(int bci, outputStream* st) {
   393 void BytecodePrinter::print_attributes(int bci, outputStream* st) {
   395   // Show attributes of pre-rewritten codes
   394   // Show attributes of pre-rewritten codes
   396   Bytecodes::Code code = Bytecodes::java_code(raw_code());
   395   Bytecodes::Code code = Bytecodes::java_code(raw_code());
   397   // If the code doesn't have any fields there's nothing to print.
   396   // If the code doesn't have any fields there's nothing to print.
   398   // note this is ==1 because the tableswitch and lookupswitch are
   397   // note this is ==1 because the tableswitch and lookupswitch are
   510         for (int i = 0; i < len; i++) {
   509         for (int i = 0; i < len; i++) {
   511           dest[i] = bci + get_int();
   510           dest[i] = bci + get_int();
   512         }
   511         }
   513         st->print(" %d " INT32_FORMAT " " INT32_FORMAT " ",
   512         st->print(" %d " INT32_FORMAT " " INT32_FORMAT " ",
   514                       default_dest, lo, hi);
   513                       default_dest, lo, hi);
   515         int first = true;
   514         const char *comma = "";
   516         for (int ll = lo; ll <= hi; ll++, first = false)  {
   515         for (int ll = lo; ll <= hi; ll++) {
   517           int idx = ll - lo;
   516           int idx = ll - lo;
   518           const char *format = first ? " %d:" INT32_FORMAT " (delta: %d)" :
   517           st->print("%s %d:" INT32_FORMAT " (delta: %d)", comma, ll, dest[idx], dest[idx]-bci);
   519                                        ", %d:" INT32_FORMAT " (delta: %d)";
   518           comma = ",";
   520 PRAGMA_DIAG_PUSH
       
   521 PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
       
   522           st->print(format, ll, dest[idx], dest[idx]-bci);
       
   523 PRAGMA_DIAG_POP
       
   524         }
   519         }
   525         st->cr();
   520         st->cr();
   526       }
   521       }
   527       break;
   522       break;
   528     case Bytecodes::_lookupswitch:
   523     case Bytecodes::_lookupswitch:
   534         for (int i = 0; i < len; i++) {
   529         for (int i = 0; i < len; i++) {
   535           key [i] = get_int();
   530           key [i] = get_int();
   536           dest[i] = bci + get_int();
   531           dest[i] = bci + get_int();
   537         };
   532         };
   538         st->print(" %d %d ", default_dest, len);
   533         st->print(" %d %d ", default_dest, len);
   539         bool first = true;
   534         const char *comma = "";
   540         for (int ll = 0; ll < len; ll++, first = false)  {
   535         for (int ll = 0; ll < len; ll++)  {
   541           const char *format = first ? " " INT32_FORMAT ":" INT32_FORMAT :
   536           st->print("%s " INT32_FORMAT ":" INT32_FORMAT, comma, key[ll], dest[ll]);
   542                                        ", " INT32_FORMAT ":" INT32_FORMAT ;
   537           comma = ",";
   543 PRAGMA_DIAG_PUSH
       
   544 PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
       
   545           st->print(format, key[ll], dest[ll]);
       
   546 PRAGMA_DIAG_POP
       
   547         }
   538         }
   548         st->cr();
   539         st->cr();
   549       }
   540       }
   550       break;
   541       break;
   551 
   542