432 case Bytecodes::_dload:
433 case Bytecodes::_aload:
434 case Bytecodes::_istore:
435 case Bytecodes::_lstore:
436 case Bytecodes::_fstore:
437 case Bytecodes::_dstore:
438 case Bytecodes::_astore:
439 st->print_cr(" #%d", get_index_special());
440 break;
441
442 case Bytecodes::_iinc:
443 { int index = get_index_special();
444 jint offset = is_wide() ? get_short(): get_byte();
445 st->print_cr(" #%d " INT32_FORMAT, index, offset);
446 }
447 break;
448
449 case Bytecodes::_newarray: {
450 BasicType atype = (BasicType)get_index_u1();
451 const char* str = type2name(atype);
452 if (str == NULL || atype == T_OBJECT || atype == T_ARRAY) {
453 assert(false, "Unidentified basic type");
454 }
455 st->print_cr(" %s", str);
456 }
457 break;
458 case Bytecodes::_anewarray: {
459 int klass_index = get_index_u2();
460 ConstantPool* constants = method()->constants();
461 Symbol* name = constants->klass_name_at(klass_index);
462 st->print_cr(" %s ", name->as_C_string());
463 }
464 break;
465 case Bytecodes::_multianewarray: {
466 int klass_index = get_index_u2();
467 int nof_dims = get_index_u1();
468 ConstantPool* constants = method()->constants();
469 Symbol* name = constants->klass_name_at(klass_index);
470 st->print_cr(" %s %d", name->as_C_string(), nof_dims);
471 }
472 break;
527 jint* key = NEW_RESOURCE_ARRAY(jint, len);
528 jint* dest = NEW_RESOURCE_ARRAY(jint, len);
529 for (int i = 0; i < len; i++) {
530 key [i] = get_int();
531 dest[i] = bci + get_int();
532 };
533 st->print(" %d %d ", default_dest, len);
534 const char *comma = "";
535 for (int ll = 0; ll < len; ll++) {
536 st->print("%s " INT32_FORMAT ":" INT32_FORMAT, comma, key[ll], dest[ll]);
537 comma = ",";
538 }
539 st->cr();
540 }
541 break;
542
543 case Bytecodes::_putstatic:
544 case Bytecodes::_getstatic:
545 case Bytecodes::_putfield:
546 case Bytecodes::_getfield:
547 print_field_or_method(get_index_u2_cpcache(), st);
548 break;
549
550 case Bytecodes::_invokevirtual:
551 case Bytecodes::_invokespecial:
552 case Bytecodes::_invokestatic:
553 print_field_or_method(get_index_u2_cpcache(), st);
554 break;
555
556 case Bytecodes::_invokeinterface:
557 { int i = get_index_u2_cpcache();
558 int n = get_index_u1();
559 get_byte(); // ignore zero byte
560 print_field_or_method(i, st);
561 }
562 break;
563
564 case Bytecodes::_invokedynamic:
565 print_field_or_method(get_index_u4(), st);
566 break;
567
568 case Bytecodes::_new:
569 case Bytecodes::_checkcast:
570 case Bytecodes::_instanceof:
571 { int i = get_index_u2();
572 ConstantPool* constants = method()->constants();
573 Symbol* name = constants->klass_name_at(i);
574 st->print_cr(" %d <%s>", i, name->as_C_string());
575 }
576 break;
577
578 case Bytecodes::_wide:
579 // length is zero not one, but printed with no more info.
580 break;
581
582 default:
583 ShouldNotReachHere();
584 break;
585 }
586 }
587
588
589 void BytecodePrinter::bytecode_epilog(int bci, outputStream* st) {
590 MethodData* mdo = method()->method_data();
|
432 case Bytecodes::_dload:
433 case Bytecodes::_aload:
434 case Bytecodes::_istore:
435 case Bytecodes::_lstore:
436 case Bytecodes::_fstore:
437 case Bytecodes::_dstore:
438 case Bytecodes::_astore:
439 st->print_cr(" #%d", get_index_special());
440 break;
441
442 case Bytecodes::_iinc:
443 { int index = get_index_special();
444 jint offset = is_wide() ? get_short(): get_byte();
445 st->print_cr(" #%d " INT32_FORMAT, index, offset);
446 }
447 break;
448
449 case Bytecodes::_newarray: {
450 BasicType atype = (BasicType)get_index_u1();
451 const char* str = type2name(atype);
452 if (str == NULL || atype == T_OBJECT || atype == T_ARRAY || atype == T_VALUETYPE) {
453 assert(false, "Unidentified basic type");
454 }
455 st->print_cr(" %s", str);
456 }
457 break;
458 case Bytecodes::_anewarray: {
459 int klass_index = get_index_u2();
460 ConstantPool* constants = method()->constants();
461 Symbol* name = constants->klass_name_at(klass_index);
462 st->print_cr(" %s ", name->as_C_string());
463 }
464 break;
465 case Bytecodes::_multianewarray: {
466 int klass_index = get_index_u2();
467 int nof_dims = get_index_u1();
468 ConstantPool* constants = method()->constants();
469 Symbol* name = constants->klass_name_at(klass_index);
470 st->print_cr(" %s %d", name->as_C_string(), nof_dims);
471 }
472 break;
527 jint* key = NEW_RESOURCE_ARRAY(jint, len);
528 jint* dest = NEW_RESOURCE_ARRAY(jint, len);
529 for (int i = 0; i < len; i++) {
530 key [i] = get_int();
531 dest[i] = bci + get_int();
532 };
533 st->print(" %d %d ", default_dest, len);
534 const char *comma = "";
535 for (int ll = 0; ll < len; ll++) {
536 st->print("%s " INT32_FORMAT ":" INT32_FORMAT, comma, key[ll], dest[ll]);
537 comma = ",";
538 }
539 st->cr();
540 }
541 break;
542
543 case Bytecodes::_putstatic:
544 case Bytecodes::_getstatic:
545 case Bytecodes::_putfield:
546 case Bytecodes::_getfield:
547 case Bytecodes::_withfield:
548 print_field_or_method(get_index_u2_cpcache(), st);
549 break;
550
551 case Bytecodes::_invokevirtual:
552 case Bytecodes::_invokespecial:
553 case Bytecodes::_invokestatic:
554 print_field_or_method(get_index_u2_cpcache(), st);
555 break;
556
557 case Bytecodes::_invokeinterface:
558 { int i = get_index_u2_cpcache();
559 int n = get_index_u1();
560 get_byte(); // ignore zero byte
561 print_field_or_method(i, st);
562 }
563 break;
564
565 case Bytecodes::_invokedynamic:
566 print_field_or_method(get_index_u4(), st);
567 break;
568
569 case Bytecodes::_new:
570 case Bytecodes::_checkcast:
571 case Bytecodes::_instanceof:
572 case Bytecodes::_defaultvalue:
573 { int i = get_index_u2();
574 ConstantPool* constants = method()->constants();
575 Symbol* name = constants->klass_name_at(i);
576 st->print_cr(" %d <%s>", i, name->as_C_string());
577 }
578 break;
579
580 case Bytecodes::_wide:
581 // length is zero not one, but printed with no more info.
582 break;
583
584 default:
585 ShouldNotReachHere();
586 break;
587 }
588 }
589
590
591 void BytecodePrinter::bytecode_epilog(int bci, outputStream* st) {
592 MethodData* mdo = method()->method_data();
|