Skip to content

Commit

Permalink
WIP4
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-li-2003 committed Dec 11, 2024
1 parent 5094874 commit ea629a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion runtime/compiler/control/JITClientCompilationThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2955,6 +2955,7 @@ handleServerMessage(JITServer::ClientStream *client, TR_J9VM *fe, JITServer::Mes
auto recv = client->getRecvData<TR::KnownObjectTable::Index, intptr_t>();
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;

Expand All @@ -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 =
Expand Down
8 changes: 5 additions & 3 deletions runtime/compiler/optimizer/J9TransformUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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, uintptr_t *>();
TR::KnownObjectTable::Index value = std::get<0>(recv);
uintptr_t *objectReferenceLocationClient = std::get<1>(recv);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ea629a8

Please sign in to comment.