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

Ensure calls to feGetEnv are cached #15194

Merged
merged 1 commit into from
Jun 2, 2022

Conversation

JamesKingdon
Copy link
Contributor

Calls to feGetEnv are usually cached in static variables. There were a few cases where the variables weren't declared static and so more calls to getenv were being made than was necessary. These were mostly fixed in OMR PR eclipse/omr#6545, but I also noticed two cases in OpenJ9 code that are addressed in this PR.

The call in initializeProcessorType is probably not much of a problem as it seems likely that the containing function is only called once per JVM instantiation. I've fixed it for completeness as there's hopefully not much downside and it will make any future code review for missed statics a little easier.

The read of TR_silentEnv in feGetEnv2 itself is hopefully ok for caching too - I couldn't see any reason to read it on every call.

Personal build ok: 29935

Calls to feGetEnv are usually cached in static variables. This
PR catches a few instances that were not.
@0xdaryl
Copy link
Contributor

0xdaryl commented Jun 2, 2022

Jenkins test sanity all jdk17

@0xdaryl 0xdaryl self-assigned this Jun 2, 2022
@0xdaryl 0xdaryl merged commit 6335127 into eclipse-openj9:master Jun 2, 2022
@JamesKingdon JamesKingdon deleted the feGetEnv_caching branch June 3, 2022 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants