diff --git a/runtime/compiler/control/JITClientCompilationThread.cpp b/runtime/compiler/control/JITClientCompilationThread.cpp index c628f38610a..57080b99ed5 100644 --- a/runtime/compiler/control/JITClientCompilationThread.cpp +++ b/runtime/compiler/control/JITClientCompilationThread.cpp @@ -486,6 +486,8 @@ handleServerMessage(JITServer::ClientStream *client, TR_J9VM *fe, JITServer::Mes // These offsets are initialized later on vmInfo._vmtargetOffset = 0; vmInfo._vmindexOffset = 0; + vmInfo._shareLambdaForm + = J9_ARE_ALL_BITS_SET(javaVM->sharedClassConfig->runtimeFlags2, J9SHR_RUNTIMEFLAG2_SHARE_LAMBDAFORM); #endif /* defined(J9VM_OPT_OPENJDK_METHODHANDLE) */ } diff --git a/runtime/compiler/env/j9method.cpp b/runtime/compiler/env/j9method.cpp index c6ec9973134..7781de5b152 100644 --- a/runtime/compiler/env/j9method.cpp +++ b/runtime/compiler/env/j9method.cpp @@ -1294,6 +1294,30 @@ TR_ResolvedRelocatableJ9Method::isUnresolvedMethodHandle(I_32 cpIndex) return true; } +bool +TR_ResolvedRelocatableJ9Method::isUnresolvedCallSiteTableEntry(int32_t callSiteIndex) + { + bool unresolved = true; + J9JavaVM * javaVM = fej9()->_jitConfig->javaVM; + if (J9_ARE_ALL_BITS_SET(javaVM->sharedClassConfig->runtimeFlags2, J9SHR_RUNTIMEFLAG2_SHARE_LAMBDAFORM)) + { + unresolved = TR_ResolvedJ9Method::isUnresolvedCallSiteTableEntry(callSiteIndex); + } + return unresolved; + } + +bool +TR_ResolvedRelocatableJ9Method::isUnresolvedMethodTypeTableEntry(int32_t cpIndex) + { + bool unresolved = true; + J9JavaVM * javaVM = fej9()->_jitConfig->javaVM; + if (J9_ARE_ALL_BITS_SET(javaVM->sharedClassConfig->runtimeFlags2, J9SHR_RUNTIMEFLAG2_SHARE_LAMBDAFORM)) + { + unresolved = TR_ResolvedJ9Method::isUnresolvedMethodTypeTableEntry(cpIndex); + } + return unresolved; + } + TR_ResolvedMethod * TR_ResolvedRelocatableJ9Method::getResolvedPossiblyPrivateVirtualMethod( TR::Compilation *comp, diff --git a/runtime/compiler/env/j9method.h b/runtime/compiler/env/j9method.h index f12cb69592c..783be767574 100644 --- a/runtime/compiler/env/j9method.h +++ b/runtime/compiler/env/j9method.h @@ -604,8 +604,8 @@ class TR_ResolvedRelocatableJ9Method : public TR_ResolvedJ9Method virtual bool isUnresolvedMethodType(int32_t cpIndex); virtual void * methodHandleConstant(int32_t cpIndex); virtual bool isUnresolvedMethodHandle(int32_t cpIndex); - virtual bool isUnresolvedCallSiteTableEntry(int32_t callSiteIndex) { return true; } - virtual bool isUnresolvedMethodTypeTableEntry(int32_t cpIndex) { return true; } + virtual bool isUnresolvedCallSiteTableEntry(int32_t callSiteIndex); + virtual bool isUnresolvedMethodTypeTableEntry(int32_t cpIndex); virtual bool fieldAttributes ( TR::Compilation *, int32_t cpIndex, uint32_t * fieldOffset, TR::DataType * type, bool * volatileP, bool * isFinal, bool *isPrivate, bool isStore, bool * unresolvedInCP, bool needsAOTValidation); diff --git a/runtime/compiler/env/j9methodServer.cpp b/runtime/compiler/env/j9methodServer.cpp index f400eb25e30..7a43158fbba 100644 --- a/runtime/compiler/env/j9methodServer.cpp +++ b/runtime/compiler/env/j9methodServer.cpp @@ -2324,6 +2324,34 @@ TR_ResolvedRelocatableJ9JITServerMethod::isUnresolvedMethodHandle(I_32 cpIndex) return true; } +bool +TR_ResolvedRelocatableJ9JITServerMethod::isUnresolvedMethodTypeTableEntry(int32_t cpIndex) + { + bool unresolved = true; +#if defined(J9VM_OPT_OPENJDK_METHODHANDLE) + auto *vmInfo = _fe->_compInfoPT->getClientData()->getOrCacheVMInfo(_stream); + if (vmInfo->_shareLambdaForm) + { + unresolved = TR_ResolvedJ9JITServerMethod::isUnresolvedMethodTypeTableEntry(cpIndex); + } +#endif // defined(J9VM_OPT_OPENJDK_METHODHANDLE) + return unresolved; + } + +bool +TR_ResolvedRelocatableJ9JITServerMethod::isUnresolvedCallSiteTableEntry(int32_t callSiteIndex) + { + bool unresolved = true; +#if defined(J9VM_OPT_OPENJDK_METHODHANDLE) + auto *vmInfo = _fe->_compInfoPT->getClientData()->getOrCacheVMInfo(_stream); + if (vmInfo->_shareLambdaForm) + { + unresolved = TR_ResolvedJ9JITServerMethod::isUnresolvedCallSiteTableEntry(callSiteIndex); + } +#endif // defined(J9VM_OPT_OPENJDK_METHODHANDLE) + return unresolved; + } + TR_OpaqueClassBlock * TR_ResolvedRelocatableJ9JITServerMethod::getDeclaringClassFromFieldOrStatic(TR::Compilation *comp, int32_t cpIndex) { diff --git a/runtime/compiler/env/j9methodServer.hpp b/runtime/compiler/env/j9methodServer.hpp index c8ee41c9b77..137ead3509b 100644 --- a/runtime/compiler/env/j9methodServer.hpp +++ b/runtime/compiler/env/j9methodServer.hpp @@ -305,8 +305,8 @@ class TR_ResolvedRelocatableJ9JITServerMethod : public TR_ResolvedJ9JITServerMet virtual bool isUnresolvedMethodType(int32_t cpIndex) override; virtual void * methodHandleConstant(int32_t cpIndex) override; virtual bool isUnresolvedMethodHandle(int32_t cpIndex) override; - virtual bool isUnresolvedMethodTypeTableEntry(int32_t cpIndex) override { return true; } - virtual bool isUnresolvedCallSiteTableEntry(int32_t callSiteIndex) override { return true; } + virtual bool isUnresolvedMethodTypeTableEntry(int32_t cpIndex) override; + virtual bool isUnresolvedCallSiteTableEntry(int32_t callSiteIndex) override; virtual TR_OpaqueClassBlock * classOfStatic(int32_t cpIndex, bool returnClassForAOT = false) override; virtual TR_ResolvedMethod * getResolvedPossiblyPrivateVirtualMethod(TR::Compilation *, int32_t cpIndex, bool ignoreRtResolve, bool * unresolvedInCP) override; virtual bool getUnresolvedFieldInCP(I_32 cpIndex) override; diff --git a/runtime/compiler/net/CommunicationStream.hpp b/runtime/compiler/net/CommunicationStream.hpp index 16bf18bcd51..3f59838815b 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 = 68; // ID: +/QzEedP8cjGovxgYECy + static const uint16_t MINOR_NUMBER = 69; // ID: cjOJxfB0gLzZjLsJn4og static const uint8_t PATCH_NUMBER = 0; static uint32_t CONFIGURATION_FLAGS; diff --git a/runtime/compiler/runtime/JITClientSession.hpp b/runtime/compiler/runtime/JITClientSession.hpp index e5c7a1f7988..ac63f702b3b 100644 --- a/runtime/compiler/runtime/JITClientSession.hpp +++ b/runtime/compiler/runtime/JITClientSession.hpp @@ -318,6 +318,7 @@ class ClientSessionData #if defined(J9VM_OPT_OPENJDK_METHODHANDLE) UDATA _vmtargetOffset; UDATA _vmindexOffset; + bool _shareLambdaForm; #endif /* defined(J9VM_OPT_OPENJDK_METHODHANDLE) */ bool _useAOTCache; // Should we use server offsets (idAndType of AOT cache serialization records) instead of