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

move some fields of SafePointNode from public to protected

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 17
    • 17
    • hotspot
    • b06
    • generic

      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.

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

              Created:
              Updated:
              Resolved: