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 object model API for minimum object size in bytes #21079

Closed
wants to merge 1 commit into from
Closed
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
1 change: 1 addition & 0 deletions runtime/compiler/control/JITClientCompilationThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ handleServerMessage(JITServer::ClientStream *client, TR_J9VM *fe, JITServer::Mes
vmInfo._osrGlobalBufferSize = javaVM->osrGlobalBufferSize;
vmInfo._needsMethodTrampolines = TR::CodeCacheManager::instance()->codeCacheConfig().needsMethodTrampolines();
vmInfo._objectAlignmentInBytes = TR::Compiler->om.objectAlignmentInBytes();
vmInfo._minimumObjectSizeInBytes = TR::Compiler->om.getMinimumObjectSizeInBytes();
vmInfo._isGetImplAndRefersToInliningSupported = fe->isGetImplAndRefersToInliningSupported();
vmInfo._isAllocateZeroedTLHPagesEnabled = fe->tlhHasBeenCleared();
vmInfo._staticObjectAllocateFlags = fe->getStaticObjectFlags();
Expand Down
14 changes: 14 additions & 0 deletions runtime/compiler/env/J9ObjectModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ J9::ObjectModel::initialize()
}

_objectAlignmentInBytes = objectAlignmentInBytes();
_minimumObjectSizeInBytes = mmf->j9gc_modron_getConfigurationValueForKey(vm, j9gc_modron_configuration_minimumObjectSize, &result) ? result : 0;
}


Expand Down Expand Up @@ -842,3 +843,16 @@ J9::ObjectModel::getObjectAlignmentInBytes()
#endif /* defined(J9VM_OPT_JITSERVER) */
return _objectAlignmentInBytes;
}

int32_t
J9::ObjectModel::getMinimumObjectSizeInBytes()
{
#if defined(J9VM_OPT_JITSERVER)
if (auto stream = TR::CompilationInfo::getStream())
{
auto *vmInfo = TR::compInfoPT->getClientData()->getOrCacheVMInfo(stream);
return vmInfo->_minimumObjectSizeInBytes;
}
#endif /* defined(J9VM_OPT_JITSERVER) */
return _minimumObjectSizeInBytes;
}
5 changes: 4 additions & 1 deletion runtime/compiler/env/J9ObjectModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ class ObjectModel : public OMR::ObjectModelConnector
_arrayLetLeafLogSize(0),
_readBarrierType(gc_modron_readbar_none),
_writeBarrierType(gc_modron_wrtbar_none),
_objectAlignmentInBytes(0)
_objectAlignmentInBytes(0),
_minimumObjectSizeInBytes(0)
{}

void initialize();
Expand Down Expand Up @@ -157,6 +158,7 @@ class ObjectModel : public OMR::ObjectModelConnector
bool compressObjectReferences();

int32_t getObjectAlignmentInBytes();
int32_t getMinimumObjectSizeInBytes();

private:

Expand All @@ -167,6 +169,7 @@ class ObjectModel : public OMR::ObjectModelConnector
MM_GCReadBarrierType _readBarrierType;
MM_GCWriteBarrierType _writeBarrierType;
int32_t _objectAlignmentInBytes;
int32_t _minimumObjectSizeInBytes;
};

}
Expand Down
1 change: 1 addition & 0 deletions runtime/compiler/runtime/JITClientSession.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ class ClientSessionData
UDATA _osrGlobalBufferSize;
bool _needsMethodTrampolines;
int32_t _objectAlignmentInBytes;
int32_t _minimumObjectSizeInBytes;
bool _isGetImplAndRefersToInliningSupported;
bool _isAllocateZeroedTLHPagesEnabled;
uint32_t _staticObjectAllocateFlags;
Expand Down