607 case Bytecodes::_invokespecial:
608 case Bytecodes::_invokestatic:
609 case Bytecodes::_invokeinterface:
610 case Bytecodes::_invokedynamic:
611 case Bytecodes::_newarray:
612 case Bytecodes::_anewarray:
613 case Bytecodes::_checkcast:
614 case Bytecodes::_arraylength:
615 case Bytecodes::_instanceof:
616 case Bytecodes::_athrow:
617 case Bytecodes::_areturn:
618 case Bytecodes::_monitorenter:
619 case Bytecodes::_monitorexit:
620 case Bytecodes::_ifnull:
621 case Bytecodes::_ifnonnull:
622 case Bytecodes::_multianewarray:
623 case Bytecodes::_lookupswitch:
624 // These bytecodes have no effect on the method's locals.
625 break;
626
627 case Bytecodes::_return:
628 if (instruction->method()->intrinsic_id() == vmIntrinsics::_Object_init) {
629 // return from Object.init implicitly registers a finalizer
630 // for the receiver if needed, so keep it alive.
631 load_one(0);
632 }
633 break;
634
635
636 case Bytecodes::_lload:
637 case Bytecodes::_dload:
638 load_two(instruction->get_index());
639 break;
640
641 case Bytecodes::_lload_0:
642 case Bytecodes::_dload_0:
643 load_two(0);
644 break;
645
646 case Bytecodes::_lload_1:
647 case Bytecodes::_dload_1:
648 load_two(1);
649 break;
650
651 case Bytecodes::_lload_2:
652 case Bytecodes::_dload_2:
653 load_two(2);
654 break;
655
|
607 case Bytecodes::_invokespecial:
608 case Bytecodes::_invokestatic:
609 case Bytecodes::_invokeinterface:
610 case Bytecodes::_invokedynamic:
611 case Bytecodes::_newarray:
612 case Bytecodes::_anewarray:
613 case Bytecodes::_checkcast:
614 case Bytecodes::_arraylength:
615 case Bytecodes::_instanceof:
616 case Bytecodes::_athrow:
617 case Bytecodes::_areturn:
618 case Bytecodes::_monitorenter:
619 case Bytecodes::_monitorexit:
620 case Bytecodes::_ifnull:
621 case Bytecodes::_ifnonnull:
622 case Bytecodes::_multianewarray:
623 case Bytecodes::_lookupswitch:
624 // These bytecodes have no effect on the method's locals.
625 break;
626
627 case Bytecodes::_return: {
628 ciMethod* method = instruction->method();
629 ciInstanceKlass* holder = method->holder();
630 const bool abstract_klass = holder->is_abstract();
631 const bool concrete_value_klass = !abstract_klass && holder->is_inlinetype();
632 if (method->intrinsic_id() == vmIntrinsics::_Object_init ||
633 (method->is_object_constructor() && (concrete_value_klass || abstract_klass))) {
634 // Returning from Object.<init> implicitly registers a finalizer for the receiver if needed, to keep it alive.
635 // Value class constructors update the scalarized receiver. We need to keep it live so that we can find it after
636 // (chained) constructor calls and propagate updates to the caller. If the holder of the constructor is abstract,
637 // we do not know if the constructor was called on a value class or not. We therefore keep the receiver of all
638 // abstract constructors live.
639 load_one(0);
640 }
641 break;
642 }
643 case Bytecodes::_lload:
644 case Bytecodes::_dload:
645 load_two(instruction->get_index());
646 break;
647
648 case Bytecodes::_lload_0:
649 case Bytecodes::_dload_0:
650 load_two(0);
651 break;
652
653 case Bytecodes::_lload_1:
654 case Bytecodes::_dload_1:
655 load_two(1);
656 break;
657
658 case Bytecodes::_lload_2:
659 case Bytecodes::_dload_2:
660 load_two(2);
661 break;
662
|