From 567c73352e71bf0ab8838b1e8137699bf44c815f Mon Sep 17 00:00:00 2001 From: Luke Li Date: Wed, 4 Dec 2024 15:58:26 -0500 Subject: [PATCH] Bypass Code Requiring VM Read at JITServer Bypass the code that requires a VM read in constraintRecognizedMethod under JITServer mode, to prevent an invalid class pointer being sent to the client and crashing the client. This block of code should only be reached in jdk11. Signed-off-by: Luke Li --- runtime/compiler/optimizer/J9ValuePropagation.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runtime/compiler/optimizer/J9ValuePropagation.cpp b/runtime/compiler/optimizer/J9ValuePropagation.cpp index b208b30d055..ede01a33826 100644 --- a/runtime/compiler/optimizer/J9ValuePropagation.cpp +++ b/runtime/compiler/optimizer/J9ValuePropagation.cpp @@ -2130,6 +2130,11 @@ J9::ValuePropagation::constrainRecognizedMethod(TR::Node *node) #if defined(J9VM_OPT_METHOD_HANDLE) case TR::java_lang_invoke_PrimitiveHandle_initializeClassIfRequired: { + // The macro J9VMJAVALANGINVOKEPRIMITIVEHANDLE used later + // will access vm information which is not available on the JITServer, + // bypass in this case to prevent an invalid class pointer being retrieved + if (comp()->isOutOfProcessCompilation()) + break; TR::Node* mh = node->getArgument(0); bool mhConstraintGlobal; TR::VPConstraint* mhConstraint = getConstraint(mh, mhConstraintGlobal);