src/share/vm/interpreter/bytecodeTracer.cpp

changeset 2015
083fde3b838e
parent 1957
136b78722a08
child 2314
f95d63e2154a
equal deleted inserted replaced
2004:a528509c992b 2015:083fde3b838e
326 326
327 void BytecodePrinter::print_field_or_method(int orig_i, int i, outputStream* st) { 327 void BytecodePrinter::print_field_or_method(int orig_i, int i, outputStream* st) {
328 constantPoolOop constants = method()->constants(); 328 constantPoolOop constants = method()->constants();
329 constantTag tag = constants->tag_at(i); 329 constantTag tag = constants->tag_at(i);
330 330
331 int nt_index = -1; 331 bool has_klass = true;
332 332
333 switch (tag.value()) { 333 switch (tag.value()) {
334 case JVM_CONSTANT_InterfaceMethodref: 334 case JVM_CONSTANT_InterfaceMethodref:
335 case JVM_CONSTANT_Methodref: 335 case JVM_CONSTANT_Methodref:
336 case JVM_CONSTANT_Fieldref: 336 case JVM_CONSTANT_Fieldref:
337 break;
337 case JVM_CONSTANT_NameAndType: 338 case JVM_CONSTANT_NameAndType:
339 case JVM_CONSTANT_InvokeDynamic:
340 has_klass = false;
338 break; 341 break;
339 default: 342 default:
340 st->print_cr(" bad tag=%d at %d", tag.value(), i); 343 st->print_cr(" bad tag=%d at %d", tag.value(), i);
341 return; 344 return;
342 } 345 }
343 346
344 symbolOop klass = constants->klass_name_at(constants->uncached_klass_ref_index_at(i));
345 symbolOop name = constants->uncached_name_ref_at(i); 347 symbolOop name = constants->uncached_name_ref_at(i);
346 symbolOop signature = constants->uncached_signature_ref_at(i); 348 symbolOop signature = constants->uncached_signature_ref_at(i);
347 const char* sep = (tag.is_field() ? "/" : ""); 349 const char* sep = (tag.is_field() ? "/" : "");
348 st->print_cr(" %d <%s.%s%s%s> ", i, klass->as_C_string(), name->as_C_string(), sep, signature->as_C_string()); 350 if (has_klass) {
351 symbolOop klass = constants->klass_name_at(constants->uncached_klass_ref_index_at(i));
352 st->print_cr(" %d <%s.%s%s%s> ", i, klass->as_C_string(), name->as_C_string(), sep, signature->as_C_string());
353 } else {
354 if (tag.is_invoke_dynamic()) {
355 int bsm = constants->invoke_dynamic_bootstrap_method_ref_index_at(i);
356 st->print(" bsm=%d", bsm);
357 }
358 st->print_cr(" %d <%s%s%s>", i, name->as_C_string(), sep, signature->as_C_string());
359 }
349 } 360 }
350 361
351 362
352 void BytecodePrinter::print_attributes(int bci, outputStream* st) { 363 void BytecodePrinter::print_attributes(int bci, outputStream* st) {
353 // Show attributes of pre-rewritten codes 364 // Show attributes of pre-rewritten codes

mercurial