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

Templatize JVMFlag boilerplate access methods

    XMLWordPrintable

    Details

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

      Description

      We have a bunch of boilerplate method like:

      JVMFlagAccess::boolAtPut (JVMFlag* f, bool* v, JVMFlagOrigin origin)
      JVMFlagAccess::intAtPut (JVMFlag* f, int* v, JVMFlagOrigin origin)
      JVMFlagAccess::uintAtPut (JVMFlag* f, uint* v, JVMFlagOrigin origin)
      JVMFlagAccess::intxAtPut (JVMFlag* f, intx* v, JVMFlagOrigin origin)
      JVMFlagAccess::uintxAtPut (JVMFlag* f, uintx* v, JVMFlagOrigin origin)
      JVMFlagAccess::uint64_tAtPut(JVMFlag* f, uint64_t* v, JVMFlagOrigin origin)
      JVMFlagAccess::size_tAtPut (JVMFlag* f, size_t* v, JVMFlagOrigin origin)
      JVMFlagAccess::doubleAtPut (JVMFlag* f, double* v, JVMFlagOrigin origin)

      Similarly, we also have 8 different functions: JVMFlag::{set_bool, set_int, set_intx, ...}

      We should replace such patterns with

      template <typename T>
      JVMFlagAccess::set(JVMFlag* f, T* value, JVMFlagOrigin origin)

      This would allow us to templatize the 8x boilerplate functions in writeableFlags.cpp.

      The flag access code in whitebox.cpp can also be improved.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              iklam Ioi Lam
              Reporter:
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: