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

Simplify JavaThread::thread_state definition

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 13
    • Fix Version/s: 13
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b07

      Description

      Currently defined as:


      src/hotspot/share/runtime/thread.inline.hpp:

      #if defined(PPC64) || defined (AARCH64)
      inline JavaThreadState JavaThread::thread_state() const {
        return (JavaThreadState) OrderAccess::load_acquire((volatile jint*)&_thread_state);
      }

      inline void JavaThread::set_thread_state(JavaThreadState s) {
        OrderAccess::release_store((volatile jint*)&_thread_state, (jint)s);
      }
      #endif

      ...which means it is compiled differently on AArch64 and PPC64, which is the source of multiple build failures going unnoticed when building x86_64 only. It would be easier to simplify this declaration.

      For example, move the #if into the method body:
        http://cr.openjdk.java.net/~shade/8218151/webrev.01/ (this builds fine on x86_64, aarch64, ppc64)

      Alternatively, move the definition to thread.hpp.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              shade Aleksey Shipilev
              Reporter:
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: