From ea629a86ba3c0aff4dca4b4839fa076847cc6d59 Mon Sep 17 00:00:00 2001 From: Luke Li Date: Wed, 11 Dec 2024 17:16:44 -0500 Subject: [PATCH] WIP4 --- runtime/compiler/control/JITClientCompilationThread.cpp | 3 ++- runtime/compiler/optimizer/J9TransformUtil.cpp | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/runtime/compiler/control/JITClientCompilationThread.cpp b/runtime/compiler/control/JITClientCompilationThread.cpp index 57609a01aff..20aa409c944 100644 --- a/runtime/compiler/control/JITClientCompilationThread.cpp +++ b/runtime/compiler/control/JITClientCompilationThread.cpp @@ -2955,6 +2955,7 @@ handleServerMessage(JITServer::ClientStream *client, TR_J9VM *fe, JITServer::Mes auto recv = client->getRecvData(); TR::KnownObjectTable::Index baseObjectIndex = std::get<0>(recv); intptr_t fieldOffset = std::get<1>(recv); + bool isArrayWithConstantElements = std::get<2>(recv); TR::KnownObjectTable::Index resultIndex = TR::KnownObjectTable::UNKNOWN; @@ -2966,7 +2967,7 @@ handleServerMessage(JITServer::ClientStream *client, TR_J9VM *fe, JITServer::Mes uintptr_t objectPointer = fe->getReferenceFieldAtAddress(fieldAddress); if (objectPointer) - resultIndex = knot->getOrCreateIndex(objectPointer); + resultIndex = knot->getOrCreateIndexAt(&objectPointer, isArrayWithConstatnElements); } uintptr_t *resultPointer = diff --git a/runtime/compiler/optimizer/J9TransformUtil.cpp b/runtime/compiler/optimizer/J9TransformUtil.cpp index 46256f05030..620e2782977 100644 --- a/runtime/compiler/optimizer/J9TransformUtil.cpp +++ b/runtime/compiler/optimizer/J9TransformUtil.cpp @@ -739,7 +739,10 @@ static void *dereferenceStructPointer(TR::KnownObjectTable::Index baseKnownObjec auto stream = comp->getStream(); stream->write( JITServer::MessageType::KnownObjectTable_addFieldAddressFromBaseIndex, - baseKnownObject, symRef->getOffset()); + baseKnownObject, + symRef->getOffset() + isArrayWithConstantElements(symRef, comp) + ); auto recv = stream->read(); TR::KnownObjectTable::Index value = std::get<0>(recv); uintptr_t *objectReferenceLocationClient = std::get<1>(recv); @@ -1979,8 +1982,7 @@ J9::TransformUtil::transformIndirectLoadChainImpl(TR::Compilation *comp, TR::Nod // in non-jitserver mode, we need to hold a mutex until the end of the function to ensure // fieldAddress holds - TR::VMAccessCriticalSection transformIndirectLoadChain(comp, - TR::VMAccessCriticalSection::tryToAcquireVMAccess); + TR::VMAccessCriticalSection transformIndirectLoadChain(comp); if (!transformIndirectLoadChain.hasVMAccess() #if defined(J9VM_OPT_JITSERVER) && !isServer