Removes unnecessary zero init on new arrays - #24189
Conversation
343f916 to
3f5fdf1
Compare
|
@hzongaro Can you take a look when you get the chance? @vijaysun-omr This may be of interest to you. |
hzongaro
left a comment
There was a problem hiding this comment.
Overall, I think the changes look good.
In the process of reviewing, I tripped across some code in TR_J9ByteCodeIlGenerator:: that marks some calls to Arrays.copyOf as not requiring zero initialization. I wonder whether any of the methods in String, StringLatin1 or StringUTF16 that you've identified could also be be included there.
That doesn't necessarily need to be resolved as part of this pull request. It could be investigated as a follow up item.
3f5fdf1 to
a98557d
Compare
hzongaro
left a comment
There was a problem hiding this comment.
I think it looks good. May I ask you to revise the commit comment to reflect the changes to the environment variables?
I will go ahead and approve this change in the meanwhile.
Removes zero initialization for trusted String methods that are known never to read elements that were not initialized. This includes: java_lang_String_encode8859_1 java_lang_String_encodeASCII java_lang_String_encodeUTF8_UTF16 java_lang_String_init_int_String_int_String_String java_lang_String_init_String_char java_lang_String_newStringUTF8NoRepl java_lang_String_repeat java_lang_StringLatin1_replace_CharSequence java_lang_StringLatin1_toBytes java_lang_StringLatin1_toBytes_III java_lang_StringLatin1_toChars java_lang_StringLatin1_toLowerCase java_lang_StringLatin1_toUpperCase java_lang_StringUTF16_compress_BII java_lang_StringUTF16_compress_CII java_lang_StringUTF16_compress_III java_lang_StringUTF16_replace_CharSequence java_lang_StringUTF16_toBytes_C java_lang_StringUTF16_toBytesSup java_lang_StringUTF16_toChars The zero initialization can be restored by setting the TR_DisableStringZeroInitSkipsSet2 envvar. The envvar TR_DisableStringZeroInitSkipsSet1 has also been added as an option to disable the pre existing zero initialization skips. Cleans up formatting for code related to recognized String methods to make it easier to read. Signed-off-by: jimmyk <jimmyk@ca.ibm.com>
a98557d to
277a032
Compare
|
I fixed the commit message. |
|
Jenkins test sanity.functional,sanity.openjdk all jdk8,jdk11,jdk21 |
|
Looks like sanity.functional s390x_linux testing was aborted. Restarting. . . . Jenkins test sanity.functional zlinux jdk21 |
|
@IBMJimmyk, may I ask you to have a look through the test failures to ensure they are all known issues? |
|
I can try looking at the failures. |
|
The I am still looking at the openjdk failures. |
Thank you! As all failures are due to known issues, I will merge this change. |
Removes zero initialization for trusted String methods that are known never to read elements that were not initialized. This includes:
The zero initialization can be restored by setting the
TR_DisableStringZeroInitSkipsenvvar.Cleans up formatting for code related to recognized String methods to make it easier to read.