openj9 icon indicating copy to clipboard operation
openj9 copied to clipboard

JIT must narrow byte/short/char before storing

Open BradleyWood opened this issue 1 year ago • 4 comments

Issue: #16498

BradleyWood avatar Feb 06 '24 17:02 BradleyWood

Will this change also impact Unsafe putObject* ? I'll next be looking at the interpreter to see if they need changing.

gacholio avatar Feb 07 '24 19:02 gacholio

This only affects putstatic/putfield

BradleyWood avatar Feb 07 '24 19:02 BradleyWood

Then you'll need to do something similar for the Unsafe intrinsics (the VM already did this right for a long time, with the boolean special case added recently).

gacholio avatar Feb 07 '24 19:02 gacholio

I've also modified the pre-OpenJdK MethodHandle implementation in the VM (#18929). I suspect the JIT will need no work here because the old implementation boiled down to bytecodes, so hopefully this case will be fixed by the existing work.

gacholio avatar Feb 09 '24 14:02 gacholio

Then you'll need to do something similar for the Unsafe intrinsics (the VM already did this right for a long time, with the boolean special case added recently).

@BradleyWood , you mentioned offline that the handling of Unsafe is already as expected for JIT-compiled code. Can you confirm that?

hzongaro avatar Feb 21 '24 14:02 hzongaro

See the force-push

BradleyWood avatar Mar 05 '24 20:03 BradleyWood

@BradleyWood Looks like the latest force-push 0426748 might be based off an older version of this branch. The following code is removed in 0426748 which I think should be included to address Henry's previous comments

Screenshot 2024-03-05 at 4 21 28 PM Screenshot 2024-03-05 at 4 21 36 PM

a7ehuo avatar Mar 05 '24 21:03 a7ehuo

Sorry, thanks for catching that

BradleyWood avatar Mar 05 '24 21:03 BradleyWood

Fixed. @hzongaro @a7ehuo

BradleyWood avatar Mar 06 '24 14:03 BradleyWood

Jenkins test sanity all jdk8,jdk11,jdk17,jdk21

hzongaro avatar Mar 06 '24 19:03 hzongaro

zLinux JDK 17 and aarch64 JDK 21 test failures appears to be known issue #18527 (or a variant).

aarch64 JDK 17 and AIX JDK 21 build failures appear to be infrastructure-related. Rerunning those two.

hzongaro avatar Mar 07 '24 04:03 hzongaro

Jenkins test sanity aix jdk21

hzongaro avatar Mar 07 '24 04:03 hzongaro

Jenkins test sanity alinux64 jdk17

hzongaro avatar Mar 07 '24 04:03 hzongaro

Testing was successful, aside from the known failures noted above. Merging.

hzongaro avatar Mar 08 '24 04:03 hzongaro

@BradleyWood, may I ask you to open a pull request to get this change delivered to the 0.44 release branch?

hzongaro avatar Mar 08 '24 04:03 hzongaro

AFIAK, my changes have not been backported to 0.44 (unless the split was after my commits).

gacholio avatar Mar 08 '24 04:03 gacholio

https://github.com/eclipse-openj9/openj9/pull/18929 is included in 0.44, the split was done after it was merged.

pshipton avatar Mar 08 '24 12:03 pshipton