Skip to content

Expand bytecode offset variables to 32bit - #6999

Merged
vijaysun-omr merged 1 commit into
eclipse-omr:masterfrom
klangman:16bit-bc-offset-fix
May 24, 2023
Merged

Expand bytecode offset variables to 32bit#6999
vijaysun-omr merged 1 commit into
eclipse-omr:masterfrom
klangman:16bit-bc-offset-fix

Conversation

@klangman

Copy link
Copy Markdown
Contributor

A user experienced a compile time crash in setHandlerInfoWithOutBCInfo() because a bytecode index to a catch handler is above the 2^16th limit that normally applies for Java methods. This limit can be exceeded in rare cases after the JVM expands the method size on load. A good example of this would be when the VM inlines a "jsr" bytecode. Because the handler index is larger then 2^16th the offset is truncated when it is placed into the 16bit integer that we were using to record the offset. This fix will expand the size of variables used to hold bytecode offsets to be 32bits.

@klangman

Copy link
Copy Markdown
Contributor Author

This is the OMR side change that supports OpenJ9 changes to address the reported issue described above. I tested both the combined changes and the OMR changes alone and both passed. It's possible that the OpenJ9 changes would also pass independent of the OMR changes, but I will wait for these changes to merge before submitting the OpenJ9 changes.

@klangman

klangman commented May 23, 2023

Copy link
Copy Markdown
Contributor Author

Oops. My testing did not have asserts enabled. I will fix that test failure.

A user experienced a compile time crash in setHandlerInfoWithOutBCInfo()
because a bytecode index to a catch handler is above the 2^16th limit
that normally applies for Java methods. This limit can be exceeded in
rare cases after the JVM expands the method size on load. A good example
of this would be when the VM inlines a "jsr" bytecode. Because the
handler index is larger then 2^16th the offset is truncated when it is
placed into the 16bit integer that we were using to record the offset.
This fix will expand the size of variables used to hold bytecode offsets
to be 32bits.

Signed-off-by: Kevin Langman <langman@ca.ibm.com>
@klangman
klangman force-pushed the 16bit-bc-offset-fix branch from af649ad to d5be906 Compare May 23, 2023 21:15
@vijaysun-omr

Copy link
Copy Markdown
Contributor

jenkins build all

@vijaysun-omr

vijaysun-omr commented May 24, 2023

Copy link
Copy Markdown
Contributor

jenkins build riscv

1 similar comment
@vijaysun-omr

Copy link
Copy Markdown
Contributor

jenkins build riscv

@jdekonin

Copy link
Copy Markdown

fyi your riscv failure above is not your code. I'm adding compile:riscv64:cross to 2 systems that will be capable of riscv cross compiles but this isn't working yet.

@vijaysun-omr

Copy link
Copy Markdown
Contributor

Merging this since all other checks have passed and the change itself looks like a valid one to me.

@vijaysun-omr
vijaysun-omr merged commit 31f5d0c into eclipse-omr:master May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants