Skip to content

Commit

Permalink
Add OffHeap Query in J9ServerVM
Browse files Browse the repository at this point in the history
Signed-off-by: Abdulrahman Alattas <rmnattas@gmail.com>
  • Loading branch information
rmnattas committed Sep 18, 2024
1 parent 2a68c8d commit 721d444
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
25 changes: 25 additions & 0 deletions runtime/compiler/env/VMJ9Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2551,6 +2551,31 @@ TR_J9ServerVM::isPortableRestoreModeEnabled()
return vmInfo->_isPortableRestoreMode;
}

bool
TR_J9ServerVM::isIndexableDataAddrPresent()
{
#if defined(J9VM_ENV_DATA64)
JITServer::ServerStream *stream = _compInfoPT->getMethodBeingCompiled()->_stream;
auto *vmInfo = _compInfoPT->getClientData()->getOrCacheVMInfo(stream);
return vmInfo->_isIndexableDataAddrPresent;
#else
return false;
#endif /* defined(J9VM_ENV_DATA64) */
}

/**
* Query if off-heap large array allocation is enabled
*
* @return true if off-heap large array allocation is enabled, false otherwise
*/
bool
TR_J9ServerVM::isOffHeapAllocationEnabled()
{
JITServer::ServerStream *stream = _compInfoPT->getMethodBeingCompiled()->_stream;
auto *vmInfo = _compInfoPT->getClientData()->getOrCacheVMInfo(stream);
return vmInfo->_isOffHeapAllocationEnabled;
}

bool
TR_J9SharedCacheServerVM::isClassLibraryMethod(TR_OpaqueMethodBlock *method, bool vettedForAOT)
{
Expand Down
2 changes: 2 additions & 0 deletions runtime/compiler/env/VMJ9Server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ class TR_J9ServerVM: public TR_J9VM
virtual bool inSnapshotMode() override;
virtual bool isSnapshotModeEnabled() override;
virtual bool isPortableRestoreModeEnabled() override;
virtual bool isIndexableDataAddrPresent();
virtual bool isOffHeapAllocationEnabled();

private:
bool instanceOfOrCheckCastHelper(J9Class *instanceClass, J9Class* castClass, bool cacheUpdate);
Expand Down

0 comments on commit 721d444

Please sign in to comment.