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

Simplify JavaThread::thread_state definition

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 13
    • 13
    • hotspot
    • b07

      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.

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

              Created:
              Updated:
              Resolved: