From bc45d05f673f302cf6656e5dcec88634e912a27c Mon Sep 17 00:00:00 2001 From: Marius Pirvu Date: Fri, 5 Jul 2024 12:11:13 -0400 Subject: [PATCH] Revert "Reduce unnecessary TLS usage in JITServer code" --- runtime/compiler/codegen/J9CodeGenerator.cpp | 2 +- runtime/compiler/compile/J9Compilation.cpp | 6 +-- .../control/JITClientCompilationThread.cpp | 7 ++- runtime/compiler/env/J9ClassEnv.cpp | 9 ++-- runtime/compiler/env/J9KnownObjectTable.cpp | 10 ++-- runtime/compiler/env/j9method.cpp | 53 +++++++++---------- .../optimizer/InterpreterEmulator.cpp | 12 ++--- runtime/compiler/optimizer/J9Inliner.cpp | 4 +- .../compiler/runtime/JITServerIProfiler.cpp | 11 ++-- .../compiler/runtime/RelocationRuntime.cpp | 2 +- .../runtime/SymbolValidationManager.cpp | 4 +- .../runtime/SymbolValidationManager.hpp | 4 +- 12 files changed, 61 insertions(+), 63 deletions(-) diff --git a/runtime/compiler/codegen/J9CodeGenerator.cpp b/runtime/compiler/codegen/J9CodeGenerator.cpp index 690514efe24..6b923215b77 100644 --- a/runtime/compiler/codegen/J9CodeGenerator.cpp +++ b/runtime/compiler/codegen/J9CodeGenerator.cpp @@ -1190,7 +1190,7 @@ J9::CodeGenerator::lowerTreeIfNeeded( #if defined(J9VM_OPT_JITSERVER) // This is currently the only place where this flag gets cleared. For JITServer, we should propagate it to the client, // to avoid having to call scanForNativeMethodsUntilMonitorNode again. - if (auto stream = self()->comp()->getStream()) + if (auto stream = TR::CompilationInfo::getStream()) { stream->write(JITServer::MessageType::CHTable_clearReservable, classPointer); stream->read(); diff --git a/runtime/compiler/compile/J9Compilation.cpp b/runtime/compiler/compile/J9Compilation.cpp index ac8f5a1ebdd..d14343ac0bb 100644 --- a/runtime/compiler/compile/J9Compilation.cpp +++ b/runtime/compiler/compile/J9Compilation.cpp @@ -208,14 +208,14 @@ J9::Compilation::Compilation(int32_t id, _osrProhibitedOverRangeOfTrees(false), _wasFearPointAnalysisDone(false) { - _symbolValidationManager = new (self()->region()) TR::SymbolValidationManager(self()->region(), compilee, self()); + _symbolValidationManager = new (self()->region()) TR::SymbolValidationManager(self()->region(), compilee); _aotClassClassPointer = NULL; _aotClassClassPointerInitialized = false; - _aotGuardPatchSites = new (m->trHeapMemory()) TR::list(getTypedAllocator(self()->allocator())); + _aotGuardPatchSites = new (m->trHeapMemory()) TR::list(getTypedAllocator(self()->allocator())); - _aotClassInfo = new (m->trHeapMemory()) TR::list(getTypedAllocator(self()->allocator())); + _aotClassInfo = new (m->trHeapMemory()) TR::list(getTypedAllocator(self()->allocator())); if (_updateCompYieldStats) _hiresTimeForPreviousCallingContext = TR::Compiler->vm.getHighResClock(self()); diff --git a/runtime/compiler/control/JITClientCompilationThread.cpp b/runtime/compiler/control/JITClientCompilationThread.cpp index fe253fdbc1b..30052986bbd 100644 --- a/runtime/compiler/control/JITClientCompilationThread.cpp +++ b/runtime/compiler/control/JITClientCompilationThread.cpp @@ -3714,14 +3714,13 @@ remoteCompile(J9VMThread *vmThread, TR::Compilation *compiler, TR_ResolvedMethod // Intersect classesThatShouldNotBeNewlyExtended with newlyExtendedClasses // and abort on overlap auto newlyExtendedClasses = compInfo->getNewlyExtendedClasses(); - for (TR_OpaqueClassBlock *clazz : classesThatShouldNotBeNewlyExtended) + for (TR_OpaqueClassBlock* clazz : classesThatShouldNotBeNewlyExtended) { auto it = newlyExtendedClasses->find(clazz); - if (it != newlyExtendedClasses->end() && (it->second & (1 << compInfoPT->getCompThreadId()))) + if (it != newlyExtendedClasses->end() && (it->second & (1 << TR::compInfoPT->getCompThreadId()))) { if (TR::Options::isAnyVerboseOptionSet(TR_VerboseJITServer, TR_VerboseCompileEnd, TR_VerbosePerformance, TR_VerboseCompFailure)) - TR_VerboseLog::writeLineLocked(TR_Vlog_FAILURE, "Class that should not be newly extended was extended when compiling %s", - compiler->signature()); + TR_VerboseLog::writeLineLocked(TR_Vlog_FAILURE, "Class that should not be newly extended was extended when compiling %s", compiler->signature()); compiler->failCompilation("Class that should not be newly extended was extended"); } } diff --git a/runtime/compiler/env/J9ClassEnv.cpp b/runtime/compiler/env/J9ClassEnv.cpp index 822584a6256..87febc2fb85 100644 --- a/runtime/compiler/env/J9ClassEnv.cpp +++ b/runtime/compiler/env/J9ClassEnv.cpp @@ -980,7 +980,7 @@ J9::ClassEnv::isZeroInitializable(TR_OpaqueClassBlock *clazz) } bool -J9::ClassEnv::containsZeroOrOneConcreteClass(TR::Compilation *comp, List *subClasses) +J9::ClassEnv::containsZeroOrOneConcreteClass(TR::Compilation *comp, List* subClasses) { int count = 0; #if defined(J9VM_OPT_JITSERVER) @@ -990,7 +990,7 @@ J9::ClassEnv::containsZeroOrOneConcreteClass(TR::Compilation *comp, List subClassesNotCached(comp->trMemory()); // Process classes cached at the server first - ClientSessionData *clientData = comp->getClientData(); + ClientSessionData * clientData = TR::compInfoPT->getClientData(); for (TR_PersistentClassInfo *ptClassInfo = j.getFirst(); ptClassInfo; ptClassInfo = j.getNext()) { TR_OpaqueClassBlock *clazz = ptClassInfo->getClassId(); @@ -1068,15 +1068,14 @@ J9::ClassEnv::flattenedArrayElementSize(TR::Compilation *comp, TR_OpaqueClassBlo if (auto stream = comp->getStream()) { int32_t arrayElementSize = 0; - JITServerHelpers::getAndCacheRAMClassInfo((J9Class *)arrayClass, comp->getClientData(), stream, - JITServerHelpers::CLASSINFO_ARRAY_ELEMENT_SIZE, &arrayElementSize); + JITServerHelpers::getAndCacheRAMClassInfo((J9Class *)arrayClass, TR::compInfoPT->getClientData(), stream, JITServerHelpers::CLASSINFO_ARRAY_ELEMENT_SIZE, (void *)&arrayElementSize); return arrayElementSize; } else #endif /* defined(J9VM_OPT_JITSERVER) */ { J9JavaVM *vm = comp->fej9()->getJ9JITConfig()->javaVM; - return vm->internalVMFunctions->arrayElementSize((J9ArrayClass *)self()->convertClassOffsetToClassPtr(arrayClass)); + return vm->internalVMFunctions->arrayElementSize((J9ArrayClass*)self()->convertClassOffsetToClassPtr(arrayClass)); } } diff --git a/runtime/compiler/env/J9KnownObjectTable.cpp b/runtime/compiler/env/J9KnownObjectTable.cpp index 626d041e3d2..204dce6484b 100644 --- a/runtime/compiler/env/J9KnownObjectTable.cpp +++ b/runtime/compiler/env/J9KnownObjectTable.cpp @@ -74,7 +74,7 @@ J9::KnownObjectTable::getOrCreateIndex(uintptr_t objectPointer) if (self()->comp()->isOutOfProcessCompilation()) { TR_ASSERT_FATAL(false, "It is not safe to call getOrCreateIndex() at the server. The object pointer could have become stale at the client."); - auto stream = self()->comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::KnownObjectTable_getOrCreateIndex, objectPointer); auto recv = stream->read(); @@ -133,7 +133,7 @@ J9::KnownObjectTable::getOrCreateIndexAt(uintptr_t *objectReferenceLocation) #if defined(J9VM_OPT_JITSERVER) if (self()->comp()->isOutOfProcessCompilation()) { - auto stream = self()->comp()->getStream() ? self()->comp()->getStream() : TR::CompilationInfo::getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::KnownObjectTable_getOrCreateIndexAt, objectReferenceLocation); auto recv = stream->read(); @@ -169,7 +169,7 @@ J9::KnownObjectTable::getExistingIndexAt(uintptr_t *objectReferenceLocation) #if defined(J9VM_OPT_JITSERVER) if (self()->comp()->isOutOfProcessCompilation()) { - auto stream = self()->comp()->getStream() ? self()->comp()->getStream() : TR::CompilationInfo::getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::KnownObjectTable_getExistingIndexAt, objectReferenceLocation); result = std::get<0>(stream->read()); } @@ -205,7 +205,7 @@ J9::KnownObjectTable::getPointer(Index index) if (self()->comp()->isOutOfProcessCompilation()) { TR_ASSERT_FATAL(false, "It is not safe to call getPointer() at the server. The object pointer could have become stale at the client."); - auto stream = self()->comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::KnownObjectTable_getPointer, index); return std::get<0>(stream->read()); } @@ -391,7 +391,7 @@ J9::KnownObjectTable::dumpTo(TR::FILE *file, TR::Compilation *comp) #if defined(J9VM_OPT_JITSERVER) if (comp->isOutOfProcessCompilation()) { - auto stream = comp->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::KnownObjectTable_getKnownObjectTableDumpInfo, JITServer::Void()); auto recv = stream->read>(); diff --git a/runtime/compiler/env/j9method.cpp b/runtime/compiler/env/j9method.cpp index d1538ebc2d3..f748999b031 100644 --- a/runtime/compiler/env/j9method.cpp +++ b/runtime/compiler/env/j9method.cpp @@ -7856,7 +7856,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokeCollectHandleAllocateArray, methodHandleNode->getSymbolReference()->getKnownObjectIndex()); auto recv = stream->read(); @@ -7919,7 +7919,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokeCollectHandleNumArgsToCollect, thunkDetails->getHandleRef(), getCollectPosition); auto recv = stream->read(); @@ -7979,7 +7979,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokeExplicitCastHandleConvertArgs, thunkDetails->getHandleRef()); auto recv = stream->read(); auto &methodDescriptorString = std::get<0>(recv); @@ -8087,9 +8087,9 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_targetTypeL, thunkDetails->getHandleRef(), argIndex); - auto recv = stream->read(); + auto recv = stream->read(); sourceParmClass = std::get<0>(recv); targetParmClass = std::get<1>(recv); } @@ -8182,7 +8182,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) { packReferenceChainOffsets(methodHandleExpression, listOfOffsets); } - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokeILGenMacrosInvokeExactAndFixup, thunkDetails->getHandleRef(), listOfOffsets); auto recv = stream->read(); auto &methodDescriptorString = std::get<0>(recv); @@ -8292,7 +8292,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokeArgumentMoverHandlePermuteArgs, thunkDetails->getHandleRef()); auto recv = stream->read(); auto &methodDescString = std::get<0>(recv); @@ -8344,7 +8344,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokePermuteHandlePermuteArgs, thunkDetails->getHandleRef()); // Do the client-side operations @@ -8538,7 +8538,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokeGuardWithTestHandleNumGuardArgs, thunkDetails->getHandleRef()); numGuardArgs = std::get<0>(stream->read()); } @@ -8574,7 +8574,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokeInsertHandle, thunkDetails->getHandleRef()); auto recv = stream->read(); insertionIndex = std::get<0>(recv); @@ -8743,7 +8743,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokeSpreadHandleArrayArg, thunkDetails->getHandleRef()); auto recv = stream->read(); arrayJ9Class = std::get<0>(recv); @@ -8846,10 +8846,9 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); - auto recognizedMethod = symRef->getSymbol()->castToMethodSymbol()->getMandatoryRecognizedMethod(); - bool getSpreadPos = (recognizedMethod == TR::java_lang_invoke_SpreadHandle_spreadStart) || - (recognizedMethod == TR::java_lang_invoke_SpreadHandle_numArgsAfterSpreadArray); + auto stream = TR::CompilationInfo::getStream(); + bool getSpreadPos = symRef->getSymbol()->castToMethodSymbol()->getMandatoryRecognizedMethod() == TR::java_lang_invoke_SpreadHandle_spreadStart || + symRef->getSymbol()->castToMethodSymbol()->getMandatoryRecognizedMethod() == TR::java_lang_invoke_SpreadHandle_numArgsAfterSpreadArray; stream->write(JITServer::MessageType::runFEMacro_invokeSpreadHandle, thunkDetails->getHandleRef(), getSpreadPos); auto recv = stream->read(); numArguments = std::get<0>(recv); @@ -8904,7 +8903,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokeFoldHandle, thunkDetails->getHandleRef()); auto recv = stream->read, int32_t, int32_t>(); @@ -8983,7 +8982,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokeFilterArgumentsWithCombinerHandleArgumentIndices, thunkDetails->getHandleRef()); auto recv = stream->read>(); @@ -9025,7 +9024,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokeFoldHandle2, thunkDetails->getHandleRef()); foldPosition = std::get<0>(stream->read()); } @@ -9054,7 +9053,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokeFilterArgumentsWithCombinerHandleFilterPosition, thunkDetails->getHandleRef()); filterPosition = std::get<0>(stream->read()); } @@ -9117,7 +9116,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokeFinallyHandle, thunkDetails->getHandleRef()); auto recv = stream->read(); numArgsPassToFinallyTarget = std::get<0>(recv); @@ -9168,7 +9167,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokeFilterArgumentsWithCombinerHandleNumSuffixArgs, thunkDetails->getHandleRef()); auto recv = stream->read(); numArguments = std::get<0>(recv); @@ -9207,7 +9206,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokeFilterArgumentsHandle2, thunkDetails->getHandleRef()); auto recv = stream->read(); numArguments = std::get<0>(recv); @@ -9266,7 +9265,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokeFilterArgumentsHandle, thunkDetails->getHandleRef(), knotEnabled); auto recv = stream->read, std::vector, std::vector>(); startPos = std::get<0>(recv); @@ -9421,7 +9420,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::runFEMacro_invokeCatchHandle, thunkDetails->getHandleRef()); numCatchArguments = std::get<0>(stream->read()); } @@ -9452,7 +9451,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); std::vector listOfOffsets; packReferenceChainOffsets(pop(), listOfOffsets); stream->write(JITServer::MessageType::runFEMacro_invokeILGenMacrosParameterCount, thunkDetails->getHandleRef(), listOfOffsets); @@ -9485,7 +9484,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); std::vector listOfOffsets; packReferenceChainOffsets(pop(), listOfOffsets); stream->write(JITServer::MessageType::runFEMacro_invokeILGenMacrosArrayLength, thunkDetails->getHandleRef(), listOfOffsets); @@ -9522,7 +9521,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); std::vector listOfOffsets; packReferenceChainOffsets(baseObjectNode, listOfOffsets); TR_ASSERT(fieldSym->getDataType() == TR::Int32, "ILGenMacros.getField expecting int field; found load of %s", comp()->getDebug()->getName(symRef)); diff --git a/runtime/compiler/optimizer/InterpreterEmulator.cpp b/runtime/compiler/optimizer/InterpreterEmulator.cpp index 6f391c875aa..95bdb12e21d 100644 --- a/runtime/compiler/optimizer/InterpreterEmulator.cpp +++ b/runtime/compiler/optimizer/InterpreterEmulator.cpp @@ -373,14 +373,14 @@ InterpreterEmulator::maintainStackForGetField() #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - TR_ResolvedJ9JITServerMethod *serverMethod = static_cast(_calltarget->_calleeMethod); + TR_ResolvedJ9JITServerMethod *serverMethod = static_cast(_calltarget->_calleeMethod); TR_ResolvedMethod *clientMethod = serverMethod->getRemoteMirror(); - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::KnownObjectTable_dereferenceKnownObjectField, - baseObjectIndex, clientMethod, cpIndex); + baseObjectIndex, clientMethod, cpIndex); - auto recv = stream->read(); + auto recv = stream->read(); resultIndex = std::get<0>(recv); uintptr_t *objectPointerReference = std::get<1>(recv); fieldAddress = std::get<2>(recv); @@ -1016,10 +1016,10 @@ InterpreterEmulator::getReturnValue(TR_ResolvedMethod *callee) #if defined(J9VM_OPT_JITSERVER) if (comp()->isOutOfProcessCompilation()) { - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::KnownObjectTable_dereferenceKnownObjectField2, mutableCallsiteClass, callSiteIndex); - auto recv = stream->read(); + auto recv = stream->read(); resultIndex = std::get<0>(recv); uintptr_t *objectPointerReference = std::get<1>(recv); diff --git a/runtime/compiler/optimizer/J9Inliner.cpp b/runtime/compiler/optimizer/J9Inliner.cpp index 09956de964f..87289a5ad0b 100644 --- a/runtime/compiler/optimizer/J9Inliner.cpp +++ b/runtime/compiler/optimizer/J9Inliner.cpp @@ -1071,10 +1071,10 @@ bool TR_J9MutableCallSite::findCallSiteTarget (TR_CallStack *callStack, TR_Inlin { vgs->_mutableCallSiteEpoch = TR::KnownObjectTable::UNKNOWN; bool knotEnabled = (knot != NULL); - auto stream = comp()->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::KnownObjectTable_mutableCallSiteEpoch, _mcsReferenceLocation, knotEnabled); - auto recv = stream->read(); + auto recv = stream->read(); uintptr_t mcsObject = std::get<0>(recv); TR::KnownObjectTable::Index knotIndex = std::get<1>(recv); uintptr_t *objectPointerReference = std::get<2>(recv); diff --git a/runtime/compiler/runtime/JITServerIProfiler.cpp b/runtime/compiler/runtime/JITServerIProfiler.cpp index 8a14794e7f1..9431f566a20 100644 --- a/runtime/compiler/runtime/JITServerIProfiler.cpp +++ b/runtime/compiler/runtime/JITServerIProfiler.cpp @@ -204,7 +204,7 @@ JITServerIProfiler::profilingSample(TR_OpaqueMethodBlock *method, uint32_t byteC #if defined(DEBUG) || defined(PROD_WITH_ASSUMES) // sanity check // Ask the client again and see if the two sources of information match - auto stream = comp->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::IProfiler_profilingSample, method, byteCodeIndex, (uintptr_t)1); auto recv = stream->read(); auto &ipdata = std::get<0>(recv); @@ -240,7 +240,8 @@ JITServerIProfiler::profilingSample(TR_OpaqueMethodBlock *method, uint32_t byteC } // Now ask the client - auto stream = comp->getStream(); + // + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::IProfiler_profilingSample, method, byteCodeIndex, (uintptr_t)(_useCaching ? 0 : 1)); auto recv = stream->read(); auto &ipdata = std::get<0>(recv); @@ -553,7 +554,7 @@ JITServerIProfiler::setCallCount(TR_OpaqueMethodBlock *method, int32_t bcIndex, } if (sendRemoteMessage) { - auto stream = comp->getStream(); + auto stream = TR::CompilationInfo::getStream(); stream->write(JITServer::MessageType::IProfiler_setCallCount, method, bcIndex, count); auto recv = stream->read(); bool isCompiled = std::get<0>(recv); @@ -581,8 +582,8 @@ void JITServerIProfiler::persistIprofileInfo(TR::ResolvedMethodSymbol *methodSymbol, TR_ResolvedMethod *method, TR::Compilation *comp) { // resolvedMethodSymbol is only used for debugging on the client, so we don't have to send it - auto stream = comp->getStream(); - auto compInfoPT = (TR::CompilationInfoPerThreadRemote *)comp->fej9()->_compInfoPT; + auto stream = TR::CompilationInfo::getStream(); + auto compInfoPT = (TR::CompilationInfoPerThreadRemote *)(comp->fej9()->_compInfoPT); ClientSessionData *clientSessionData = compInfoPT->getClientData(); if (clientSessionData->getOrCacheVMInfo(stream)->_elgibleForPersistIprofileInfo) diff --git a/runtime/compiler/runtime/RelocationRuntime.cpp b/runtime/compiler/runtime/RelocationRuntime.cpp index 51203da147a..e2d8ec5b70a 100644 --- a/runtime/compiler/runtime/RelocationRuntime.cpp +++ b/runtime/compiler/runtime/RelocationRuntime.cpp @@ -707,7 +707,7 @@ TR_RelocationRuntime::relocateAOTCodeAndData(U_8 *tempDataStart, } //end if J9_JIT_DCE_EXCEPTION_INFO #if defined(J9VM_OPT_JITSERVER) - TR_ASSERT_FATAL(!_comp->getStream(), "TR_RelocationRuntime::relocateAOTCodeAndData should not be called at the JITSERVER"); + TR_ASSERT_FATAL(!TR::CompilationInfo::getStream(), "TR_RelocationRuntime::relocateAOTCodeAndData should not be called at the JITSERVER"); #endif /* defined(J9VM_OPT_JITSERVER) */ if (startPC) { diff --git a/runtime/compiler/runtime/SymbolValidationManager.cpp b/runtime/compiler/runtime/SymbolValidationManager.cpp index 400c551fd4a..32e8a0aa7cb 100644 --- a/runtime/compiler/runtime/SymbolValidationManager.cpp +++ b/runtime/compiler/runtime/SymbolValidationManager.cpp @@ -56,11 +56,11 @@ TR::SymbolValidationManager::_systemClassesNotWorthRemembering[] = { { "java/lang/StringBuffer", NULL, false } }; -TR::SymbolValidationManager::SymbolValidationManager(TR::Region ®ion, TR_ResolvedMethod *compilee, TR::Compilation *comp) +TR::SymbolValidationManager::SymbolValidationManager(TR::Region ®ion, TR_ResolvedMethod *compilee) : _symbolID(FIRST_ID), _heuristicRegion(0), _region(region), - _comp(comp), + _comp(TR::comp()), _vmThread(_comp->j9VMThread()), _fej9((TR_J9VM *)TR_J9VMBase::get( _vmThread->javaVM->jitConfig, diff --git a/runtime/compiler/runtime/SymbolValidationManager.hpp b/runtime/compiler/runtime/SymbolValidationManager.hpp index 7080ae2b2d8..481e6d18736 100644 --- a/runtime/compiler/runtime/SymbolValidationManager.hpp +++ b/runtime/compiler/runtime/SymbolValidationManager.hpp @@ -711,9 +711,9 @@ struct IsClassVisibleRecord : public SymbolValidationRecord class SymbolValidationManager { public: - TR_ALLOC(TR_MemoryBase::SymbolValidationManager) + TR_ALLOC(TR_MemoryBase::SymbolValidationManager); - SymbolValidationManager(TR::Region ®ion, TR_ResolvedMethod *compilee, TR::Compilation *comp); + SymbolValidationManager(TR::Region ®ion, TR_ResolvedMethod *compilee); struct SystemClassNotWorthRemembering {