Skip to content

Commit 293f2b7

Browse files
authored
Merge pull request #19752 from theresa-m/remove_q_5
Remove internal qtype methods
2 parents 760356c + 2a6e3ac commit 293f2b7

19 files changed

+33
-279
lines changed

runtime/compiler/env/J9ClassEnv.cpp

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -513,22 +513,8 @@ static void addEntryForFieldImpl(TR_VMField *field, TR::TypeLayoutBuilder &tlb,
513513
bool trace = comp->getOption(TR_TraceILGen);
514514
uint32_t mergedLength = 0;
515515
J9UTF8 *signature = J9ROMFIELDSHAPE_SIGNATURE(field->shape);
516-
517-
bool isFieldPrimitiveValueType = false;
518-
519-
if (TR::Compiler->om.areFlattenableValueTypesEnabled())
520-
{
521-
if (TR::Compiler->om.isQDescriptorForValueTypesSupported())
522-
{
523-
isFieldPrimitiveValueType = vm->internalVMFunctions->isNameOrSignatureQtype(signature);
524-
}
525-
else
526-
{
527-
isFieldPrimitiveValueType = vm->internalVMFunctions->isFieldNullRestricted(field->shape);
528-
}
529-
}
530-
531-
if (isFieldPrimitiveValueType &&
516+
if (TR::Compiler->om.areFlattenableValueTypesEnabled() &&
517+
vm->internalVMFunctions->isFieldNullRestricted(field->shape) &&
532518
vm->internalVMFunctions->isFlattenableFieldFlattened(definingClass, field->shape))
533519
{
534520
char *prefixForChild = buildTransitiveFieldNames(prefix, prefixLength, field->shape, comp->trMemory()->currentStackRegion(), mergedLength);
@@ -1033,14 +1019,7 @@ J9::ClassEnv::classNameToSignature(const char *name, int32_t &len, TR::Compilati
10331019
{
10341020
len += 2;
10351021
sig = (char *)comp->trMemory()->allocateMemory(len+1, allocKind);
1036-
if (clazz &&
1037-
TR::Compiler->om.areFlattenableValueTypesEnabled() &&
1038-
TR::Compiler->om.isQDescriptorForValueTypesSupported() &&
1039-
self()->isPrimitiveValueTypeClass(clazz)
1040-
)
1041-
sig[0] = 'Q';
1042-
else
1043-
sig[0] = 'L';
1022+
sig[0] = 'L';
10441023
memcpy(sig+1,name,len-2);
10451024
sig[len-1]=';';
10461025
}

runtime/compiler/env/J9ObjectModel.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -141,28 +141,6 @@ J9::ObjectModel::areFlattenableValueTypesEnabled()
141141
return javaVM->internalVMFunctions->areFlattenableValueTypesEnabled(javaVM);
142142
}
143143

144-
bool
145-
J9::ObjectModel::isQDescriptorForValueTypesSupported()
146-
{
147-
// TODO: Implementation is required to determine under which case 'Q' descriptor is removed
148-
#if defined(J9VM_OPT_JITSERVER)
149-
if (auto stream = TR::CompilationInfo::getStream())
150-
{
151-
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
152-
return true;
153-
#else /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
154-
return false;
155-
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
156-
}
157-
#endif /* defined(J9VM_OPT_JITSERVER) */
158-
159-
J9JavaVM * javaVM = TR::Compiler->javaVM;
160-
if (javaVM->internalVMFunctions->areFlattenableValueTypesEnabled(javaVM))
161-
return true;
162-
163-
return false;
164-
}
165-
166144
bool
167145
J9::ObjectModel::areValueBasedMonitorChecksEnabled()
168146
{

runtime/compiler/env/J9ObjectModel.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ class ObjectModel : public OMR::ObjectModelConnector
7070
* @brief Whether or not flattenable value object (aka null restricted) type is enabled
7171
*/
7272
bool areFlattenableValueTypesEnabled();
73-
/**
74-
* @brief Whether or not `Q` signature is supported
75-
*/
76-
bool isQDescriptorForValueTypesSupported();
77-
7873
/**
7974
* @brief Whether the check is enabled on monitor object being value based class type
8075
*/

runtime/compiler/env/VMJ9.cpp

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2562,14 +2562,7 @@ TR_J9VMBase::getClassSignature_DEPRECATED(TR_OpaqueClassBlock * clazz, int32_t &
25622562
for (i = 0; i < numDims; i++)
25632563
sig[i] = '[';
25642564
if (* name != '[')
2565-
{
2566-
if (TR::Compiler->om.areFlattenableValueTypesEnabled() &&
2567-
TR::Compiler->om.isQDescriptorForValueTypesSupported() &&
2568-
TR::Compiler->cls.isPrimitiveValueTypeClass(myClass))
2569-
sig[i++] = 'Q';
2570-
else
2571-
sig[i++] = 'L';
2572-
}
2565+
sig[i++] = 'L';
25732566
memcpy(sig+i, name, len);
25742567
i += len;
25752568
if (* name != '[')
@@ -2597,14 +2590,7 @@ TR_J9VMBase::getClassSignature(TR_OpaqueClassBlock * clazz, TR_Memory * trMemory
25972590
for (i = 0; i < numDims; i++)
25982591
sig[i] = '[';
25992592
if (* name != '[')
2600-
{
2601-
if (TR::Compiler->om.areFlattenableValueTypesEnabled() &&
2602-
TR::Compiler->om.isQDescriptorForValueTypesSupported() &&
2603-
TR::Compiler->cls.isPrimitiveValueTypeClass(myClass))
2604-
sig[i++] = 'Q';
2605-
else
2606-
sig[i++] = 'L';
2607-
}
2593+
sig[i++] = 'L';
26082594
memcpy(sig+i, name, len);
26092595
i += len;
26102596
if (* name != '[')

runtime/compiler/env/j9method.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9643,30 +9643,13 @@ TR_J9ByteCodeIlGenerator::packReferenceChainOffsets(TR::Node *node, std::vector<
96439643
}
96449644
#endif
96459645

9646-
bool
9647-
TR_ResolvedJ9Method::isFieldQType(int32_t cpIndex)
9648-
{
9649-
J9ROMFieldRef *ref = (J9ROMFieldRef *) (&romCPBase()[cpIndex]);
9650-
J9ROMNameAndSignature *nameAndSignature = J9ROMFIELDREF_NAMEANDSIGNATURE(ref);
9651-
J9UTF8 *signature = J9ROMNAMEANDSIGNATURE_SIGNATURE(nameAndSignature);
9652-
9653-
J9VMThread *vmThread = fej9()->vmThread();
9654-
return vmThread->javaVM->internalVMFunctions->isNameOrSignatureQtype(signature);
9655-
}
9656-
96579646
bool
96589647
TR_ResolvedJ9Method::isFieldNullRestricted(TR::Compilation *comp, int32_t cpIndex, bool isStatic, bool isStore)
96599648
{
96609649
if (!TR::Compiler->om.areFlattenableValueTypesEnabled() ||
96619650
(-1 == cpIndex))
96629651
return false;
96639652

9664-
if (TR::Compiler->om.isQDescriptorForValueTypesSupported())
9665-
{
9666-
if (isFieldQType(cpIndex)) // Temporary until javac supports NullRestricted attribute
9667-
return true;
9668-
}
9669-
96709653
J9VMThread *vmThread = fej9()->vmThread();
96719654
J9ROMFieldShape *fieldShape = NULL;
96729655

runtime/compiler/env/j9method.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -470,13 +470,6 @@ class TR_ResolvedJ9Method : public TR_J9Method, public TR_ResolvedJ9MethodBase
470470
TR_ResolvedMethod * aotMaskResolvedPossiblyPrivateVirtualMethod(TR::Compilation *comp, TR_ResolvedMethod *method);
471471
TR_ResolvedMethod * aotMaskResolvedImproperInterfaceMethod(TR::Compilation *comp, TR_ResolvedMethod *method);
472472

473-
/**
474-
* @brief Check if a field is a QType or not.
475-
*
476-
* @param[in] cpIndex : the constant pool index of the field
477-
*/
478-
virtual bool isFieldQType(int32_t cpIndex);
479-
480473
public:
481474
virtual bool virtualMethodIsOverridden();
482475
virtual void setVirtualMethodIsOverridden();

runtime/compiler/env/j9methodServer.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,30 +1844,13 @@ TR_ResolvedJ9JITServerMethod::archetypeArgPlaceholderSlot()
18441844
return paramSlots;
18451845
}
18461846

1847-
bool
1848-
TR_ResolvedJ9JITServerMethod::isFieldQType(int32_t cpIndex)
1849-
{
1850-
auto comp = _fe->_compInfoPT->getCompilation();
1851-
int32_t sigLen;
1852-
char *sig = fieldOrStaticSignatureChars(cpIndex, sigLen);
1853-
J9UTF8 *utfWrapper = str2utf8(sig, sigLen, comp->trMemory(), heapAlloc);
1854-
1855-
J9VMThread *vmThread = comp->j9VMThread();
1856-
return vmThread->javaVM->internalVMFunctions->isNameOrSignatureQtype(utfWrapper);
1857-
}
1858-
18591847
bool
18601848
TR_ResolvedJ9JITServerMethod::isFieldNullRestricted(TR::Compilation *comp, int32_t cpIndex, bool isStatic, bool isStore)
18611849
{
18621850
if (!TR::Compiler->om.areFlattenableValueTypesEnabled() ||
18631851
(-1 == cpIndex))
18641852
return false;
18651853

1866-
if (TR::Compiler->om.isQDescriptorForValueTypesSupported())
1867-
{
1868-
return isFieldQType(cpIndex);
1869-
}
1870-
18711854
_stream->write(JITServer::MessageType::ResolvedMethod_isFieldNullRestricted, _remoteMirror, cpIndex, isStatic, isStore);
18721855
return std::get<0>(_stream->read<bool>());
18731856
}

runtime/compiler/env/j9methodServer.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,6 @@ class TR_ResolvedJ9JITServerMethod : public TR_ResolvedJ9Method
244244
virtual bool validateMethodFieldAttributes(const TR_J9MethodFieldAttributes &attributes, bool isStatic, int32_t cpIndex, bool isStore, bool needAOTValidation);
245245
virtual bool canCacheFieldAttributes(int32_t cpIndex, const TR_J9MethodFieldAttributes &attributes, bool isStatic);
246246

247-
virtual bool isFieldQType(int32_t cpIndex) override;
248-
249247
private:
250248

251249
J9ROMClass *_romClass; // cached copy of ROM class from client

runtime/compiler/ilgen/Walker.cpp

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6749,24 +6749,9 @@ TR_J9ByteCodeIlGenerator::genAconst_init(TR_OpaqueClassBlock *valueTypeClass, in
67496749
case TR::Address:
67506750
{
67516751
const char *fieldSignature = entry._typeSignature;
6752-
6753-
// If the field's signature begins with a Q, it is a value type and should be initialized with a default value
6754-
// for that value type. That's handled with a recursive call to genAconst_init.
6755-
// If the signature does not begin with a Q, the field is an identity type whose default value is a Java null
6756-
/// reference.
6757-
bool isNullRestricted = false;
67586752
if (TR::Compiler->om.areFlattenableValueTypesEnabled())
67596753
{
6760-
if (!TR::Compiler->om.isQDescriptorForValueTypesSupported())
6761-
{
6762-
isNullRestricted = entry._isNullRestricted;
6763-
}
6764-
else if (fieldSignature[0] == 'Q')
6765-
{
6766-
isNullRestricted = true;
6767-
}
6768-
6769-
if (isNullRestricted)
6754+
if (entry._isNullRestricted)
67706755
{
67716756
// In non-SVM AOT compilation, cpIndex is required for AOT relocation.
67726757
// In this case, cpindex is unknown for the field.
@@ -6787,7 +6772,7 @@ TR_J9ByteCodeIlGenerator::genAconst_init(TR_OpaqueClassBlock *valueTypeClass, in
67876772
}
67886773
}
67896774

6790-
if (!isNullRestricted)
6775+
if (!entry._isNullRestricted)
67916776
{
67926777
if (comp()->target().is64Bit())
67936778
{

runtime/compiler/runtime/JITClientSession.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,7 @@ ClientSessionData::processUnloadedClasses(const std::vector<TR_OpaqueClassBlock*
201201
}
202202
else
203203
{
204-
if (TR::Compiler->om.areFlattenableValueTypesEnabled() &&
205-
TR::Compiler->om.isQDescriptorForValueTypesSupported() &&
206-
TR::Compiler->cls.isPrimitiveValueTypeClass(clazz))
207-
sigStr[0] = 'Q';
208-
else
209-
sigStr[0] = 'L';
204+
sigStr[0] = 'L';
210205
memcpy(&sigStr[1], className, sigLen - 2);
211206
sigStr[sigLen-1]=';';
212207
}

0 commit comments

Comments
 (0)