-
Notifications
You must be signed in to change notification settings - Fork 721
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
Improve handling of endianness #8294
Conversation
518543c
to
d4392ce
Compare
Changes look good! We'll need to carry out performance experiments once we get an approval from someone on the optimizer side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would appreciate a justification for the change to JITHelpers - adding the recognized methods so that we can try to inline them and do good things for the java/nio package seems reasonable, but the changes to JITHelpers seem like a step backwards since we cannot constant fold and add a complex dependency from JITHelpers which it has never previously had.
Jenkins test sanity all jdk8,jdk11 |
@fjeremic pls don't run |
Sorry about that. Will not do this in the future. Can we disable this combination on the infrastructure side to prevent people from launching the builds? Is there an issue tracking a fix? IIRC this used to work in the past. |
Jenkins test sanity all jdk8 |
|
https://openj9.slack.com/archives/C8PQL5N65/p1575512682081300 |
We've disabled keywords |
Ok, I see so this is an external machine connection flakiness issue. I agree with not hardcoding. I'll keep an eye if I see people launching too many builds to inform them of this restriction. Thanks! Jenkins test sanity all jdk11 |
@andrewcraik this change is ready. I'll wait for your approval before merging. |
Can we please get an updated PR message? The commits need a squash too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revoking approval to prevent myself from accidentally merging. @simonameng let's address the previous comment and we should be ready here.
54938c0
to
ca2381c
Compare
Use `putByteInArrayByIndex` function to put the zero byte into the right index of `char[]`, instead of checking the `byteOrder` and then doing `&= 0x00FF` or `&= 0xFF00` Signed-off-by: simonameng <simonameng97@gmail.com>
Add `nativeOrder` and `byteOrder` to j9 method list, worth inlining list and 'foldFinalFieldsIn' list. Change copyright in relevant files. Signed-off-by: simonameng <simonameng97@gmail.com>
Add native function 'isBigEndian' following the implementation of 'Java_sun_misc_Unsafe_isBigEndian0'. Deprecate `IS_PLATFORM_LITTLE_ENDIAN` with `isBigEndian` function. Signed-off-by: simonameng <simonameng97@gmail.com>
ca2381c
to
c3b31df
Compare
Force push link says there is nothing different between this version and the last, sans the commit message fixup and squashing. For sanity I'll just kick off a single build, although it is not warranted given previous testing. Jenkins test sanity xlinux jdk8,jdk11 |
Add native function
isBigEndian
inJITHelpers.java
following the implementation ofJava_sun_misc_Unsafe_isBigEndian0
.Replace
IS_PLATFORM_LITTLE_ENDIAN
with the new implemented functionisBigEndian
inJITHelpers.java
and removeIS_PLATFORM_LITTLE_ENDIAN
relevant code.Use
putByteInArrayByIndex
function to put the zero byte into the right index intochar[]
, instead of checking thebyteOrder
and then doing&= 0x00FF
or&= 0xFF00
Inline and fold away
java/nio/ByteOrder.nativeOrder
andjava/nio/Bits.byteOrder
. The reason I inline and fold awayjava/nio/Bits.byteOrder
is that JDK8 callsBits.byteOrder
inByteOrder.nativeOrder
instead ofByteOrder.NATIVE_ORDER
, which is a static field in JDK11.Closes: #4741