Details
Description
For example, see MM_Constants. Things like:
public static final boolean GENERATE_GC_TRACE = Selected.Constraints.get().generateGCTrace();
block javac compile time folding of anything that depends on GENERATE_GC_TRACE. This in turn, impacts VM_JavaHeader.getObjectHashCode (one important example).
Since we're generating Selected, we should generate it in a way that flattens all of the constants it is trying to export to jikesrvm into "flat" static final booleans instead of generating method calls on final objects that block folding.
Dave, is your concern limited to cases where Jikes RVM tries to realize constants defined in MMTk? Or do you have concerns about the reverse too?
To clarify, some time ago we introduced glue to enable MMTk to be entirely separable, compiled as a standalone jar. My recollection was that we very thoroughly performance tested it.
Much more recently, the code you cite above was introduced. I am not sure whether it was performance tested or if perhaps the assumption was made that since the pattern worked on the other side, it should be fine on this side. As I understand it, this code (MM_Constants) is intended to provide a reciprocal level of modularity.
My point is that we have a real, concrete objective in shipping MMTk as a standalone jar, but its less clear we need to take modularity in the reverse direction to such lengths.
If I've understood things right, then we should be able to fairly aggressively attack the above (fairly simply too). I just want to be sure I understand things right first, though.