Skip to content

(0.46) Skip bounds checks in BigInteger bit{Count,Length} #19705

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions runtime/compiler/codegen/J9RecognizedMethodsEnum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,8 @@
java_math_BigInteger_toByteArray,
java_math_BigInteger_stripLeadingZeroBytes1,
java_math_BigInteger_stripLeadingZeroBytes2,
java_math_BigInteger_bitCount,
java_math_BigInteger_bitLength,

java_text_NumberFormat_format,

Expand Down
2 changes: 2 additions & 0 deletions runtime/compiler/env/j9method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2643,6 +2643,8 @@ void TR_ResolvedJ9Method::construct()
{x(TR::java_math_BigInteger_toByteArray, "toByteArray", "()[B")},
{x(TR::java_math_BigInteger_stripLeadingZeroBytes1, "stripLeadingZeroBytes", "([BII)[I")},
{x(TR::java_math_BigInteger_stripLeadingZeroBytes2, "stripLeadingZeroBytes", "(I[BII)[I")},
{x(TR::java_math_BigInteger_bitCount, "bitCount", "()I")},
{x(TR::java_math_BigInteger_bitLength, "bitLength", "()I")},
{ TR::unknownMethod}
};

Expand Down
4 changes: 4 additions & 0 deletions runtime/compiler/il/J9MethodSymbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ static TR::RecognizedMethod canSkipBoundChecks[] =
#endif // OPENJ9_BUILD
TR::java_math_BigInteger_stripLeadingZeroBytes1,
TR::java_math_BigInteger_stripLeadingZeroBytes2,
#ifdef OPENJ9_BUILD
TR::java_math_BigInteger_bitCount,
TR::java_math_BigInteger_bitLength,
#endif // OPENJ9_BUILD
TR::java_util_HashMap_get,
TR::java_util_HashMap_findNonNullKeyEntry,
TR::java_util_HashMap_putImpl,
Expand Down