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 OffHeap Query in J9VM #20187

Merged
merged 2 commits into from
Sep 19, 2024
Merged
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
21 changes: 21 additions & 0 deletions runtime/compiler/env/VMJ9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2439,6 +2439,27 @@ TR_J9VMBase::isHotReferenceFieldRequired()
return TR::Compiler->om.isHotReferenceFieldRequired();
}

bool
TR_J9VMBase::isIndexableDataAddrPresent()
{
#if defined(J9VM_ENV_DATA64)
return FALSE != _jitConfig->javaVM->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_J9VMBase::isOffHeapAllocationEnabled()
{
return TR::Compiler->om.isOffHeapAllocationEnabled();
}

bool
TR_J9VMBase::scanReferenceSlotsInClassForOffset(TR::Compilation * comp, TR_OpaqueClassBlock * classPointer, int32_t offset)
{
Expand Down
2 changes: 2 additions & 0 deletions runtime/compiler/env/VMJ9.h
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,8 @@ class TR_J9VMBase : public TR_FrontEnd
virtual void markHotField( TR::Compilation *, TR::SymbolReference *, TR_OpaqueClassBlock *, bool);
virtual void reportHotField(int32_t reducedCpuUtil, J9Class* clazz, uint8_t fieldOffset, uint32_t reducedFrequency);
virtual bool isHotReferenceFieldRequired();
virtual bool isIndexableDataAddrPresent();
virtual bool isOffHeapAllocationEnabled();
virtual void markClassForTenuredAlignment( TR::Compilation *comp, TR_OpaqueClassBlock *opclazz, uint32_t alignFromStart);

virtual bool shouldDelayAotLoad() { return false; }
Expand Down
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