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

(0.44) Evaluate constant byteLenNode of arrayCopyChild #200

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

r30shah
Copy link
Contributor

@r30shah r30shah commented Mar 4, 2024

In case of constant length array copy code, a length of bytes to be copied would be loaded into register in case we need to perform a test to check for destructive region copies and perform destructive array copy. We need to make sure that byteLength node is evaluated before the internal control flow starts. We found an issue where downstream consumer of primitive arraycopy sequnece generator needed byteLenReg and as the constant value was loaded only in case we fail absolute test for forward copy check, we ended up in scenario where it reads a value from array using length which consists of garbage. This commit fixes the issue and in case, we do not know the direction for array copy, it evaluates bytelength node before internal control flow starts.

Port of eclipse-omr/omr#7275 for 0.44

In case of constant length array copy code, a length of bytes to be
copied would be loaded into register in case we need to perform a test
to check for destructive region copies and perform destructive array
copy. We need to make sure that byteLength node is evaluated before the
internal control flow starts. We found an issue where downstream
consumer of primitive arraycopy sequnece generator needed byteLenReg and
as the constant value was loaded only in case we fail absolute test for
forward copy check, we ended up in scenario where it reads a value from
array using length which consists of garbage. This commit fixes the
issue and in case, we do not know the direction for array copy, it
evaluates bytelength node before internal control flow starts.

Signed-off-by: Rahil Shah <rahil@ca.ibm.com>
@r30shah r30shah requested a review from fjeremic as a code owner March 4, 2024 18:23
@pshipton pshipton requested review from hzongaro and removed request for fjeremic March 4, 2024 18:55
@hzongaro hzongaro merged commit 254af5a into eclipse-openj9:v0.44.0-release Mar 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants