< prev index next >

src/hotspot/share/compiler/compilationPolicy.cpp

Print this page
*** 922,11 ***
      if ((bci != InvocationEntryBci && !can_be_osr_compiled(mh, level))) {
        if (level == CompLevel_full_optimization && can_be_osr_compiled(mh, CompLevel_simple)) {
          nmethod* osr_nm = mh->lookup_osr_nmethod_for(bci, CompLevel_simple, false);
          if (osr_nm != nullptr && osr_nm->comp_level() > CompLevel_simple) {
            // Invalidate the existing OSR nmethod so that a compile at CompLevel_simple is permitted.
!           osr_nm->make_not_entrant("OSR invalidation for compiling with C1");
          }
          compile(mh, bci, CompLevel_simple, THREAD);
        }
        return;
      }
--- 922,11 ---
      if ((bci != InvocationEntryBci && !can_be_osr_compiled(mh, level))) {
        if (level == CompLevel_full_optimization && can_be_osr_compiled(mh, CompLevel_simple)) {
          nmethod* osr_nm = mh->lookup_osr_nmethod_for(bci, CompLevel_simple, false);
          if (osr_nm != nullptr && osr_nm->comp_level() > CompLevel_simple) {
            // Invalidate the existing OSR nmethod so that a compile at CompLevel_simple is permitted.
!           osr_nm->make_not_entrant(nmethod::InvalidationReason::OSR_INVALIDATION_FOR_COMPILING_WITH_C1);
          }
          compile(mh, bci, CompLevel_simple, THREAD);
        }
        return;
      }

*** 1514,11 ***
            if (make_not_entrant) {
              if (PrintTieredEvents) {
                int osr_bci = nm->is_osr_method() ? nm->osr_entry_bci() : InvocationEntryBci;
                print_event(MAKE_NOT_ENTRANT, mh(), mh(), osr_bci, level);
              }
!             nm->make_not_entrant("OSR invalidation, back branch");
            }
          }
          // Fix up next_level if necessary to avoid deopts
          if (next_level == CompLevel_limited_profile && max_osr_level == CompLevel_full_profile) {
            next_level = CompLevel_full_profile;
--- 1514,11 ---
            if (make_not_entrant) {
              if (PrintTieredEvents) {
                int osr_bci = nm->is_osr_method() ? nm->osr_entry_bci() : InvocationEntryBci;
                print_event(MAKE_NOT_ENTRANT, mh(), mh(), osr_bci, level);
              }
!             nm->make_not_entrant(nmethod::InvalidationReason::OSR_INVALIDATION_BACK_BRANCH);
            }
          }
          // Fix up next_level if necessary to avoid deopts
          if (next_level == CompLevel_limited_profile && max_osr_level == CompLevel_full_profile) {
            next_level = CompLevel_full_profile;
< prev index next >