Skip to content

Eliminate VM_isClassLibraryClass messages for JITServer #19477

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

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions runtime/compiler/control/JITClientCompilationThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,6 @@ handleServerMessage(JITServer::ClientStream *client, TR_J9VM *fe, JITServer::Mes
}
}
break;
case MessageType::VM_isClassLibraryClass:
{
bool rv = fe->isClassLibraryClass(std::get<0>(client->getRecvData<TR_OpaqueClassBlock*>()));
client->write(response, rv);
}
break;
case MessageType::VM_isClassLibraryMethod:
{
auto tup = client->getRecvData<TR_OpaqueMethodBlock*, bool>();
Expand Down
13 changes: 8 additions & 5 deletions runtime/compiler/env/VMJ9Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,20 @@ TR_J9ServerVM::getResolvedMethodsAndMethods(TR_Memory *trMemory, TR_OpaqueClassB
bool
TR_J9ServerVM::isClassLibraryMethod(TR_OpaqueMethodBlock *method, bool vettedForAOT)
{
JITServer::ServerStream *stream = _compInfoPT->getMethodBeingCompiled()->_stream;
stream->write(JITServer::MessageType::VM_isClassLibraryMethod, method, vettedForAOT);
return std::get<0>(stream->read<bool>());
return isClassLibraryClass(getClassFromMethodBlock(method));
}

bool
TR_J9ServerVM::isClassLibraryClass(TR_OpaqueClassBlock *clazz)
{
// Use the local cache to determine whether the class loader of the given
// class is the same as the system classloader
JITServer::ServerStream *stream = _compInfoPT->getMethodBeingCompiled()->_stream;
stream->write(JITServer::MessageType::VM_isClassLibraryClass, clazz);
return std::get<0>(stream->read<bool>());
void *classLoader = NULL;
JITServerHelpers::getAndCacheRAMClassInfo((J9Class *)clazz, _compInfoPT->getClientData(), stream, JITServerHelpers::CLASSINFO_CLASS_LOADER, &classLoader);
auto *vmInfo = _compInfoPT->getClientData()->getOrCacheVMInfo(stream);
TR_ASSERT(vmInfo->_systemClassLoader, "_systemClassLoader cannot be NULL");
return vmInfo->_systemClassLoader == classLoader;
}

TR_OpaqueClassBlock *
Expand Down
2 changes: 1 addition & 1 deletion runtime/compiler/net/CommunicationStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class CommunicationStream
// likely to lose an increment when merging/rebasing/etc.
//
static const uint8_t MAJOR_NUMBER = 1;
static const uint16_t MINOR_NUMBER = 61; // ID: 2WUGRj9RjAt4xrMCntc/
static const uint16_t MINOR_NUMBER = 62; // ID: TNff0n0QdLOhsH6CmQlT/
static const uint8_t PATCH_NUMBER = 0;
static uint32_t CONFIGURATION_FLAGS;

Expand Down
1 change: 0 additions & 1 deletion runtime/compiler/net/MessageTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ const char *messageNames[] =
"ResolvedRelocatableMethod_fieldAttributes",
"ResolvedRelocatableMethod_staticAttributes",
"ResolvedRelocatableMethod_getFieldType",
"VM_isClassLibraryClass",
"VM_isClassLibraryMethod",
"VM_isClassArray",
"VM_transformJlrMethodInvoke",
Expand Down
1 change: 0 additions & 1 deletion runtime/compiler/net/MessageTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ enum MessageType : uint16_t
ResolvedRelocatableMethod_getFieldType,

// For TR_J9ServerVM methods
VM_isClassLibraryClass,
VM_isClassLibraryMethod,
VM_isClassArray,
VM_transformJlrMethodInvoke,
Expand Down