From 53b4859327767b679493ce63ff1773ccdcd99aea 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 +++++ test/aqa-tests | 1 + 2 files changed, 6 insertions(+) create mode 160000 test/aqa-tests diff --git a/runtime/compiler/optimizer/J9ValuePropagation.cpp b/runtime/compiler/optimizer/J9ValuePropagation.cpp index b208b30d055..de9eab7c588 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 server, + // 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); diff --git a/test/aqa-tests b/test/aqa-tests new file mode 160000 index 00000000000..6b901c965aa --- /dev/null +++ b/test/aqa-tests @@ -0,0 +1 @@ +Subproject commit 6b901c965aab2cc55c6cb357fd81d04f87d8581f