Skip to content

Commit d22a436

Browse files
authored
Merge pull request #19603 from ymanton/skip-zeroinit-checks-bigint-0.46
(0.46.0) Skip zero-init, checks for some BigInteger methods
2 parents 747e541 + b8655d4 commit d22a436

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

runtime/compiler/codegen/J9RecognizedMethodsEnum.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,10 @@
835835
java_math_BigInteger_add,
836836
java_math_BigInteger_subtract,
837837
java_math_BigInteger_multiply,
838+
java_math_BigInteger_init_long,
839+
java_math_BigInteger_toByteArray,
840+
java_math_BigInteger_stripLeadingZeroBytes1,
841+
java_math_BigInteger_stripLeadingZeroBytes2,
838842

839843
java_text_NumberFormat_format,
840844

runtime/compiler/env/j9method.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2636,9 +2636,13 @@ void TR_ResolvedJ9Method::construct()
26362636

26372637
static X BigIntegerMethods[] =
26382638
{
2639-
{x(TR::java_math_BigInteger_add, "add", "(Ljava/math/BigInteger;)Ljava/math/BigInteger;")},
2640-
{x(TR::java_math_BigInteger_subtract, "subtract", "(Ljava/math/BigInteger;)Ljava/math/BigInteger;")},
2641-
{x(TR::java_math_BigInteger_multiply, "multiply", "(Ljava/math/BigInteger;)Ljava/math/BigInteger;")},
2639+
{x(TR::java_math_BigInteger_add, "add", "(Ljava/math/BigInteger;)Ljava/math/BigInteger;")},
2640+
{x(TR::java_math_BigInteger_subtract, "subtract", "(Ljava/math/BigInteger;)Ljava/math/BigInteger;")},
2641+
{x(TR::java_math_BigInteger_multiply, "multiply", "(Ljava/math/BigInteger;)Ljava/math/BigInteger;")},
2642+
{x(TR::java_math_BigInteger_init_long, "<init>", "(J)V")},
2643+
{x(TR::java_math_BigInteger_toByteArray, "toByteArray", "()[B")},
2644+
{x(TR::java_math_BigInteger_stripLeadingZeroBytes1, "stripLeadingZeroBytes", "([BII)[I")},
2645+
{x(TR::java_math_BigInteger_stripLeadingZeroBytes2, "stripLeadingZeroBytes", "(I[BII)[I")},
26422646
{ TR::unknownMethod}
26432647
};
26442648

runtime/compiler/il/J9MethodSymbol.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,12 @@ static TR::RecognizedMethod canSkipNullChecks[] =
201201
//TR::java_util_Vector_addElement,
202202
TR::java_math_BigDecimal_longString1C,
203203
TR::java_math_BigDecimal_longString2,
204+
TR::java_math_BigInteger_init_long,
205+
#ifdef OPENJ9_BUILD
206+
TR::java_math_BigInteger_toByteArray,
207+
#endif // OPENJ9_BUILD
208+
TR::java_math_BigInteger_stripLeadingZeroBytes1,
209+
TR::java_math_BigInteger_stripLeadingZeroBytes2,
204210
TR::java_util_EnumMap__nec_,
205211
TR::java_nio_Bits_getCharB,
206212
TR::java_nio_Bits_getCharL,
@@ -291,6 +297,12 @@ static TR::RecognizedMethod canSkipBoundChecks[] =
291297
TR::java_util_TreeMap_all,
292298
TR::java_math_BigDecimal_longString1C,
293299
TR::java_math_BigDecimal_longString2,
300+
TR::java_math_BigInteger_init_long,
301+
#ifdef OPENJ9_BUILD
302+
TR::java_math_BigInteger_toByteArray,
303+
#endif // OPENJ9_BUILD
304+
TR::java_math_BigInteger_stripLeadingZeroBytes1,
305+
TR::java_math_BigInteger_stripLeadingZeroBytes2,
294306
TR::java_util_HashMap_get,
295307
TR::java_util_HashMap_findNonNullKeyEntry,
296308
TR::java_util_HashMap_putImpl,
@@ -707,6 +719,12 @@ static TR::RecognizedMethod canSkipZeroInitializationOnNewarrays[] =
707719
//TR::java_lang_String_toUpperCaseCore,
708720
TR::java_lang_String_split_str_int,
709721
TR::java_math_BigDecimal_toString,
722+
TR::java_math_BigInteger_init_long,
723+
#ifdef OPENJ9_BUILD
724+
TR::java_math_BigInteger_toByteArray,
725+
#endif // OPENJ9_BUILD
726+
TR::java_math_BigInteger_stripLeadingZeroBytes1,
727+
TR::java_math_BigInteger_stripLeadingZeroBytes2,
710728
TR::java_lang_Integer_toString,
711729
TR::java_lang_Long_toString,
712730
TR::java_lang_StringCoding_encode,

0 commit comments

Comments
 (0)