Details
-
Enhancement
-
Status: Resolved
-
P4
-
Resolution: Fixed
-
17
-
b06
-
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.
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.