Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8265915

adjust state_unloading_cycle compuation order in nmethod::is_unloading

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P5
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 17
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b22
    • CPU:
      generic
    • OS:
      generic

      Description

      Move state_unloading_cycle computation after state_is_unloading checking in nmethod::is_unloading(). Avoiding useless state_unloading_cycle computation when state_is_unloading is true.

        uint8_t state = RawAccess<MO_RELAXED>::load(&_is_unloading_state);
        bool state_is_unloading = IsUnloadingState::is_unloading(state);
        uint8_t state_unloading_cycle = IsUnloadingState::unloading_cycle(state); // compute early, useless if stat_is_unloading is true.
        if (state_is_unloading) {
          return true;
        }
        uint8_t current_cycle = CodeCache::unloading_cycle();
        if (state_unloading_cycle == current_cycle) {
          return false;
        }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hshi Hui Shi
              Reporter:
              hshi Hui Shi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: