Skip to content

Commit

Permalink
Bypass Code Requiring VM Read at JITServer
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
luke-li-2003 committed Dec 4, 2024
1 parent f8939d1 commit 53b4859
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions runtime/compiler/optimizer/J9ValuePropagation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions test/aqa-tests
Submodule aqa-tests added at 6b901c

0 comments on commit 53b4859

Please sign in to comment.