I think there should be plans to simplify the handling of references. Back when the only choices were compressed or not, OMR_GC_COMPRESSED_POINTERS was a reasonable flag. We've since added OMR_GC_FULL_POINTERS and OMR_OVERRIDE_COMPRESS_OBJECT_REFERENCES and, in my opinion, it's tough to juggle all the combinations in one's head. I think it would be clearer if there was one macro, say, OMR_GC_POINTER_MODE, which would be configured as one of the following:
* `OMR_GC_POINTER_MODE_FULL` - no compression (the only choice for 32-bit environments)
* `OMR_GC_POINTER_MODE_COMPRESSED` - compressed pointers (what `OMR_GC_COMPRESSED_POINTERS` used to mean)
* `OMR_GC_POINTER_MODE_MIXED_STATIC` - both compressed and non-compressed references supported by compiling certain code twice
* `OMR_GC_POINTER_MODE_MIXED_DYNAMIC` - both compressed and non-compressed references supported via dynamic runtime tests
Going with Keith's proposal, we would no longer need OMR_MIXED_REFERENCES_MODE_STATIC, since we could work with OMR_GC_POINTER_MODE=OMR_GC_POINTER_MODE_MIXED_STATIC. We could also remove OMR_GC_COMPRESSED_POINTERS/OMR_GC_FULL_POINTERS and replace them with OMR_GC_POINTER_MODE=OMR_GC_POINTER_MODE_FULL/OMR_GC_POINTER_MODE_COMPRESSED. However, we'd still need OMR_OVERRIDE_COMPRESS_OBJECT_REFERENCES so that the separate regular/full libraries built in static can have the appropriate pointer mode set.
Related: https://github.com/ibmruntimes/openj9-openjdk-jdk11/issues/361 More mixed builds discussion: https://github.com/eclipse/openj9/issues/8878.
Suggested by @keithc-ca in https://github.com/eclipse/omr/pull/5657:
OMR_GC_POINTER_MODE
OMR_GC_COMPRESSED_POINTERS
OMR_GC_FULL_POINTERS
OMR_MIXED_REFERENCES_MODE_STATIC
OMR_OVERRIDE_COMPRESS_OBJECT_REFERENCES
Going with Keith's proposal, we would no longer need
OMR_MIXED_REFERENCES_MODE_STATIC
, since we could work withOMR_GC_POINTER_MODE=OMR_GC_POINTER_MODE_MIXED_STATIC
. We could also removeOMR_GC_COMPRESSED_POINTERS
/OMR_GC_FULL_POINTERS
and replace them withOMR_GC_POINTER_MODE=OMR_GC_POINTER_MODE_FULL/OMR_GC_POINTER_MODE_COMPRESSED
. However, we'd still needOMR_OVERRIDE_COMPRESS_OBJECT_REFERENCES
so that the separate regular/full libraries built in static can have the appropriate pointer mode set.