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

Should-be-adjacent vs is-adjacent data API cleanup #21146

Merged

Conversation

amicic
Copy link
Contributor

@amicic amicic commented Feb 19, 2025

In array object model distinguish between APIs:

  • should be adjacent
  • is adjacent

The former is used early when the object is being constructed, and dataAddr is yet to be initialized. API makes a decision based on size in bytes explicitely provided or read from the array heder, and is used to determine if data should be allocated in main heap or offheap.

The latter is used at later points in time (like GC, JNI Critical API) when object is fully initialized. Then the check is about actual dataAddr value (if it points to the end of the header or not). This is faster and simpler check and is preferred, unless dataAddr is not initialized yet.

@amicic amicic force-pushed the should_be_vs_is_adjacent branch from 1dc09c3 to a9c2d19 Compare February 19, 2025 17:41
@amicic amicic changed the title Should be vs is adjacent data API cleanup Should-be-adjacent vs is-adjacent data API cleanup Feb 19, 2025
@amicic amicic requested a review from dmitripivkine February 19, 2025 17:42
In array object model distinguish between APIs:
- should be adjacent
- is adjacent

The former is used early when the object is being constructed, and
dataAddr is yet to be initialized. API makes a decision based on size in
bytes explicitely provided or read from the array heder, and is used to
determine if data should be allocated in main heap or offheap.

The latter is used at later points in time (like GC, JNI Critical API)
when object is fully initialized. Then the check is about actual
dataAddr value (if it points to the end of the header or not). This is
faster and simpler check and is preferred, unless dataAddr is not
initialized yet.

Signed-off-by: Aleksandar Micic <[email protected]>
@amicic amicic force-pushed the should_be_vs_is_adjacent branch from a9c2d19 to 232fde5 Compare February 19, 2025 17:43
@amicic
Copy link
Contributor Author

amicic commented Feb 19, 2025

what is not obvious from the change, the users of is-adjacent (spots that are not replaced to use should-be-adjacent) are:

  • JNI Critical
  • displacement API
  • WOC ref array fixup (which is about to be removed before this is merged)

Hence, there is a small change in behaviour (those spots will do the check based on dataAddr value, rather than the size).

@amicic amicic added the comp:gc label Feb 19, 2025
@dmitripivkine
Copy link
Contributor

jenkins test sanity xlinux jdk21

@dmitripivkine dmitripivkine merged commit 2f77410 into eclipse-openj9:master Feb 20, 2025
6 checks passed
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.

2 participants