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

WIP: Prevent VGHM from moving guards #7411

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

klangman
Copy link
Contributor

In some cases the VGHM opt was moving code above a runtime guard allowing a privatized argument load to read past the end of the object bounds. This privatized temp slot was marked collectible causing the GC to assert when the loaded value was not a valid object reference. The issue the assert is reporting would not cause any runtime behaviour issues as the guard would have prevented any of the inlined code from executing and therefore the temp would never have been used, but allowing the invalid load to happen could cause a SEGV if the load offset caused an access passed the end of the heap. This fix simply disables guard motion in this opt to prevent this problem from occurring. It's likely that move HCR guards within the bounds of GC points is fine, but performance testing will be done to insure that the cost of disabling guard motion even for HCR guards has no major performance effect.

In some cases the VGHM opt was moving code above a runtime guard allowing a privatized argument load to read past the end of the object bounds. This privatized temp slot was marked collectible causing the GC to assert when the loaded value was not a valid object reference. The issue the assert is reporting would not cause any runtime behaviour issues as the guard would have prevented any of the inlined code from executing and therefore the temp would never have been used, but allowing the invalid load to happen could cause a SEGV if the load offset caused an access passed the end of the heap. This fix simply disables guard motion in this opt to prevent this problem from occurring. It's likely that move HCR guards within the bounds of GC points is fine, but performance testing will be done to insure that the cost of disabling guard motion even for HCR guards has no major performance effect.
@vijaysun-omr vijaysun-omr self-assigned this Jul 17, 2024
@jdmpapin jdmpapin marked this pull request as draft July 18, 2024 17:54
@klangman
Copy link
Contributor Author

My testing has uncovered a number of failures that might be caused by this fix, so for now I need to analyse those issues and see if any changes to the fix is needed.

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.

2 participants