Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JITServer thunk pointer handling issue #16684

Merged
merged 1 commit into from
Feb 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions runtime/compiler/env/VMJ9Server.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2022 IBM Corp. and others
* Copyright (c) 2018, 2023 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -1461,16 +1461,16 @@ TR_J9ServerVM::getJ2IThunk(char *signatureChars, uint32_t signatureLength, TR::C

JITServer::ServerStream *stream = _compInfoPT->getMethodBeingCompiled()->_stream;
stream->write(JITServer::MessageType::VM_getJ2IThunk, signature);
void *thunkPtr = std::get<0>(stream->read<void *>());
if (thunkPtr)
void *clientThunkPtr = std::get<0>(stream->read<void *>());
if (clientThunkPtr)
{
// Cache client-side pointer to the thunk
OMR::CriticalSection thunkMonitor(_compInfoPT->getClientData()->getThunkSetMonitor());
auto &thunkMap = _compInfoPT->getClientData()->getRegisteredJ2IThunkMap();
thunkMap.insert(std::make_pair(std::make_pair(signature, comp->compileRelocatableCode()), thunkPtr));
thunkMap.insert(std::make_pair(std::make_pair(signature, comp->compileRelocatableCode()), clientThunkPtr));
}

return thunkPtr;
return clientThunkPtr;
}

void *
Expand All @@ -1494,7 +1494,7 @@ TR_J9ServerVM::setJ2IThunk(char *signatureChars, uint32_t signatureLength, void
auto &thunkMap = _compInfoPT->getClientData()->getRegisteredJ2IThunkMap();
thunkMap.insert(std::make_pair(std::make_pair(signature, comp->compileRelocatableCode()), clientThunkPtr));
}
return thunkptr;
return clientThunkPtr;
}

void
Expand Down