Skip to content

Commit

Permalink
Merge pull request #19477 from mpirvu/classlibraryclass
Browse files Browse the repository at this point in the history
Eliminate VM_isClassLibraryClass messages for JITServer
  • Loading branch information
ymanton committed May 14, 2024
2 parents f270cb4 + 1208a4a commit dd6f997
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
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

0 comments on commit dd6f997

Please sign in to comment.