Skip to content

Commit

Permalink
Remove remaining q uses
Browse files Browse the repository at this point in the history
Signed-off-by: Theresa Mammarella <[email protected]>
  • Loading branch information
theresa-m committed Jul 5, 2024
1 parent d946965 commit 36f35ec
Show file tree
Hide file tree
Showing 35 changed files with 37 additions and 110 deletions.
3 changes: 0 additions & 3 deletions debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/j9/SendSlot.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ public static UDATA getSendSlotsFromSignature(J9UTF8Pointer signature) throws Co
break;
}
case 'L':
/*[IF INLINE-TYPES]*/
case 'Q':
/*[ENDIF] INLINE-TYPES */
for (i++; J9UTF8Helper.stringValue(signature).charAt(i) != ';'; i++);
sendArgs = sendArgs.add(1);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,6 @@ private void jitWalkResolveMethodFrame(WalkState walkState) throws CorruptDataEx
while ((sigChar = jitNextSigChar(signatureString)) != ')') {
switch (sigChar) {
case 'L':
/*[IF INLINE-TYPES]*/
case 'Q':
/*[ENDIF] INLINE-TYPES */
if (J9SW_ARGUMENT_REGISTER_COUNT_DEFINED && !stackSpillCount.eq(0)) {
if ((walkState.flags & J9_STACKWALK_ITERATE_O_SLOTS) != 0) {
try {
Expand Down Expand Up @@ -633,9 +630,6 @@ private char jitNextSigChar(String signatureString) throws CorruptDataException
/* Fall through to consume type name, utfChar == 'L' for return value */

case 'L':
/*[IF INLINE-TYPES]*/
case 'Q':
/*[ENDIF] INLINE-TYPES */
while (signatureString.charAt(charIndex++) != ';')
;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,6 @@ public static String getJavaName(J9ClassPointer clazz) throws CorruptDataExcepti
case 'Z': return "boolean" + aritySuffix;

case 'L':
/*[IF INLINE-TYPES]*/
case 'Q':
/*[ENDIF] INLINE-TYPES */
return getName(arrayClass.leafComponentType()) + aritySuffix;
}

Expand Down Expand Up @@ -537,10 +534,6 @@ public static boolean isAnonymousClass(J9ClassPointer clazz) throws CorruptDataE
* @return true if the character indicates the beginning of a reference or value signature, false otherwise
*/
public static boolean isRefOrValSignature(char firstChar) {
return firstChar == 'L'
/*[IF INLINE-TYPES]*/
|| (firstChar == 'Q')
/*[ENDIF] INLINE-TYPES */
;
return firstChar == 'L';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,6 @@ public static void getData(J9IndexableObjectPointer objPointer, Object dst, int
}

case 'L':
/*[IF INLINE-TYPES]*/
case 'Q':
/*[ENDIF] INLINE-TYPES */
case '[':
{
if (!(dst instanceof J9ObjectPointer[])) {
Expand Down Expand Up @@ -570,9 +567,6 @@ public static Object getData(J9IndexableObjectPointer objPointer) throws Corrupt
}

case 'L':
/*[IF INLINE-TYPES]*/
case 'Q':
/*[ENDIF] INLINE-TYPES */
case '[':
{
J9ObjectPointer[] data = new J9ObjectPointer[arraySize];
Expand Down Expand Up @@ -649,9 +643,6 @@ public static String getDataAsString(J9IndexableObjectPointer array, int dumpLim
break;

case 'L':
/*[IF INLINE-TYPES]*/
case 'Q':
/*[ENDIF] INLINE-TYPES */
case '[':
{
J9ObjectPointer item = ((J9ObjectPointer[]) data)[i];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ public void run(String command, String[] args, Context context, PrintStream out)

switch (sig.charAt(0)) {
case 'L':
/*[IF INLINE-TYPES]*/
case 'Q':
/*[ENDIF] INLINE-TYPES */
case '[':
CommandUtils.dbgPrint(out, "\t%s %s %s (!j9romstaticfieldshape %s) = !j9object %s\n",
fieldAddress.getHexAddress(), name, sig, field.getHexAddress(), fieldAddress.at(0).getHexValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,6 @@ private void formatArrayObject(PrintStream out, J9ClassPointer localClazz, U8Poi
}
break;
case 'L':
/*[IF INLINE-TYPES]*/
case 'Q':
/*[ENDIF] INLINE-TYPES */
case '[':
if (ValueTypeHelper.getValueTypeHelper().isJ9ClassIsFlattened(localClazz)) {
formatFlattenedObjectArray(out, tabLevel, begin, finish, array);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,13 @@ static String getBytecodeStringName(Class<?> c) {
/*
* Convert the string from bytecode format to the format needed for ClassLoader#loadClass().
* Change all '/' to '.'.
* Remove the 'L', 'Q', and ';' from objects, unless they are array classes.
* Remove the 'L' and ';' from objects, unless they are array classes.
*/
private static final Class<?> nonPrimitiveClassFromString(String name, ClassLoader classLoader) {
try {
name = name.replace('/', '.');
if ((name.charAt(0) == 'L')
/*[IF INLINE-TYPES]*/
|| (name.charAt(0) == 'Q')
/*[ENDIF] INLINE-TYPES */
) {
// Remove the 'L'/'Q' and ';'.
if (name.charAt(0) == 'L') {
// Remove the 'L' and ';'.
name = name.substring(1, name.length() - 1);
}
return Class.forName(name, false, classLoader);
Expand All @@ -212,21 +208,13 @@ static final int parseIntoClass(char[] signature, int index, ArrayList<Class<?>>
char current = signature[index];
Class<?> c;

if ((current == 'L') || (current == '[')
/*[IF INLINE-TYPES]*/
|| (current == 'Q')
/*[ENDIF] INLINE-TYPES */
) {
if ((current == 'L') || (current == '[')) {
int start = index;
while(signature[index] == '[') {
index++;
}
String name;
if ((signature[index] != 'L')
/*[IF INLINE-TYPES]*/
&& (signature[index] != 'Q')
/*[ENDIF] INLINE-TYPES */
) {
if (signature[index] != 'L') {
name = descriptor.substring(start, index + 1);
} else {
int end = descriptor.indexOf(';', index);
Expand Down
8 changes: 1 addition & 7 deletions runtime/codert_vm/thunkcrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,7 @@ j9ThunkIterateAndEncode(char ** signatureDataPtr, U_8 ** encodedTypesPtr, U_8 *
while ((c = *signatureData++) == '[') ;
/* intentional fall-through */
case 'L':
/* intentional fall-through */
case 'Q':
if ((c == 'L') || (c == 'Q')) {
if (c == 'L') {
while (*signatureData++ != ';') ;
}
#if defined(J9VM_ENV_DATA64)
Expand Down Expand Up @@ -503,8 +501,6 @@ j9ThunkVMHelperFromSignature(void * jitConfig, UDATA signatureLength, char *sign
case '[':
/* intentional fall-through */
case 'L':
/* intentional fall-through */
case 'Q':
#if defined(J9VM_ENV_DATA64)
helper = J9_BUILDER_SYMBOL(icallVMprJavaSendVirtualL);
break;
Expand Down Expand Up @@ -540,8 +536,6 @@ j9ThunkInvokeExactHelperFromSignature(void * jitConfig, UDATA signatureLength, c
case '[':
/* intentional fall-through */
case 'L':
/* intentional fall-through */
case 'Q':
helper = J9_BUILDER_SYMBOL(icallVMprJavaSendInvokeExactL);
break;
default:
Expand Down
2 changes: 0 additions & 2 deletions runtime/compiler/control/JITServerHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1526,8 +1526,6 @@ JITServerHelpers::getFullClassName(uint8_t *name, uint32_t length, const J9ROMCl
uint32_t baseNameLength = J9UTF8_LENGTH(baseName);

// Build the array class signature that will be passed to jitGetClassInClassloaderFromUTF8() on the client.
// Note that for object arrays we can simply use the "L" type signature since the distinction with "Q" types
// is ignored during array class lookup by name (see internalFindArrayClass() in runtime/vm/classsupport.c).
uint32_t i;
for (i = 0; i < numDimensions; ++i)
name[i] = '[';
Expand Down
1 change: 0 additions & 1 deletion runtime/compiler/env/J2IThunk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ char TR_MHJ2IThunkTable::terseTypeChar(char *type)
{
case '[':
case 'L':
case 'Q':
return TR::Compiler->target.is64Bit()? 'L' : 'I';
case 'Z':
case 'B':
Expand Down
3 changes: 1 addition & 2 deletions runtime/compiler/env/J2IThunk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ class TR_MHJ2IThunkTable
case 'J': return TC_LONG;
case 'F': return TC_FLOAT;
case 'D': return TC_DOUBLE;
case 'L':
case 'Q': return TC_REFERENCE;
case 'L': return TC_REFERENCE;
default:
TR_ASSERT(0, "Unknown type char '%c'", typeChar);
return -1;
Expand Down
1 change: 0 additions & 1 deletion runtime/compiler/env/J9ClassEnv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,6 @@ static void addEntryForFieldImpl(TR_VMField *field, TR::TypeLayoutBuilder &tlb,
break;
}
case 'L':
case 'Q':
case '[':
{
dataType = TR::Address;
Expand Down
4 changes: 2 additions & 2 deletions runtime/compiler/env/J9ClassEnv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ class OMR_EXTENSIBLE ClassEnv : public OMR::ClassEnvConnector
* Checks whether a class supports direct memory comparison if its fields meet
* the criteria that NO field is of
* - type double (D) or float (F)
* - nullable-class/interface type (L)
* - null-free class type (Q) that are not both flattened and recursively
* - nullable-class/interface type
* - null restricted class type that are not both flattened and recursively
* compatible for direct memory comparison
*
* \param clazz
Expand Down
5 changes: 2 additions & 3 deletions runtime/compiler/env/VMJ9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4564,7 +4564,6 @@ TR_J9VMBase::lookupMethodHandleThunkArchetype(uintptr_t methodHandle)
{
case '[':
case 'L':
case 'Q':
// The thunkable signature might return some other class, but archetypes
// returning a reference are always declared to return Object.
//
Expand Down Expand Up @@ -7344,10 +7343,10 @@ TR_J9VM::getClassFromSignature(const char * sig, int32_t sigLength, J9ConstantPo
J9Class * j9class = NULL;
TR_OpaqueClassBlock * returnValue = NULL;

// For a non-array class type, strip off the first 'L' or 'Q' and last ';' of the
// For a non-array class type, strip off the first 'L' and last ';' of the
// signature
//
if ((*sig == 'L' || *sig == 'Q') && sigLength > 2)
if ((*sig == 'L') && sigLength > 2)
{
sig += 1;
sigLength -= 2;
Expand Down
4 changes: 2 additions & 2 deletions runtime/compiler/env/annotations/AnnotationBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void TR_AnnotationBase::loadExpectedAnnotationClasses(J9VMThread * vmThread)
acquireVMAccess(vmThread); // this is not the comp thread so suspension is possible
for(i=0;i < kLastAnnotationSignature;++i)
{
// Strip off 'L' prefix or 'Q' prefix and ';' suffix
// Strip off 'L' prefix and ';' suffix
const char *name = recognizedAnnotations[i].name;
int32_t nameLen = recognizedAnnotations[i].nameLen;
TR_ASSERT(strlen(name) == nameLen,"Table entry for %s is %d but should be %d\n",name,nameLen,strlen(name));
Expand Down Expand Up @@ -251,7 +251,7 @@ TR_AnnotationBase::getDefaultAnnotationInfo(const char *annotationName)
}
}
if(NULL == clazz) return NULL;
const char * className = annotationName+1; // strip off leading 'L' or 'Q';
const char * className = annotationName+1; // strip off leading 'L';
int32_t classNameLength = strlen (className) -1; // strip off trailing ';'
J9AnnotationInfoEntry *defaultEntry = intFunc->getAnnotationDefaultsForNamedAnnotation(vmThread, clazz, (char *)className, classNameLength,
J9_FINDCLASS_FLAG_EXISTING_ONLY);
Expand Down
2 changes: 1 addition & 1 deletion runtime/compiler/env/j9fieldsInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

static int isReferenceSignature(char *signature)
{
return ( (signature[0] == 'L' ) || (signature[0] == '[') || (signature[0] == 'Q'));
return ( (signature[0] == 'L' ) || (signature[0] == '['));
}

int TR_VMField::isReference()
Expand Down
22 changes: 8 additions & 14 deletions runtime/compiler/env/j9method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7489,9 +7489,9 @@ TR_ResolvedJ9Method::makeParameterList(TR::ResolvedMethodSymbol *methodSym)
}

// Walk to the end of the class name, if this is a class name
if (*end == 'L' || *end == 'Q')
if (*end == 'L')
{
// Assume the form is L<classname> or Q<classname>; where <classname> is
// Assume the form is L<classname>; where <classname> is
// at least 1 char and therefore skip the first 2 chars
end += 2;
end = (char *)memchr(end, ';', sigEnd - end);
Expand Down Expand Up @@ -7670,15 +7670,15 @@ TR_J9MethodParameterIterator::TR_J9MethodParameterIterator(TR_J9MethodBase &j9Me

TR::DataType TR_J9MethodParameterIterator::getDataType()
{
if (*_sig == 'L' || *_sig == '[' || *_sig == 'Q')
if (*_sig == 'L' || *_sig == '[')
{
_nextIncrBy = 0;
while (_sig[_nextIncrBy] == '[')
{
++_nextIncrBy;
}

if (_sig[_nextIncrBy] != 'L' && _sig[_nextIncrBy] != 'Q')
if (_sig[_nextIncrBy] != 'L')
{
// Primitive array
++_nextIncrBy;
Expand Down Expand Up @@ -7735,7 +7735,7 @@ TR::DataType TR_J9MethodParameterIterator::getDataType()
TR_OpaqueClassBlock * TR_J9MethodParameterIterator::getOpaqueClass()
{
TR_J9VMBase *fej9 = (TR_J9VMBase *)(_comp.fe());
TR_ASSERT(*_sig == '[' || *_sig == 'L' || *_sig == 'Q', "Asked for class of incorrect Java parameter.");
TR_ASSERT(*_sig == '[' || *_sig == 'L', "Asked for class of incorrect Java parameter.");
if (_nextIncrBy == 0) getDataType();
return _resolvedMethod == NULL ? NULL :
fej9->getClassFromSignature(_sig, _nextIncrBy, _resolvedMethod);
Expand All @@ -7754,7 +7754,7 @@ bool TR_J9MethodParameterIterator::isArray()

bool TR_J9MethodParameterIterator::isClass()
{
return (*_sig == 'L' || *_sig == 'Q');
return (*_sig == 'L');
}

bool TR_J9MethodParameterIterator::atEnd()
Expand Down Expand Up @@ -7804,7 +7804,6 @@ static TR::DataType typeFromSig(char sig)
{
case 'L':
case '[':
case 'Q':
return TR::Address;
case 'I':
case 'Z':
Expand Down Expand Up @@ -8028,7 +8027,6 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef)
const char *targetName = targetBuf; const char *targetType = targetBuf;
switch (sourceSig[0])
{
case 'Q':
case 'L':
case '[':
sourceName = "object";
Expand All @@ -8040,7 +8038,6 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef)
}
switch (targetSig[0])
{
case 'Q':
case 'L':
case '[':
targetName = "object";
Expand All @@ -8056,7 +8053,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef)
if (strcmp(sourceType, targetType))
{
char methodName[30], methodSignature[50];
if ((sourceType[0] == 'L' || sourceType[0] == 'Q') && isExplicit)
if ((sourceType[0] == 'L') && isExplicit)
sprintf(methodName, "explicitObject2%s", targetName);
else
sprintf(methodName, "%s2%s", sourceName, targetName);
Expand All @@ -8077,7 +8074,7 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef)

// Address conversions need a downcast after the call
//
if (targetType[0] == 'L' || targetType[0] == 'Q')
if (targetType[0] == 'L')
{
uintptr_t methodHandle;
uintptr_t sourceArguments;
Expand Down Expand Up @@ -8244,7 +8241,6 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef)
break;
case 'L':
case '[':
case 'Q':
callOp = TR::acalli;
break;
case 'V':
Expand Down Expand Up @@ -8382,7 +8378,6 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef)
{
case 'L':
case '[':
case 'Q':
sprintf(extraName, "extra_L");
extraSignature = artificialSignature(stackAlloc, "(L" JSR292_ArgumentMoverHandle ";I)Ljava/lang/Object;");
break;
Expand Down Expand Up @@ -8466,7 +8461,6 @@ TR_J9ByteCodeIlGenerator::runFEMacro(TR::SymbolReference *symRef)
{
case 'L':
case '[':
case 'Q':
sprintf(extraName, "extra_L");
extraSignature = artificialSignature(stackAlloc, "(L" JSR292_ArgumentMoverHandle ";I)Ljava/lang/Object;");
break;
Expand Down
2 changes: 1 addition & 1 deletion runtime/compiler/env/j9method.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ inline const char *nextSignatureArgument(const char *currentArgument)
const char *result = currentArgument;
while (*result == '[')
result++;
if (*result == 'L' || *result == 'Q')
if (*result == 'L')
while (*result != ';')
result++;
return result+1;
Expand Down
Loading

0 comments on commit 36f35ec

Please sign in to comment.