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