Skip to content

Commit

Permalink
Merge pull request #7399 from a7ehuo/valuetypes-remove-qtype
Browse files Browse the repository at this point in the history
ValueTypes: Remove reference to 'Q' signature prefix
  • Loading branch information
hzongaro committed Jul 3, 2024
2 parents 3ad5a57 + 6114ae1 commit 5aca65b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion compiler/il/OMRSymbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ OMR::Symbol::convertSigCharToType(char sigChar)
case 'F': return TR::Float;
case 'D': return TR::Double;
case 'L':
case 'Q':
case '[': return TR::Address;
}
TR_ASSERT(0, "unknown signature character");
Expand Down
11 changes: 5 additions & 6 deletions compiler/optimizer/VPConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,12 +781,12 @@ TR::VPClassType *TR::VPUnresolvedClass::getArrayClass(OMR::ValuePropagation *vp)

bool TR::VPUnresolvedClass::isReferenceArray(TR::Compilation *comp)
{
return _sig[0] == '[' && (_sig[1] == '[' || _sig[1] == 'L' || _sig[1] == 'Q');
return _sig[0] == '[' && (_sig[1] == '[' || _sig[1] == 'L');
}

bool TR::VPUnresolvedClass::isPrimitiveArray(TR::Compilation *comp)
{
return _sig[0] == '[' && _sig[1] != '[' && _sig[1] != 'L' && _sig[1] != 'Q';
return _sig[0] == '[' && _sig[1] != '[' && _sig[1] != 'L';
}

bool TR::VPNullObject::isNullObject()
Expand Down Expand Up @@ -887,7 +887,6 @@ TR::VPConstraint *TR::VPConstraint::create(OMR::ValuePropagation *vp, const char
switch (sig[0])
{
case 'L':
case 'Q':
case '[':
return TR::VPClassType::create(vp, sig, len, method, isFixedClass);
case 'B':
Expand Down Expand Up @@ -3534,8 +3533,8 @@ TR::VPConstraint *TR::VPResolvedClass::intersect1(TR::VPConstraint *other, OMR::
otherLen--;
}

if (((*thisSig != 'L') && (*thisSig != '[') && (*thisSig != 'Q')) &&
((*otherSig == 'L') || (*otherSig == '[') || (*otherSig == 'Q')))
if (((*thisSig != 'L') && (*thisSig != '[')) &&
((*otherSig == 'L') || (*otherSig == '[')))
return NULL;

return this;
Expand Down Expand Up @@ -3628,7 +3627,7 @@ TR::VPConstraint *TR::VPFixedClass::intersect1(TR::VPConstraint *other, OMR::Val
}

// Test if thisSig is primitive or an array, and otherSig is any kind of reference type
if ((*thisSig != 'L') && (*thisSig != 'Q') && ((*otherSig == 'L') || (*otherSig == '[') || (*otherSig == 'Q')))
if ((*thisSig != 'L') && ((*otherSig == 'L') || (*otherSig == '[')))
{
// Test if thisSig is not an array, or otherSig is not a java/lang/Object array
if (! ((*thisSig == '[') && (otherLen == 18 && !strncmp(otherSig, "Ljava/lang/Object;", 18))) )
Expand Down
5 changes: 2 additions & 3 deletions compiler/optimizer/VPHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ static int32_t arrayElementSize(const char *signature, int32_t len, TR::Node *no
case 'J': return 8;
case 'Z': return static_cast<int32_t>(TR::Compiler->om.elementSizeOfBooleanArray());
case 'L':
case 'Q':
default :
return TR::Compiler->om.sizeofReferenceField();
}
Expand Down Expand Up @@ -1842,7 +1841,7 @@ TR::Node *constrainAload(OMR::ValuePropagation *vp, TR::Node *node)
{
int32_t len;
const char *sig = getFieldSignature(vp, node, len);
if (sig && (len > 0) && (sig[0] == '[' || sig[0] == 'L' || sig[0] == 'Q'))
if (sig && (len > 0) && (sig[0] == '[' || sig[0] == 'L'))
{
int32_t elementSize = arrayElementSize(sig, len, node, vp);
if (elementSize != 0)
Expand Down Expand Up @@ -1957,7 +1956,7 @@ TR::Node *constrainAload(OMR::ValuePropagation *vp, TR::Node *node)
if (classBlock != jlClass)
{
constraint = TR::VPClassType::create(vp, sig, len, owningMethod, isFixed, classBlock);
if (*sig == '[' || sig[0] == 'L' || sig[0] == 'Q')
if (*sig == '[' || sig[0] == 'L')
{
int32_t elementSize = arrayElementSize(sig, len, node, vp);
if (elementSize != 0)
Expand Down

0 comments on commit 5aca65b

Please sign in to comment.