726
727 if (action == Deoptimization::Action_make_not_entrant) {
728 if (nm->make_not_entrant()) {
729 if (reason == Deoptimization::Reason_tenured) {
730 MethodData* trap_mdo = Deoptimization::get_method_data(thread, method, true /*create_if_missing*/);
731 if (trap_mdo != NULL) {
732 trap_mdo->inc_tenure_traps();
733 }
734 }
735 }
736 }
737
738 // Deoptimize the caller frame.
739 Deoptimization::deoptimize_frame(thread, caller_frame.id());
740 // Return to the now deoptimized frame.
741 JRT_END
742
743
744 #ifndef DEOPTIMIZE_WHEN_PATCHING
745
746 static Klass* resolve_field_return_klass(methodHandle caller, int bci, TRAPS) {
747 Bytecode_field field_access(caller, bci);
748 // This can be static or non-static field access
749 Bytecodes::Code code = field_access.code();
750
751 // We must load class, initialize class and resolve the field
752 fieldDescriptor result; // initialize class if needed
753 constantPoolHandle constants(THREAD, caller->constants());
754 LinkResolver::resolve_field_access(result, constants, field_access.index(), caller, Bytecodes::java_code(code), CHECK_NULL);
755 return result.field_holder();
756 }
757
758
759 //
760 // This routine patches sites where a class wasn't loaded or
761 // initialized at the time the code was generated. It handles
762 // references to classes, fields and forcing of initialization. Most
763 // of the cases are straightforward and involving simply forcing
764 // resolution of a class, rewriting the instruction stream with the
765 // needed constant and replacing the call in this function with the
766 // patched code. The case for static field is more complicated since
|
726
727 if (action == Deoptimization::Action_make_not_entrant) {
728 if (nm->make_not_entrant()) {
729 if (reason == Deoptimization::Reason_tenured) {
730 MethodData* trap_mdo = Deoptimization::get_method_data(thread, method, true /*create_if_missing*/);
731 if (trap_mdo != NULL) {
732 trap_mdo->inc_tenure_traps();
733 }
734 }
735 }
736 }
737
738 // Deoptimize the caller frame.
739 Deoptimization::deoptimize_frame(thread, caller_frame.id());
740 // Return to the now deoptimized frame.
741 JRT_END
742
743
744 #ifndef DEOPTIMIZE_WHEN_PATCHING
745
746 static Klass* resolve_field_return_klass(const methodHandle& caller, int bci, TRAPS) {
747 Bytecode_field field_access(caller, bci);
748 // This can be static or non-static field access
749 Bytecodes::Code code = field_access.code();
750
751 // We must load class, initialize class and resolve the field
752 fieldDescriptor result; // initialize class if needed
753 constantPoolHandle constants(THREAD, caller->constants());
754 LinkResolver::resolve_field_access(result, constants, field_access.index(), caller, Bytecodes::java_code(code), CHECK_NULL);
755 return result.field_holder();
756 }
757
758
759 //
760 // This routine patches sites where a class wasn't loaded or
761 // initialized at the time the code was generated. It handles
762 // references to classes, fields and forcing of initialization. Most
763 // of the cases are straightforward and involving simply forcing
764 // resolution of a class, rewriting the instruction stream with the
765 // needed constant and replacing the call in this function with the
766 // patched code. The case for static field is more complicated since
|