Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add override to virtual methods of TR_J9SharedCache and TR_J9VMBase #20710

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions runtime/compiler/env/J9SharedCache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class TR_J9SharedCache : public TR_SharedCache
virtual uint16_t getAllEnabledHints(J9Method *method);
virtual void addHint(J9Method *, TR_SharedCacheHint);
virtual void addHint(TR_ResolvedMethod *, TR_SharedCacheHint);
virtual bool isMostlyFull();
virtual bool isMostlyFull() override;

static void validateAOTHeader(J9JITConfig *jitConfig, J9VMThread *vmThread, TR::CompilationInfo *compInfo);

Expand Down Expand Up @@ -144,7 +144,7 @@ class TR_J9SharedCache : public TR_SharedCache
* \param[in] offset The offset to convert.
* \return A pointer. Raises a fatal assertion before returning NULL if the offset is invalid.
*/
virtual void *pointerFromOffsetInSharedCache(uintptr_t offset);
virtual void *pointerFromOffsetInSharedCache(uintptr_t offset) override;

/**
* \brief Converts a pointer into the metadata section of the SCC into an offset, calculated
Expand All @@ -153,69 +153,69 @@ class TR_J9SharedCache : public TR_SharedCache
* \param[in] ptr The pointer to convert.
* \return An offset. Raises a fatal assertion before returning 0 if the pointer is invalid.
*/
virtual uintptr_t offsetInSharedCacheFromPointer(void *ptr);
virtual uintptr_t offsetInSharedCacheFromPointer(void *ptr) override;

/**
* \brief Converts an offset into the ROMClass section into a J9ROMClass *.
*
* \param[in] offset The offset to convert.
* \return A J9ROMClass *. Raises a fatal assertion before returning NULL if the offset is invalid.
*/
virtual J9ROMClass *romClassFromOffsetInSharedCache(uintptr_t offset);
virtual J9ROMClass *romClassFromOffsetInSharedCache(uintptr_t offset) override;

/**
* \brief Converts a J9ROMClass * pointer into the SCC into an offset.
*
* \param[in] romClass The J9ROMClass * to convert
* \return An offset. Raises a fatal assertion before returning 0 if the pointer is invalid.
*/
virtual uintptr_t offsetInSharedCacheFromROMClass(J9ROMClass *romClass);
virtual uintptr_t offsetInSharedCacheFromROMClass(J9ROMClass *romClass) override;

/**
* \brief Converts an offset into the ROMClass section into a J9ROMMethod *.
*
* \param[in] offset The offset to convert
* \return A J9ROMMethod *. Raises a fatal assertion before returning NULL if the offset is invalid.
*/
virtual J9ROMMethod *romMethodFromOffsetInSharedCache(uintptr_t offset);
virtual J9ROMMethod *romMethodFromOffsetInSharedCache(uintptr_t offset) override;

/**
* \brief Converts a J9ROMMethod * pointer into the SCC into an offset.
*
* \param[in] romMethod The J9ROMMethod * to convert
* \return An offset. Raises a fatal assertion before returning INVALID_ROM_METHOD_OFFSET if the pointer is invalid.
*/
virtual uintptr_t offsetInSharedCacheFromROMMethod(J9ROMMethod *romMethod);
virtual uintptr_t offsetInSharedCacheFromROMMethod(J9ROMMethod *romMethod) override;

/**
* \brief Converts an offset into the ROMClass section into a pointer.
*
* \param[in] offset The offset to convert
* \return A pointer. Raises a fatal assertion before returning NULL if the offset is invalid.
*/
virtual void *ptrToROMClassesSectionFromOffsetInSharedCache(uintptr_t offset);
virtual void *ptrToROMClassesSectionFromOffsetInSharedCache(uintptr_t offset) override;

/**
* \brief Converts a pointer into the ROM Classes section of the SCC into an offset.
*
* \param[in] ptr The pointer to convert
* \return An offset. Raises a fatal assertion before returning 0 if the pointer is invalid.
*/
virtual uintptr_t offsetInSharedCacheFromPtrToROMClassesSection(void *ptr);
virtual uintptr_t offsetInSharedCacheFromPtrToROMClassesSection(void *ptr) override;


virtual void persistIprofileInfo(TR::ResolvedMethodSymbol *, TR::Compilation *comp);
virtual void persistIprofileInfo(TR::ResolvedMethodSymbol *, TR_ResolvedMethod*, TR::Compilation *comp);
virtual void persistIprofileInfo(TR::ResolvedMethodSymbol *, TR::Compilation *comp) override;
virtual void persistIprofileInfo(TR::ResolvedMethodSymbol *, TR_ResolvedMethod*, TR::Compilation *comp) override;

static const uint32_t maxClassChainLength = 32;

virtual bool canRememberClass(TR_OpaqueClassBlock *classPtr)
virtual bool canRememberClass(TR_OpaqueClassBlock *classPtr) override
{
return rememberClass((J9Class *)classPtr, NULL, false) != TR_SharedCache::INVALID_CLASS_CHAIN_OFFSET;
}

virtual uintptr_t rememberClass(TR_OpaqueClassBlock *classPtr,
const AOTCacheClassChainRecord **classChainRecord = NULL)
const AOTCacheClassChainRecord **classChainRecord = NULL) override
{
return rememberClass((J9Class *)classPtr, classChainRecord, true);
}
Expand All @@ -227,7 +227,7 @@ class TR_J9SharedCache : public TR_SharedCache
virtual const char *getDebugCounterName(UDATA offset);

virtual bool classMatchesCachedVersion(J9Class *clazz, UDATA *chainData=NULL);
virtual bool classMatchesCachedVersion(TR_OpaqueClassBlock *classPtr, UDATA *chainData=NULL)
virtual bool classMatchesCachedVersion(TR_OpaqueClassBlock *classPtr, UDATA *chainData=NULL) override
{
return classMatchesCachedVersion((J9Class *) classPtr, chainData);
}
Expand All @@ -239,9 +239,9 @@ class TR_J9SharedCache : public TR_SharedCache
* \param[in] chainData The pointer to convert, which should have come from pointerFromOffsetInSharedCache().
* \return A pointer. Raises a fatal assertion before returning NULL if the pointer is invalid.
*/
virtual void *lookupClassLoaderAssociatedWithClassChain(void *chainData);
virtual void *lookupClassLoaderAssociatedWithClassChain(void *chainData) override;
virtual TR_OpaqueClassBlock *lookupClassFromChainAndLoader(uintptr_t *chainData, void *classLoader,
TR::Compilation *comp);
TR::Compilation *comp) override;

/**
* \brief Checks whether the specified pointer points into the metadata section
Expand All @@ -255,7 +255,7 @@ class TR_J9SharedCache : public TR_SharedCache
* the SCC.
* \return True if the pointer points into the shared cache, false otherwise.
*/
virtual bool isPointerInSharedCache(void *ptr, uintptr_t *cacheOffset = NULL);
virtual bool isPointerInSharedCache(void *ptr, uintptr_t *cacheOffset = NULL) override;

/**
* \brief Checks whether the specified offset, calculated from the end of the SCC,
Expand All @@ -267,7 +267,7 @@ class TR_J9SharedCache : public TR_SharedCache
* here. If offset is not within the shared cache this parameter is ignored.
* \return True if the offset is within the shared cache, false otherwise.
*/
virtual bool isOffsetInSharedCache(uintptr_t encoded_offset, void *ptr = NULL);
virtual bool isOffsetInSharedCache(uintptr_t encoded_offset, void *ptr = NULL) override;

/**
* \brief Checks whether the J9ROMClass underlying the given class exists in the SCC
Expand All @@ -279,7 +279,7 @@ class TR_J9SharedCache : public TR_SharedCache
* parameter is ignored.
* \return True if romClass points into the SCC, false otherwise.
*/
virtual bool isClassInSharedCache(TR_OpaqueClassBlock *clazz, uintptr_t *cacheOffset = NULL);
virtual bool isClassInSharedCache(TR_OpaqueClassBlock *clazz, uintptr_t *cacheOffset = NULL) override;
virtual bool isClassInSharedCache(J9Class *clazz, uintptr_t *cacheOffset = NULL)
{ return isClassInSharedCache(reinterpret_cast<TR_OpaqueClassBlock *>(clazz), cacheOffset); }

Expand All @@ -293,7 +293,7 @@ class TR_J9SharedCache : public TR_SharedCache
* parameter is ignored.
* \return True if romClass points into the SCC, false otherwise.
*/
virtual bool isROMClassInSharedCache(J9ROMClass *romClass, uintptr_t *cacheOffset = NULL);
virtual bool isROMClassInSharedCache(J9ROMClass *romClass, uintptr_t *cacheOffset = NULL) override;

/**
* \brief Checks whether the specified offset is within the ROMClass section
Expand All @@ -305,7 +305,7 @@ class TR_J9SharedCache : public TR_SharedCache
* here. If offset is not within the shared cache this parameter is ignored.
* \return True if the offset is within the shared cache, false otherwise.
*/
virtual bool isROMClassOffsetInSharedCache(uintptr_t offset, J9ROMClass **romClassPtr = NULL);
virtual bool isROMClassOffsetInSharedCache(uintptr_t offset, J9ROMClass **romClassPtr = NULL) override;

/**
* \brief Checks whether the persisent representation of a J9Method exists in the SCC
Expand All @@ -317,7 +317,7 @@ class TR_J9SharedCache : public TR_SharedCache
* be returned here. If it is not in the SCC, this parameter is ignored.
* \return True if the J9Method's romMethod exists in the SCC, false otherwise.
*/
virtual bool isMethodInSharedCache(TR_OpaqueMethodBlock *method, TR_OpaqueClassBlock *definingClass, uintptr_t *cacheOffset = NULL);
virtual bool isMethodInSharedCache(TR_OpaqueMethodBlock *method, TR_OpaqueClassBlock *definingClass, uintptr_t *cacheOffset = NULL) override;

/**
* \brief Checks whether the specified J9ROMMethod exists in the SCC
Expand All @@ -329,7 +329,7 @@ class TR_J9SharedCache : public TR_SharedCache
* parameter is ignored.
* \return True if romMethod points into the SCC, false otherwise.
*/
virtual bool isROMMethodInSharedCache(J9ROMMethod *romMethod, uintptr_t *cacheOffset = NULL);
virtual bool isROMMethodInSharedCache(J9ROMMethod *romMethod, uintptr_t *cacheOffset = NULL) override;

/**
* \brief Checks whether the specified offset is within the ROMClass section
Expand All @@ -340,7 +340,7 @@ class TR_J9SharedCache : public TR_SharedCache
* here. If offset is not within the shared cache this parameter is ignored.
* \return True if the offset is within the shared cache, false otherwise.
*/
virtual bool isROMMethodOffsetInSharedCache(uintptr_t offset, J9ROMMethod **romMethodPtr = NULL);
virtual bool isROMMethodOffsetInSharedCache(uintptr_t offset, J9ROMMethod **romMethodPtr = NULL) override;

/**
* \brief Checks whether the specified pointer points into the ROMClass section
Expand All @@ -353,7 +353,7 @@ class TR_J9SharedCache : public TR_SharedCache
* parameter is ignored.
* \return True if the pointer points into the shared cache, false otherwise.
*/
virtual bool isPtrToROMClassesSectionInSharedCache(void *ptr, uintptr_t *cacheOffset = NULL);
virtual bool isPtrToROMClassesSectionInSharedCache(void *ptr, uintptr_t *cacheOffset = NULL) override;

/**
* \brief Checks whether the specified offset is within the ROMClass section
Expand All @@ -365,12 +365,12 @@ class TR_J9SharedCache : public TR_SharedCache
* here. If offset is not within the shared cache this parameter is ignored.
* \return True if the offset is within the shared cache, false otherwise.
*/
virtual bool isOffsetOfPtrToROMClassesSectionInSharedCache(uintptr_t offset, void **ptr = NULL);
virtual bool isOffsetOfPtrToROMClassesSectionInSharedCache(uintptr_t offset, void **ptr = NULL) override;

J9ROMClass *startingROMClassOfClassChain(UDATA *classChain);
uintptr_t startingROMClassOffsetOfClassChain(void *chain);

virtual uintptr_t getClassChainOffsetIdentifyingLoader(TR_OpaqueClassBlock *clazz, uintptr_t **classChain = NULL);
virtual uintptr_t getClassChainOffsetIdentifyingLoader(TR_OpaqueClassBlock *clazz, uintptr_t **classChain = NULL) override;

#if defined(J9VM_OPT_JITSERVER)
/**
Expand Down
Loading