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

move some fields of SafePointNode from public to protected

    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:
      b06
    • CPU:
      generic

      Description

      One odd thing is SafePointNode::jvms() declares virtual but has never been overridden. It seems unnecessary.

      The second odd thing is that the member variable _jvms is declared 'JVMState* const'. I guess the intention is to protected it. It turned out it did not work out because set_jvms() was added later and casted away its constness. I suspect this behavior isn't defined.
       
      void set_jvms(JVMState* s) {
          *(JVMState**)&_jvms = s; // override const attribute in the accessor
        }

      I think we can hide set_jvms() using protected and open it for only two reasonable friends: JVMState and GraphKit.
      or we simply mark it as a public mutable member function.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              xliu Xin Liu
              Reporter:
              xliu Xin Liu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: