Skip to content

Commit

Permalink
Merge pull request #16234 from gita-omr/range_check_removal
Browse files Browse the repository at this point in the history
Inline jdk/internal/util/Preconditions.checkIndex
  • Loading branch information
jdmpapin committed Nov 2, 2022
2 parents db33cb6 + 968e652 commit a31c794
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions runtime/compiler/codegen/J9RecognizedMethodsEnum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@

jdk_internal_misc_Unsafe_copyMemory0,
jdk_internal_loader_NativeLibraries_load,
jdk_internal_util_Preconditions_checkIndex,

FirstVectorMethod,
jdk_internal_vm_vector_VectorSupport_load = FirstVectorMethod,
Expand Down
10 changes: 10 additions & 0 deletions runtime/compiler/env/j9method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2988,6 +2988,14 @@ void TR_ResolvedJ9Method::construct()
};
#endif /* JAVA_SPEC_VERSION >= 15 */


static X PreconditionsMethods[] =
{
{x(TR::jdk_internal_util_Preconditions_checkIndex, "checkIndex", "(IILjava/util/function/BiFunction;)I")},
{ TR::unknownMethod}
};


static X VectorSupportMethods[] =
{
{x(TR::jdk_internal_vm_vector_VectorSupport_load, "load", "(Ljava/lang/Class;Ljava/lang/Class;ILjava/lang/Object;JLjava/lang/Object;JLjdk/internal/vm/vector/VectorSupport$VectorSpecies;Ljdk/internal/vm/vector/VectorSupport$LoadOperation;)Ljdk/internal/vm/vector/VectorSupport$VectorPayload;")},
Expand Down Expand Up @@ -4079,6 +4087,8 @@ void TR_ResolvedJ9Method::construct()
{
{ "com/ibm/jit/DecimalFormatHelper", DecimalFormatHelperMethods},
{ "jdk/internal/reflect/Reflection", ReflectionMethods },
{ "jdk/internal/util/Preconditions", PreconditionsMethods },

{ 0 }
};
static Y class32[] =
Expand Down
2 changes: 2 additions & 0 deletions runtime/compiler/optimizer/InlinerTempForJ9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ TR_J9InlinerPolicy::alwaysWorthInlining(TR_ResolvedMethod * calleeMethod, TR::No
case TR::java_lang_String_regionMatchesInternal:
case TR::java_lang_String_regionMatches:
case TR::java_lang_Class_newInstance:
case TR::jdk_internal_util_Preconditions_checkIndex:

// we rely on inlining compareAndSwap so we see the inner native call and can special case it
case TR::com_ibm_jit_JITHelpers_compareAndSwapIntInObject:
case TR::com_ibm_jit_JITHelpers_compareAndSwapLongInObject:
Expand Down

0 comments on commit a31c794

Please sign in to comment.