From 3c1fafcf3cd6a6546b697377a26dc9ff6a84a4cd Mon Sep 17 00:00:00 2001 From: Victor Ding Date: Tue, 26 Jun 2018 15:06:36 -0400 Subject: [PATCH] Prevent recognizing JIT Helpers not for their ISA 1. Prevent recognizing JIT Helpers intended for 32-bit on 64-bit ISA; 2. Prevent recognizing JIT Helpers intended for 64-bit on 32-bit ISA. Signed-off-by: Victor Ding --- runtime/compiler/env/j9method.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/runtime/compiler/env/j9method.cpp b/runtime/compiler/env/j9method.cpp index 6a210500228..3d01dc27be9 100644 --- a/runtime/compiler/env/j9method.cpp +++ b/runtime/compiler/env/j9method.cpp @@ -3241,29 +3241,32 @@ TR_ResolvedJ9Method::TR_ResolvedJ9Method(TR_OpaqueMethodBlock * aMethod, TR_Fron { {x(TR::com_ibm_jit_JITHelpers_is32Bit, "is32Bit", "()Z")}, {x(TR::com_ibm_jit_JITHelpers_isArray, "isArray", "(Ljava/lang/Object;)Z")}, - { TR::com_ibm_jit_JITHelpers_findElementFromArray, 20, "findElementFromArray", (int16_t)-1, "*" }, - {x(TR::com_ibm_jit_JITHelpers_getJ9ClassFromObject64, "getJ9ClassFromObject64", "(Ljava/lang/Object;)J")}, +#ifdef TR_TARGET_32BIT {x(TR::com_ibm_jit_JITHelpers_getJ9ClassFromObject32, "getJ9ClassFromObject32", "(Ljava/lang/Object;)I")}, {x(TR::com_ibm_jit_JITHelpers_getJ9ClassFromClass32, "getJ9ClassFromClass32", "(Ljava/lang/Class;)I")}, - {x(TR::com_ibm_jit_JITHelpers_getJ9ClassFromClass64, "getJ9ClassFromClass64", "(Ljava/lang/Class;)J")}, {x(TR::com_ibm_jit_JITHelpers_getBackfillOffsetFromJ9Class32, "getBackfillOffsetFromJ9Class32", "(I)I")}, - {x(TR::com_ibm_jit_JITHelpers_getBackfillOffsetFromJ9Class64, "getBackfillOffsetFromJ9Class64", "(J)J")}, {x(TR::com_ibm_jit_JITHelpers_getRomClassFromJ9Class32, "getRomClassFromJ9Class32", "(I)I")}, - {x(TR::com_ibm_jit_JITHelpers_getRomClassFromJ9Class64, "getRomClassFromJ9Class64", "(J)J")}, {x(TR::com_ibm_jit_JITHelpers_getArrayShapeFromRomClass32, "getArrayShapeFromRomClass32", "(I)I")}, - {x(TR::com_ibm_jit_JITHelpers_getArrayShapeFromRomClass64, "getArrayShapeFromRomClass64", "(J)I")}, {x(TR::com_ibm_jit_JITHelpers_getSuperClassesFromJ9Class32, "getSuperClassesFromJ9Class32", "(I)I")}, - {x(TR::com_ibm_jit_JITHelpers_getSuperClassesFromJ9Class64, "getSuperClassesFromJ9Class64", "(J)J")}, {x(TR::com_ibm_jit_JITHelpers_getClassDepthAndFlagsFromJ9Class32, "getClassDepthAndFlagsFromJ9Class32", "(I)I")}, - {x(TR::com_ibm_jit_JITHelpers_getClassDepthAndFlagsFromJ9Class64, "getClassDepthAndFlagsFromJ9Class64", "(J)J")}, {x(TR::com_ibm_jit_JITHelpers_getClassFlagsFromJ9Class32, "getClassFlagsFromJ9Class32", "(I)I")}, - {x(TR::com_ibm_jit_JITHelpers_getClassFlagsFromJ9Class64, "getClassFlagsFromJ9Class64", "(J)I")}, {x(TR::com_ibm_jit_JITHelpers_getModifiersFromRomClass32, "getModifiersFromRomClass32", "(I)I")}, - {x(TR::com_ibm_jit_JITHelpers_getModifiersFromRomClass64, "getModifiersFromRomClass64", "(J)I")}, {x(TR::com_ibm_jit_JITHelpers_getClassFromJ9Class32, "getClassFromJ9Class32", "(I)Ljava/lang/Class;")}, - {x(TR::com_ibm_jit_JITHelpers_getClassFromJ9Class64, "getClassFromJ9Class64", "(J)Ljava/lang/Class;")}, {x(TR::com_ibm_jit_JITHelpers_getAddressAsPrimitive32, "getAddressAsPrimitive32", "(Ljava/lang/Object;)I")}, +#endif +#ifdef TR_TARGET_64BIT + {x(TR::com_ibm_jit_JITHelpers_getJ9ClassFromObject64, "getJ9ClassFromObject64", "(Ljava/lang/Object;)J")}, + {x(TR::com_ibm_jit_JITHelpers_getJ9ClassFromClass64, "getJ9ClassFromClass64", "(Ljava/lang/Class;)J")}, + {x(TR::com_ibm_jit_JITHelpers_getBackfillOffsetFromJ9Class64, "getBackfillOffsetFromJ9Class64", "(J)J")}, + {x(TR::com_ibm_jit_JITHelpers_getRomClassFromJ9Class64, "getRomClassFromJ9Class64", "(J)J")}, + {x(TR::com_ibm_jit_JITHelpers_getArrayShapeFromRomClass64, "getArrayShapeFromRomClass64", "(J)I")}, + {x(TR::com_ibm_jit_JITHelpers_getSuperClassesFromJ9Class64, "getSuperClassesFromJ9Class64", "(J)J")}, + {x(TR::com_ibm_jit_JITHelpers_getClassDepthAndFlagsFromJ9Class64, "getClassDepthAndFlagsFromJ9Class64", "(J)J")}, + {x(TR::com_ibm_jit_JITHelpers_getClassFlagsFromJ9Class64, "getClassFlagsFromJ9Class64", "(J)I")}, + {x(TR::com_ibm_jit_JITHelpers_getModifiersFromRomClass64, "getModifiersFromRomClass64", "(J)I")}, + {x(TR::com_ibm_jit_JITHelpers_getClassFromJ9Class64, "getClassFromJ9Class64", "(J)Ljava/lang/Class;")}, {x(TR::com_ibm_jit_JITHelpers_getAddressAsPrimitive64, "getAddressAsPrimitive64", "(Ljava/lang/Object;)J")}, +#endif {x(TR::com_ibm_jit_JITHelpers_hashCodeImpl, "hashCodeImpl", "(Ljava/lang/Object;)I")}, {x(TR::com_ibm_jit_JITHelpers_getSuperclass, "getSuperclass", "(Ljava/lang/Class;)Ljava/lang/Class;")}, {x(TR::com_ibm_jit_JITHelpers_optimizedClone, "optimizedClone", "(Ljava/lang/Object;)Ljava/lang/Object;")},