From 62849adc7b4b5924b9b0b5daa74181937fbffb9d Mon Sep 17 00:00:00 2001 From: Christian Despres Date: Tue, 26 Nov 2024 12:10:01 -0500 Subject: [PATCH 1/2] Implement JITServer/AOT cp signature lookup The getClassFromSignature() query using a J9ConstantPool is now supported in all frontends. Signed-off-by: Christian Despres --- .../control/JITClientCompilationThread.cpp | 14 +- runtime/compiler/env/VMJ9.cpp | 40 ++--- runtime/compiler/env/VMJ9.h | 11 +- runtime/compiler/env/VMJ9Server.cpp | 160 +++++------------- runtime/compiler/env/VMJ9Server.hpp | 9 +- runtime/compiler/net/CommunicationStream.hpp | 2 +- 6 files changed, 72 insertions(+), 164 deletions(-) diff --git a/runtime/compiler/control/JITClientCompilationThread.cpp b/runtime/compiler/control/JITClientCompilationThread.cpp index 140261c6bb0..5fa28edf825 100644 --- a/runtime/compiler/control/JITClientCompilationThread.cpp +++ b/runtime/compiler/control/JITClientCompilationThread.cpp @@ -308,15 +308,13 @@ handleServerMessage(JITServer::ClientStream *client, TR_J9VM *fe, JITServer::Mes { // Need to get a non-AOT frontend because the AOT frontend also // performs some class validation which we want to do at the server - TR_J9VMBase *fej9 = TR_J9VMBase::get(vmThread->javaVM->jitConfig, vmThread); - auto recv = client->getRecvData(); + auto fej9 = (TR_J9VM *)TR_J9VMBase::get(vmThread->javaVM->jitConfig, vmThread); + auto recv = client->getRecvData(); auto &sig = std::get<0>(recv); - auto method = std::get<1>(recv); - bool isVettedForAOT = std::get<2>(recv); - auto clazz = fej9->getClassFromSignature(sig.data(), sig.length(), method, isVettedForAOT); - J9ClassLoader *cl = clazz ? reinterpret_cast(fej9->getClassLoader(clazz)) : NULL; - J9ClassLoader *methodCL = reinterpret_cast(fej9->getClassLoader(fej9->getClassOfMethod(method))); - client->write(response, clazz, cl, methodCL); + auto constantPool = std::get<1>(recv); + auto clazz = fej9->getClassFromSignature(sig.data(), sig.length(), constantPool, true); + J9ClassLoader *cl = clazz ? reinterpret_cast(fej9->getClassLoader((TR_OpaqueClassBlock *)clazz)) : NULL; + client->write(response, clazz, cl); } break; case MessageType::VM_jitFieldsOrStaticsAreSame: diff --git a/runtime/compiler/env/VMJ9.cpp b/runtime/compiler/env/VMJ9.cpp index 7575a7ab1d9..bcaea0128ab 100644 --- a/runtime/compiler/env/VMJ9.cpp +++ b/runtime/compiler/env/VMJ9.cpp @@ -7422,12 +7422,20 @@ TR_J9VM::getClassFromSignature(const char * sig, int32_t sigLength, TR_ResolvedM TR_OpaqueClassBlock * TR_J9VM::getClassFromSignature(const char * sig, int32_t sigLength, TR_OpaqueMethodBlock * method, bool isVettedForAOT) { - J9ConstantPool * constantPool = (J9ConstantPool *) (J9_CP_FROM_METHOD((J9Method*)method)); - return getClassFromSignature(sig, sigLength, constantPool); + auto constantPool = (J9ConstantPool *)getConstantPoolFromMethod(method); + return getClassFromSignature(sig, sigLength, constantPool, isVettedForAOT); + } + + +TR_OpaqueClassBlock * +TR_J9VM::getClassFromSignature(const char * sig, int32_t sigLength, TR_OpaqueClassBlock *clazz, bool isVettedForAOT) + { + auto constantPool = (J9ConstantPool *)getConstantPoolFromClass(clazz); + return getClassFromSignature(sig, sigLength, constantPool, isVettedForAOT); } TR_OpaqueClassBlock * -TR_J9VM::getClassFromSignature(const char * sig, int32_t sigLength, J9ConstantPool * constantPool) +TR_J9VM::getClassFromSignature(const char * sig, int32_t sigLength, J9ConstantPool * constantPool, bool isVettedForAOT) { // Primitive types don't have a class associated with them if (isSignatureForPrimitiveType(sig, sigLength)) @@ -9056,34 +9064,18 @@ TR_J9SharedCacheVM::isInstanceOf(TR_OpaqueClassBlock * a, TR_OpaqueClassBlock *b } TR_OpaqueClassBlock * -TR_J9SharedCacheVM::getClassFromSignature(const char * sig, int32_t sigLength, TR_ResolvedMethod * method, bool isVettedForAOT) +TR_J9SharedCacheVM::getClassFromSignature(const char * sig, int32_t sigLength, J9ConstantPool *constantPool, bool isVettedForAOT) { - return getClassFromSignature(sig, sigLength, (TR_OpaqueMethodBlock *)method->getPersistentIdentifier(), isVettedForAOT); - } - -TR_OpaqueClassBlock * -TR_J9SharedCacheVM::getClassFromSignature(const char * sig, int32_t sigLength, TR_OpaqueMethodBlock * method, bool isVettedForAOT) - { - TR_OpaqueClassBlock* j9class = TR_J9VM::getClassFromSignature(sig, sigLength, method, true); + TR_OpaqueClassBlock* j9class = TR_J9VM::getClassFromSignature(sig, sigLength, constantPool, isVettedForAOT); bool validated = false; TR::Compilation* comp = TR::comp(); if (j9class) { if (comp->getOption(TR_UseSymbolValidationManager)) - { - TR::SymbolValidationManager *svm = comp->getSymbolValidationManager(); - SVM_ASSERT_ALREADY_VALIDATED(svm, method); - validated = svm->addClassByNameRecord(j9class, getClassFromMethodBlock(method)); - } - else - { - if (isVettedForAOT) - { - if (((TR_ResolvedRelocatableJ9Method *) comp->getCurrentMethod())->validateArbitraryClass(comp, (J9Class *) j9class)) - validated = true; - } - } + validated = comp->getSymbolValidationManager()->addClassByNameRecord(j9class, getClassFromCP(constantPool)); + else if (isVettedForAOT) + validated = ((TR_ResolvedRelocatableJ9Method *) comp->getCurrentMethod())->validateArbitraryClass(comp, (J9Class *) j9class); } if (validated) diff --git a/runtime/compiler/env/VMJ9.h b/runtime/compiler/env/VMJ9.h index ee51cb39e56..a7b57e42501 100644 --- a/runtime/compiler/env/VMJ9.h +++ b/runtime/compiler/env/VMJ9.h @@ -1573,8 +1573,10 @@ class TR_J9VM : public TR_J9VMBase virtual TR_OpaqueClassBlock * getNullRestrictedArrayClassFromComponentClass(TR_OpaqueClassBlock *componentClass); virtual TR_OpaqueClassBlock * getLeafComponentClassFromArrayClass(TR_OpaqueClassBlock * arrayClass); virtual int32_t getNewArrayTypeFromClass(TR_OpaqueClassBlock *clazz); - virtual TR_OpaqueClassBlock * getClassFromSignature(const char * sig, int32_t length, TR_ResolvedMethod *method, bool isVettedForAOT=false); - virtual TR_OpaqueClassBlock * getClassFromSignature(const char * sig, int32_t length, TR_OpaqueMethodBlock *method, bool isVettedForAOT=false); + virtual TR_OpaqueClassBlock *getClassFromSignature(const char * sig, int32_t sigLength, TR_ResolvedMethod *method, bool isVettedForAOT=false); + virtual TR_OpaqueClassBlock *getClassFromSignature(const char * sig, int32_t sigLength, TR_OpaqueMethodBlock *method, bool isVettedForAOT=false); + virtual TR_OpaqueClassBlock *getClassFromSignature(const char * sig, int32_t sigLength, TR_OpaqueClassBlock *clazz, bool isVettedForAOT=false); + virtual TR_OpaqueClassBlock *getClassFromSignature(const char * sig, int32_t sigLength, J9ConstantPool * constantPool, bool isVettedForAOT=false); virtual TR_OpaqueClassBlock *getBaseComponentClass(TR_OpaqueClassBlock *clazz, int32_t &numDims) { @@ -1615,8 +1617,6 @@ class TR_J9VM : public TR_J9VMBase virtual TR_StaticFinalData dereferenceStaticFinalAddress(void *staticAddress, TR::DataType addressType); - TR_OpaqueClassBlock * getClassFromSignature(const char * sig, int32_t sigLength, J9ConstantPool * constantPool); - private: void transformJavaLangClassIsArrayOrIsPrimitive( TR::Compilation *, TR::Node * callNode, TR::TreeTop * treeTop, int32_t andMask); void transformJavaLangClassIsArray( TR::Compilation *, TR::Node * callNode, TR::TreeTop * treeTop); @@ -1715,8 +1715,7 @@ class TR_J9SharedCacheVM : public TR_J9VM virtual bool isClassVisible(TR_OpaqueClassBlock * sourceClass, TR_OpaqueClassBlock * destClass); virtual bool isPrimitiveArray(TR_OpaqueClassBlock *); virtual bool isReferenceArray(TR_OpaqueClassBlock *); - virtual TR_OpaqueClassBlock * getClassFromSignature(const char * sig, int32_t length, TR_ResolvedMethod *method, bool isVettedForAOT=false); - virtual TR_OpaqueClassBlock * getClassFromSignature(const char * sig, int32_t length, TR_OpaqueMethodBlock *method, bool isVettedForAOT=false); + virtual TR_OpaqueClassBlock * getClassFromSignature(const char * sig, int32_t length, J9ConstantPool *constantPool, bool isVettedForAOT=false); virtual TR_OpaqueClassBlock * getSystemClassFromClassName(const char * name, int32_t length, bool isVettedForAOT=false); virtual intptr_t methodTrampolineLookup( TR::Compilation *, TR::SymbolReference *symRef, void *callSite); diff --git a/runtime/compiler/env/VMJ9Server.cpp b/runtime/compiler/env/VMJ9Server.cpp index ecb9a1389e5..3c1b7379904 100644 --- a/runtime/compiler/env/VMJ9Server.cpp +++ b/runtime/compiler/env/VMJ9Server.cpp @@ -348,26 +348,49 @@ TR_J9ServerVM::getLeafComponentClassFromArrayClass(TR_OpaqueClassBlock * arrayCl } TR_OpaqueClassBlock * -TR_J9ServerVM::getClassFromSignature(const char *sig, int32_t length, TR_ResolvedMethod *method, bool isVettedForAOT) +TR_J9ServerVM::getClassFromSignature(const char *sig, int32_t sigLength, J9ConstantPool *constantPool, bool isVettedForAOT) { // Primitive types don't have a class associated with them - if (isSignatureForPrimitiveType(sig, length)) + if (isSignatureForPrimitiveType(sig, sigLength)) return NULL; - TR_OpaqueClassBlock * clazz = NULL; - J9ClassLoader * cl = ((TR_ResolvedJ9Method *)method)->getClassLoader(); - ClassLoaderStringPair key = {cl, std::string(sig, length)}; - PersistentUnorderedMap & classBySignatureMap = _compInfoPT->getClientData()->getClassBySignatureMap(); + auto cpClass = getClassFromCP(constantPool); + auto cpClassLoader = (J9ClassLoader *)getClassLoader(cpClass); + + ClassLoaderStringPair key = {cpClassLoader, std::string(sig, sigLength)}; + PersistentUnorderedMap & classBySignatureMap = _compInfoPT->getClientData()->getClassBySignatureMap(); { OMR::CriticalSection classFromSigCS(_compInfoPT->getClientData()->getClassMapMonitor()); auto it = classBySignatureMap.find(key); if (it != classBySignatureMap.end()) return it->second; } + // classname not found; ask the client and cache the answer - clazz = getClassFromSignature(sig, length, (TR_OpaqueMethodBlock *)method->getPersistentIdentifier(), isVettedForAOT); + JITServer::ServerStream *stream = _compInfoPT->getMethodBeingCompiled()->_stream; + std::string str(sig, sigLength); + stream->write(JITServer::MessageType::VM_getClassFromSignature, str, constantPool); + auto recv = stream->read(); + TR_OpaqueClassBlock *clazz = std::get<0>(recv); + J9ClassLoader *cl = std::get<1>(recv); if (clazz) { + if (cl != cpClassLoader) + { + // make sure that the class is cached + J9ROMClass *romClass = TR::Compiler->cls.romClassOf((TR_OpaqueClassBlock *)clazz); + TR_ASSERT_FATAL(romClass, "class %p could not be cached", clazz); + OMR::CriticalSection getRemoteROMClass(_compInfoPT->getClientData()->getROMMapMonitor()); + auto it = _compInfoPT->getClientData()->getROMClassMap().find(reinterpret_cast(clazz)); + if (it != _compInfoPT->getClientData()->getROMClassMap().end()) + { + // remember that we cached this class by cp class loader + // so that the cache entry is removed if the cached class gets unloaded + // if the class loaders are not identical + it->second._referencingClassLoaders.insert(cpClassLoader); + } + } + OMR::CriticalSection classFromSigCS(_compInfoPT->getClientData()->getClassMapMonitor()); classBySignatureMap[key] = clazz; } @@ -383,39 +406,6 @@ TR_J9ServerVM::getClassFromSignature(const char *sig, int32_t length, TR_Resolve return clazz; } - -TR_OpaqueClassBlock * -TR_J9ServerVM::getClassFromSignature(const char *sig, int32_t length, TR_OpaqueMethodBlock *method, bool isVettedForAOT) - { - // Primitive types don't have a class associated with them - if (isSignatureForPrimitiveType(sig, length)) - return NULL; - - JITServer::ServerStream *stream = _compInfoPT->getMethodBeingCompiled()->_stream; - std::string str(sig, length); - stream->write(JITServer::MessageType::VM_getClassFromSignature, str, method, isVettedForAOT); - auto recv = stream->read(); - TR_OpaqueClassBlock *clazz = std::get<0>(recv); - J9ClassLoader *cl = std::get<1>(recv); - J9ClassLoader *methodClassLoader = std::get<2>(recv); - if (clazz && cl != methodClassLoader) - { - // make sure that the class is cached - J9ROMClass *romClass = TR::Compiler->cls.romClassOf(clazz); - TR_ASSERT_FATAL(romClass, "class %p could not be cached", clazz); - OMR::CriticalSection getRemoteROMClass(_compInfoPT->getClientData()->getROMMapMonitor()); - auto it = _compInfoPT->getClientData()->getROMClassMap().find(reinterpret_cast(clazz)); - if (it != _compInfoPT->getClientData()->getROMClassMap().end()) - { - // remember that we cached this class by method class loader - // so that the cache entry is removed if the cached class gets unloaded - // if the class loaders are not identical - it->second._referencingClassLoaders.insert(methodClassLoader); - } - } - return clazz; - } - void * TR_J9ServerVM::getSystemClassLoader() { @@ -2817,91 +2807,25 @@ TR_J9SharedCacheServerVM::supportAllocationInlining(TR::Compilation *comp, TR::N } TR_OpaqueClassBlock * -TR_J9SharedCacheServerVM::getClassFromSignature(const char * sig, int32_t sigLength, TR_ResolvedMethod * method, bool isVettedForAOT) +TR_J9SharedCacheServerVM::getClassFromSignature(const char *sig, int32_t sigLength, J9ConstantPool *constantPool, bool isVettedForAOT) { - // Primitive types don't have a class associated with them - if (isSignatureForPrimitiveType(sig, sigLength)) - return NULL; - - TR_ResolvedRelocatableJ9JITServerMethod* resolvedJITServerMethod = (TR_ResolvedRelocatableJ9JITServerMethod *)method; - TR_OpaqueClassBlock* clazz = NULL; - J9ClassLoader * cl = ((TR_ResolvedJ9Method *)method)->getClassLoader(); - ClassLoaderStringPair key = {cl, std::string(sig, sigLength)}; - PersistentUnorderedMap & classBySignatureMap = _compInfoPT->getClientData()->getClassBySignatureMap(); - { - OMR::CriticalSection classFromSigCS(_compInfoPT->getClientData()->getClassMapMonitor()); - auto it = classBySignatureMap.find(key); - if (it != classBySignatureMap.end()) - clazz = it->second; - } - if (!clazz) - { - // classname not found; ask the client and cache the answer - clazz = TR_J9ServerVM::getClassFromSignature(sig, sigLength, (TR_OpaqueMethodBlock *)resolvedJITServerMethod->getPersistentIdentifier(), isVettedForAOT); - if (clazz) - { - { - OMR::CriticalSection classFromSigCS(_compInfoPT->getClientData()->getClassMapMonitor()); - classBySignatureMap[key] = clazz; - } - if (!validateClass((TR_OpaqueMethodBlock *)resolvedJITServerMethod->getPersistentIdentifier(), clazz, isVettedForAOT)) - { - clazz = NULL; - } - } - else - { - // Class with given name does not exist yet, but it could be - // loaded in the future, thus we should not cache NULL pointers. - // Note: many times we get in here due to Ljava/lang/String$StringCompressionFlag; - // In theory we could consider this a special case and watch the CHTable updates - // for a class load event for Ljava/lang/String$StringCompressionFlag, but it may not - // be worth the trouble. - //printf("ErrorSystem %lu for cl=%p\tclassName=%.*s\n", ++errorsSystem, cl, length, sig); - } - } - else - { - if (!validateClass((TR_OpaqueMethodBlock *)resolvedJITServerMethod->getPersistentIdentifier(), clazz, isVettedForAOT)) - clazz = NULL; - } - return clazz; - } + auto comp = _compInfoPT->getCompilation(); + auto j9class = TR_J9ServerVM::getClassFromSignature(sig, sigLength, constantPool, isVettedForAOT); + bool validated = false; -TR_OpaqueClassBlock * -TR_J9SharedCacheServerVM::getClassFromSignature(const char * sig, int32_t sigLength, TR_OpaqueMethodBlock * method, bool isVettedForAOT) - { - TR_OpaqueClassBlock* j9class = TR_J9ServerVM::getClassFromSignature(sig, sigLength, method, true); if (j9class) { - if (!validateClass(method, j9class, isVettedForAOT)) - j9class = NULL; + if (comp->getOption(TR_UseSymbolValidationManager)) + validated = comp->getSymbolValidationManager()->addClassByNameRecord(j9class, getClassFromCP(constantPool)); + else if (isVettedForAOT) + validated = ((TR_ResolvedRelocatableJ9JITServerMethod *) comp->getCurrentMethod())->validateArbitraryClass(comp, (J9Class *) j9class); } - return j9class; - } - -bool -TR_J9SharedCacheServerVM::validateClass(TR_OpaqueMethodBlock * method, TR_OpaqueClassBlock* j9class, bool isVettedForAOT) - { - TR::Compilation* comp = _compInfoPT->getCompilation(); - bool validated = false; - - if (comp->getOption(TR_UseSymbolValidationManager)) - { - TR::SymbolValidationManager *svm = comp->getSymbolValidationManager(); - SVM_ASSERT_ALREADY_VALIDATED(svm, method); - validated = svm->addClassByNameRecord(j9class, getClassFromMethodBlock(method)); - } + if (validated) + return j9class; else - { - if (isVettedForAOT) - { - if (((TR_ResolvedRelocatableJ9JITServerMethod *) comp->getCurrentMethod())->validateArbitraryClass(comp, (J9Class *) j9class)) - validated = true; - } - } - return validated; + return NULL; + } bool diff --git a/runtime/compiler/env/VMJ9Server.hpp b/runtime/compiler/env/VMJ9Server.hpp index 2766fde1b52..6d5f432bfb8 100644 --- a/runtime/compiler/env/VMJ9Server.hpp +++ b/runtime/compiler/env/VMJ9Server.hpp @@ -80,8 +80,7 @@ class TR_J9ServerVM: public TR_J9VM virtual TR_OpaqueClassBlock * getClassOfMethod(TR_OpaqueMethodBlock *method) override; virtual TR_OpaqueClassBlock * getBaseComponentClass(TR_OpaqueClassBlock * clazz, int32_t & numDims) override; virtual TR_OpaqueClassBlock * getLeafComponentClassFromArrayClass(TR_OpaqueClassBlock * arrayClass) override; - virtual TR_OpaqueClassBlock * getClassFromSignature(const char *sig, int32_t length, TR_ResolvedMethod *method, bool isVettedForAOT) override; - virtual TR_OpaqueClassBlock * getClassFromSignature(const char *sig, int32_t length, TR_OpaqueMethodBlock *method, bool isVettedForAOT) override; + virtual TR_OpaqueClassBlock *getClassFromSignature(const char *sig, int32_t length, J9ConstantPool *constantPool, bool isVettedForAOT = false) override; virtual void * getSystemClassLoader() override; virtual bool jitFieldsAreSame(TR_ResolvedMethod * method1, I_32 cpIndex1, TR_ResolvedMethod * method2, I_32 cpIndex2, int32_t isStatic) override; virtual bool jitStaticsAreSame(TR_ResolvedMethod *method1, I_32 cpIndex1, TR_ResolvedMethod *method2, I_32 cpIndex2) override; @@ -348,8 +347,7 @@ class TR_J9SharedCacheServerVM: public TR_J9ServerVM virtual TR_OpaqueMethodBlock *getMethodFromClass(TR_OpaqueClassBlock *, const char *, const char *, TR_OpaqueClassBlock * = NULL) override; virtual bool supportAllocationInlining(TR::Compilation *comp, TR::Node *node) override; virtual TR_YesNoMaybe isInstanceOf(TR_OpaqueClassBlock *instanceClass, TR_OpaqueClassBlock *castClass, bool instanceIsFixed, bool castIsFixed = true, bool optimizeForAOT = false) override; - virtual TR_OpaqueClassBlock *getClassFromSignature(const char *sig, int32_t length, TR_ResolvedMethod *method, bool isVettedForAOT = false) override; - virtual TR_OpaqueClassBlock *getClassFromSignature(const char *sig, int32_t length, TR_OpaqueMethodBlock *method, bool isVettedForAOT = false) override; + virtual TR_OpaqueClassBlock *getClassFromSignature(const char *sig, int32_t length, J9ConstantPool *constantPool, bool isVettedForAOT = false) override; virtual TR_OpaqueClassBlock *getSystemClassFromClassName(const char *name, int32_t length, bool isVettedForAOT = false) override; virtual TR_OpaqueClassBlock *getProfiledClassFromProfiledInfo(TR_ExtraAddressInfo *profiledInfo) override; virtual bool isPublicClass(TR_OpaqueClassBlock *clazz) override; @@ -390,9 +388,6 @@ class TR_J9SharedCacheServerVM: public TR_J9ServerVM virtual TR_OpaqueMethodBlock *getResolvedVirtualMethod(TR_OpaqueClassBlock *classObject, int32_t cpIndex, bool ignoreReResolve = true) override; virtual TR_OpaqueMethodBlock *getResolvedInterfaceMethod(TR_OpaqueMethodBlock *ownerMethod, TR_OpaqueClassBlock *classObject, int32_t cpIndex) override; -protected : - bool validateClass(TR_OpaqueMethodBlock * method, TR_OpaqueClassBlock* j9class, bool isVettedForAOT); - }; #endif // VMJ9SERVER_H diff --git a/runtime/compiler/net/CommunicationStream.hpp b/runtime/compiler/net/CommunicationStream.hpp index e12dcadaa0d..a33fde23a94 100644 --- a/runtime/compiler/net/CommunicationStream.hpp +++ b/runtime/compiler/net/CommunicationStream.hpp @@ -128,7 +128,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 = 73; // ID: AwP1pJjbiAVBRCpcwuDt + static const uint16_t MINOR_NUMBER = 74; // ID: Qi304qaThEQ4NoZZkw1O static const uint8_t PATCH_NUMBER = 0; static uint32_t CONFIGURATION_FLAGS; From f8a959b8e2a5f3d03e5e74859b72262b25cddaa5 Mon Sep 17 00:00:00 2001 From: Christian Despres Date: Tue, 26 Nov 2024 12:53:45 -0500 Subject: [PATCH 2/2] Set declared class in shadow with new query Signed-off-by: Christian Despres --- .../compile/J9SymbolReferenceTable.cpp | 26 +++---------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/runtime/compiler/compile/J9SymbolReferenceTable.cpp b/runtime/compiler/compile/J9SymbolReferenceTable.cpp index b7bacc5f199..1d49c7b658c 100644 --- a/runtime/compiler/compile/J9SymbolReferenceTable.cpp +++ b/runtime/compiler/compile/J9SymbolReferenceTable.cpp @@ -826,30 +826,10 @@ J9::SymbolReferenceTable::findOrFabricateShadowSymbol( qualifiedFieldName, TR::Symbol::UnknownField); - // As yet JITServer does not support getClassFromSignature() based directly - // on J9ConstantPool*, but it does support it using TR_OpaqueMethodBlock*. - // Find an arbitrary method (if there is one) defined by the same class that - // declares the field, and use that method to getClassFromSignature(), since - // it will have the desired constant pool. - // - // The class containing the field is highly likely to declare at least a - // constructor, and if it doesn't, then it seems that it's not possible to - // instantiate it in the usual way (new, dup, invokespecial ), so the - // performance of accesses to its instance fields is especially unlikely to - // matter. - // TR_J9VM *fej9 = reinterpret_cast(fe()); - if (fej9->getNumMethods(containingClass) > 0) - { - auto *firstMethod = - static_cast(fej9->getMethods(containingClass)); - - TR_OpaqueClassBlock *declaredClass = fej9->getClassFromSignature( - signature, (int32_t)strlen(signature), firstMethod); - - if (declaredClass != NULL) - sym->setDeclaredClass(declaredClass); - } + TR_OpaqueClassBlock *declaredClass = fej9->getClassFromSignature(signature, (int32_t)strlen(signature), containingClass); + if (declaredClass != NULL) + sym->setDeclaredClass(declaredClass); mcount_t methodIndex = mcount_t::valueOf(0); int32_t cpIndex = -1;