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

Add missing conversion for load generated by UnsafeFastPath #3218

Merged
merged 1 commit into from
Oct 11, 2018

Conversation

liqunl
Copy link
Contributor

@liqunl liqunl commented Oct 10, 2018

Convert the result of load if the result type doesn't match the Unsafe
call's return type. The conversion is needed for accessing arrays whose
element type is narrower than 32 bits.

Signed-off-by: Liqun Liu liqunl@ca.ibm.com

@liqunl
Copy link
Contributor Author

liqunl commented Oct 10, 2018

@fjeremic @andrewcraik Can I have a review?

@@ -560,7 +560,7 @@ int32_t TR_UnsafeFastPath::perform()
else
{
//This is a load
if (isByIndex && node->getDataType() != type)
if (node->getDataType() != type)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be an assert below guarding for future modifications. Are you certain we won't hit this assert? Note it's not a FATAL assert so it won't fire by default (outside of debug builds).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for Unsafe methods. Is there similar problem to JITHelpers methods like getByteFromArray? The method return byte but in trees we use icallx, so a conversion is needed on the load.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that you mention, I'll update the assertion message to not limit to JITHelpers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fjeremic Have my comments answered your questions? Any more concerns?

Convert the result of load if the result type doesn't match the Unsafe
call's return type. The conversion is needed for accessing arrays whose
element type is narrower than 32 bits.

Signed-off-by: Liqun Liu <liqunl@ca.ibm.com>
@liqunl
Copy link
Contributor Author

liqunl commented Oct 11, 2018

Added change to also fix store.

Copy link
Contributor

@andrewcraik andrewcraik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andrewcraik
Copy link
Contributor

CI should be sufficient - merging

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.

3 participants