Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify handling of references (compressed, full, mixed-static, mixed-dynamic) #5695

Open
sharon-wang opened this issue Nov 30, 2020 · 2 comments

Comments

@sharon-wang
Copy link
Contributor

sharon-wang commented Nov 30, 2020

Related: ibmruntimes/openj9-openjdk-jdk11#361
More mixed builds discussion: eclipse-openj9/openj9#8878.

Suggested by @keithc-ca in #5657:

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

Here's a table with all the settings, for reference (based on the implementation in #5657):

Configure Mode OMR_GC_POINTER_MODE OMR_GC_COMPRESSED_POINTERS OMR_GC_FULL_POINTERS OMR_MIXED_REFERENCES_MODE_STATIC OMR_OVERRIDE_COMPRESS_OBJECT_REFERENCES
compressed compressed ON OFF OFF UNDEFINED
full full OFF ON OFF UNDEFINED
mixed-static mixed ON ON ON DEFINED (0 or 1)
mixed-dynamic mixed ON ON OFF UNDEFINED

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.

@sharon-wang
Copy link
Contributor Author

FYI @gacholio

@fjeremic
Copy link
Contributor

fjeremic commented Dec 1, 2020

@amicic @dmitripivkine FYI.

@0xdaryl 0xdaryl added the backlog label Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants