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

Fix null restricted array related issues for value types #7452

Open
wants to merge 3 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
7 changes: 7 additions & 0 deletions compiler/env/FrontEnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ TR_FrontEnd::getArrayClassFromComponentClass(TR_OpaqueClassBlock * componentClas
return 0;
}

TR_OpaqueClassBlock *
TR_FrontEnd::getNullRestrictedArrayClassFromComponentClass(TR_OpaqueClassBlock * componentClass)
{
TR_UNIMPLEMENTED();
return 0;
}

TR_OpaqueClassBlock *
TR_FrontEnd::getLeafComponentClassFromArrayClass(TR_OpaqueClassBlock *arrayClass)
{
Expand Down
10 changes: 10 additions & 0 deletions compiler/env/FrontEnd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ class TR_FrontEnd : private TR::Uncopyable

// VM+Shared
virtual TR_OpaqueClassBlock * getArrayClassFromComponentClass(TR_OpaqueClassBlock * componentClass);
/** \brief
* Retrieves the nullRestrictedArrayClass from the array component class.
*
* \param componentClass
* The array component class
*
* \return
* A pointer to nullRestrictedArrayClass if it exists, otherwise NULL
*/
virtual TR_OpaqueClassBlock * getNullRestrictedArrayClassFromComponentClass(TR_OpaqueClassBlock * componentClass);
a7ehuo marked this conversation as resolved.
Show resolved Hide resolved
virtual TR_OpaqueClassBlock * getClassFromNewArrayType(int32_t arrayType);
virtual TR_OpaqueClassBlock * getClassFromSignature(const char * sig, int32_t length, TR_ResolvedMethod *method, bool callSiteVettedForAOT=false);
virtual TR_OpaqueClassBlock * getClassFromSignature(const char * sig, int32_t length, TR_OpaqueMethodBlock *method, bool callSiteVettedForAOT=false);
Expand Down
2 changes: 1 addition & 1 deletion compiler/optimizer/OMRValuePropagation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ TR_YesNoMaybe OMR::ValuePropagation::isCastClassObject(TR::VPClassType *type)
}


TR_YesNoMaybe OMR::ValuePropagation::isArrayCompTypePrimitiveValueType(TR::VPConstraint *arrayConstraint)
TR_YesNoMaybe OMR::ValuePropagation::isArrayNullRestricted(TR::VPConstraint *arrayConstraint)
{
return TR::Compiler->om.areFlattenableValueTypesEnabled() ? TR_maybe : TR_no;
}
Expand Down
19 changes: 10 additions & 9 deletions compiler/optimizer/OMRValuePropagation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,14 @@ class ValuePropagation : public TR::Optimization
TR_YesNoMaybe isCastClassObject(TR::VPClassType *type);

/**
* Determine whether the component type of an array is, or might be, a primitive value
* type.
* Determine whether the array is, or might be, null-restricted
*
* \param arrayConstraint The \ref TR::VPConstraint type constraint for the array reference
* \returns \c TR_yes if the array's component type is definitely a primitive value type;\n
* \c TR_no if it is definitely not a primitive value type; or\n
* \returns \c TR_yes if the array is definitely a null-restricted array;\n
* \c TR_no if it is definitely not a null-restricted array; or\n
* \c TR_maybe otherwise.
*/
virtual TR_YesNoMaybe isArrayCompTypePrimitiveValueType(TR::VPConstraint *arrayConstraint);
virtual TR_YesNoMaybe isArrayNullRestricted(TR::VPConstraint *arrayConstraint);

/**
* \brief
Expand Down Expand Up @@ -616,15 +616,16 @@ class ValuePropagation : public TR::Optimization
{
TR_ALLOC(TR_Memory::ValuePropagation)

TR_NeedRuntimeTestNullRestrictedArrayCopy(TR::Node *dstArrRef, TR::Node *srcArrRef,
TR_NeedRuntimeTestNullRestrictedArrayCopy(TR::SymbolReference *dstArrRefSymRef, TR::SymbolReference *srcArrRefSymRef,
TR::TreeTop *ptt, TR::TreeTop *ntt,
TR::Block *originBlock, TR::Block *slowBlock,
bool testDstArray)
: _dstArrayRefNode(dstArrRef), _srcArrayRefNode(srcArrRef), _prevTT(ptt), _nextTT(ntt), _originBlock(originBlock), _slowBlock(slowBlock), _needRuntimeTestDstArray(testDstArray)
: _dstArrRefSymRef(dstArrRefSymRef), _srcArrRefSymRef(srcArrRefSymRef), _prevTT(ptt), _nextTT(ntt),
_originBlock(originBlock), _slowBlock(slowBlock), _needRuntimeTestDstArray(testDstArray)
{}

TR::Node *_dstArrayRefNode;
TR::Node *_srcArrayRefNode;
TR::SymbolReference * _dstArrRefSymRef;
TR::SymbolReference * _srcArrRefSymRef;

TR::TreeTop *_prevTT;
TR::TreeTop *_nextTT;
Expand Down
Loading