Skip to content

Commit

Permalink
Merge pull request #19727 from theresa-m/remove_q
Browse files Browse the repository at this point in the history
Remove some value type q cases
  • Loading branch information
hangshao0 authored Jun 18, 2024
2 parents 701fa85 + bc14031 commit 45bf250
Show file tree
Hide file tree
Showing 18 changed files with 7 additions and 123 deletions.
11 changes: 1 addition & 10 deletions runtime/bcutil/ClassFileOracle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1235,20 +1235,11 @@ ClassFileOracle::computeSendSlotCount(U_16 methodIndex)
while ((index < count) && ('[' == bytes[index])) {
++index;
}
if ((index >= count)
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
|| (('L' != bytes[index]) && ('Q' != bytes[index]))
#else /* J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES */
|| ('L' != bytes[index])
#endif /* J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES */
) {
if ((index >= count) || ('L' != bytes[index])) {
break;
}
/* fall through */
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES */
++index;
while ((index < count) && (';' != bytes[index])) {
++index;
Expand Down
3 changes: 0 additions & 3 deletions runtime/bcutil/ClassFileWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1343,9 +1343,6 @@ ClassFileWriter::computeArgsCount(U_16 methodRefIndex)
}
/* fall through */
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
index += 1;
while ((index < count) && (';' != sig[index])) {
index += 1;
Expand Down
6 changes: 0 additions & 6 deletions runtime/bcverify/bcverify.c
Original file line number Diff line number Diff line change
Expand Up @@ -1166,9 +1166,6 @@ printMethod (J9BytecodeVerificationData * verifyData)
break;

case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
i++;
while(string[i] != ';')
{
Expand Down Expand Up @@ -1225,9 +1222,6 @@ printMethod (J9BytecodeVerificationData * verifyData)
break;

case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
i++;
while(string[i] != ';')
{
Expand Down
33 changes: 0 additions & 33 deletions runtime/cfdumper/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1159,9 +1159,6 @@ static void printMethod(J9CfrClassFile* classfile, J9CfrMethod* method)
break;

case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
i++;
while(string[i] != ';')
{
Expand Down Expand Up @@ -1218,9 +1215,6 @@ static void printMethod(J9CfrClassFile* classfile, J9CfrMethod* method)
break;

case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
i++;
while(string[i] != ';')
{
Expand Down Expand Up @@ -1336,9 +1330,6 @@ static void printField(J9CfrClassFile* classfile, J9CfrField* field)
j9tty_printf( PORTLIB, "long");
break;
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
i++;
while(string[i] != ';')
{
Expand Down Expand Up @@ -1441,9 +1432,6 @@ static void printDisassembledMethod(J9CfrClassFile* classfile, J9CfrMethod* meth
break;

case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
i++;
while(string[i] != ';')
{
Expand Down Expand Up @@ -1500,9 +1488,6 @@ static void printDisassembledMethod(J9CfrClassFile* classfile, J9CfrMethod* meth
break;

case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
i++;
while(string[i] != ';')
{
Expand Down Expand Up @@ -4502,9 +4487,6 @@ static void sun_formatField(J9CfrClassFile* classfile, J9CfrField* field, char *
switch(string[j++])
{
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
while((ch2 = string[j++]) != ';')
{
if(ch2 == '/') j9tty_output_char('.');
Expand Down Expand Up @@ -4752,9 +4734,6 @@ static void sun_formatMethod(J9CfrClassFile* classfile, J9CfrMethod* method, cha
switch(string[j++])
{
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
while((ch2 = string[j++]) != ';')
{
if(ch2 == '/') j9tty_output_char('.');
Expand Down Expand Up @@ -4820,9 +4799,6 @@ static void sun_formatMethod(J9CfrClassFile* classfile, J9CfrMethod* method, cha
switch(string[j++])
{
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
while((ch2 = string[j++]) != ';')
{
if(ch2 == '/') j9tty_output_char('.');
Expand Down Expand Up @@ -5276,9 +5252,6 @@ static void j9_formatField(J9ROMClass* romClass, J9ROMFieldShape* field, char *f
switch(string[j++])
{
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
while((ch2 = string[j++]) != ';')
{
if(ch2 == '/') j9tty_output_char('.');
Expand Down Expand Up @@ -5551,9 +5524,6 @@ static void j9_formatMethod(J9ROMClass* romClass, J9ROMMethod* method, char *for
switch(string[j++])
{
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
while((ch2 = string[j++]) != ';')
{
if(ch2 == '/') j9tty_output_char('.');
Expand Down Expand Up @@ -5620,9 +5590,6 @@ static void j9_formatMethod(J9ROMClass* romClass, J9ROMMethod* method, char *for
switch(string[j++])
{
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
while((ch2 = string[j++]) != ';')
{
if(ch2 == '/') j9tty_output_char('.');
Expand Down
3 changes: 0 additions & 3 deletions runtime/jcl/common/reflecthelp.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,6 @@ computeArgCount(J9ROMMethod *method)
}
/* fall through */
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
index += 1;
while ((index < count) && (';' != bytes[index])) {
index += 1;
Expand Down
3 changes: 0 additions & 3 deletions runtime/jnichk/jnicbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ computeArgsCRC(const jvalue *args, jmethodID methodID)
/* ignore square brackets and just count the leaf type as one argument */
break;
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
while (*++sigArgs != ';') {
/* skip up to the semi-colon */
}
Expand Down
15 changes: 0 additions & 15 deletions runtime/jnichk/jnicheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,6 @@ jniCheckCallV(const char* function, JNIEnv* env, jobject receiver, UDATA methodT
}
switch (*sigArgs) {
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
case '[':
sigArgs = jniCheckObjectArg(function, env, va_arg(args, jobject), sigArgs, argNum, trace);
break;
Expand Down Expand Up @@ -529,9 +526,6 @@ jniCheckCallA(const char* function, JNIEnv* env, jobject receiver, UDATA methodT
}
switch (*sigArgs) {
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
case '[':
sigArgs = jniCheckObjectArg(function, env, args++->l, sigArgs, argNum, trace);
break;
Expand Down Expand Up @@ -1925,9 +1919,6 @@ jniDecodeValue(J9VMThread * vmThread, UDATA sigChar, void * valuePtr, char ** ou
written = j9str_printf(PORTLIB, *outputBuffer, *outputBufferLength, "(jboolean)%s", *((I_32 *) valuePtr) ? "true" : "false");
break;
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
written = j9str_printf(PORTLIB, *outputBuffer, *outputBufferLength, "(jobject)0x%p", *((UDATA *) valuePtr));
break;
default:
Expand Down Expand Up @@ -1966,9 +1957,6 @@ static UDATA jniNextSigChar(U_8 ** utfData)
/* Fall through to consume type name, utfChar == 'L' for return value */

case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
while (*data++ != ';') ;
}

Expand Down Expand Up @@ -2461,9 +2449,6 @@ jniCheckObjectArg(const char* function, JNIEnv* env, jobject aJobject, char* sig

switch (*sigArgs) {
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
while (*sigArgs != ';') {
sigArgs++;
}
Expand Down
3 changes: 0 additions & 3 deletions runtime/jvmti/jvmtiForceEarlyReturn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ jvmtiForceEarlyReturn(jvmtiEnv* env,
methodReturnType = JVMTI_TYPE_JDOUBLE;
break;
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
methodReturnType = JVMTI_TYPE_JOBJECT;
break;
}
Expand Down
3 changes: 0 additions & 3 deletions runtime/jvmti/jvmtiHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -972,9 +972,6 @@ fillInJValue(char signatureType, jvalue * jvaluePtr, void * valueAddress, j9obje
memcpy(&(jvaluePtr->d), valueAddress, 8);
break;
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
object = *((j9object_t*) valueAddress);
if (object == NULL) {
jvaluePtr->l = NULL;
Expand Down
6 changes: 0 additions & 6 deletions runtime/jvmti/jvmtiLocalVariable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,6 @@ jvmtiGetOrSetLocal(jvmtiEnv *env,
memcpy(slotAddress - 1, value_ptr, sizeof(U_64));
break;
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
/* Perform type check? */
*((j9object_t *)slotAddress) = (NULL == value_ptr) ? NULL : *((j9object_t *)value_ptr);
break;
Expand All @@ -431,9 +428,6 @@ jvmtiGetOrSetLocal(jvmtiEnv *env,
}
break;
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
/* CMVC 109592 - Must not modify the stack while a thread is halted for inspection - this includes creation of JNI local refs */
objectFetched = TRUE;
PUSH_OBJECT_IN_SPECIAL_FRAME(currentThread, slotValid ? *((j9object_t *)slotAddress) : NULL);
Expand Down
6 changes: 0 additions & 6 deletions runtime/rastrace/method_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,6 @@ traceMethodArguments(J9VMThread* thr, J9UTF8* signature, UDATA* arg0EA, char* bu
switch (*sigChar) {
case '[':
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
traceMethodArgObject(thr, arg0EA--, cursor, endOfBuf - cursor);
while (*sigChar == '[') {
sigChar++;
Expand Down Expand Up @@ -578,9 +575,6 @@ traceMethodReturnVal(J9VMThread* thr, J9UTF8* signature, void* returnValuePtr, c
switch (*(++sigChar)) {
case '[':
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
traceMethodArgObject(thr, returnValuePtr, cursor, endOfBuf - cursor);
break;
case 'J':
Expand Down
3 changes: 0 additions & 3 deletions runtime/tests/jvmtitests/agent/strings.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@ getTypeString(agentEnv * env, jthread currentThread, JNIEnv * jni_env, char sign
sprintf(typeStr, "(jdouble) %f", jvaluePtr->d);
break;
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
if (jvaluePtr->l == NULL) {
sprintf(typeStr, "(jobject) null");
} else {
Expand Down
9 changes: 1 addition & 8 deletions runtime/util/sendslot.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,13 @@ getSendSlotsFromSignature(const U_8* signature)
case '[':
/* skip all '['s */
for (i++; signature[i] == '['; i++);
if ((signature[i] == 'L')
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
|| (signature[i] == 'Q')
#endif /* J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES */
) {
if (signature[i] == 'L') {
/* FALL THRU */
} else {
sendArgs++;
break;
}
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES */
for (i++; signature[i] != ';'; i++);
sendArgs++;
break;
Expand Down
6 changes: 3 additions & 3 deletions runtime/verutil/chverify.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* Methods, other than <init> and <clinit> cannot contain '<' or '>'.
* Classes can contain '[' only at the front if they are array classes.
* Classes can end with ';' only if they are array classes for class file major version < 62
* For class major file version >= 62. They can be array classes or descriptors of form "LClassName;" or "QClassName;".
* For class major file version >= 62. They can be array classes or descriptors of form "LClassName;".
* Classes can contain '/'
* if not the first character,
* if not the last character,
Expand Down Expand Up @@ -88,7 +88,7 @@ checkNameImpl (J9CfrConstantPoolInfo * info, BOOLEAN isClass, BOOLEAN isMethod,
if (J9_ARE_ALL_BITS_SET(info->flags1, CFR_CLASS_FILE_VERSION_SUPPORT_FLATTENABLE_VALUE_TYPE)) {
/* If CFR_CLASS_FILE_VERSION_SUPPORT_FLATTENABLE_VALUE_TYPE is set (class major file version >= 62)
* Valid at the end of array classes
* or descriptors of form "LClassName;" or "QClassName;".
* or descriptors of form "LClassName;".
*/
if ((arity || IS_REF_OR_VAL_SIGNATURE(*info->bytes))
&& ((c + 1) == end)
Expand Down Expand Up @@ -225,7 +225,7 @@ bcvIsReferenceTypeDescriptor(J9CfrConstantPoolInfo * info) {
/* All referencetype descriptors must be more than one character long */
result = FALSE;
} else if (('[' == bytes[0]) || /* Check if bytes is an ArrayType descriptor */
((';' == bytes[length - 1]) && (('L' == bytes[0]) || ('Q' == bytes[0]))) /* Check if bytes is a StandardReferenceType or DeclaredPrimitiveType descriptor */
((';' == bytes[length - 1]) && ('L' == bytes[0])) /* Check if bytes is a StandardReferenceType descriptor */
) {
result = TRUE;
}
Expand Down
4 changes: 2 additions & 2 deletions runtime/vm/classsupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,8 +976,8 @@ loadNonArrayClass(J9VMThread* vmThread, J9Module *j9module, U_8* className, UDAT

#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
if (J9_IS_STRING_DESCRIPTOR(className, classNameLength)) {
className += 1; /* 1 for 'L' or 'Q' */
classNameLength -= 2; /* 2 for 'L'/'Q' and ';' */
className += 1; /* 1 for 'L' */
classNameLength -= 2; /* 2 for 'L' and ';' */
}
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */

Expand Down
3 changes: 0 additions & 3 deletions runtime/vm/extendedMessageNPE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,6 @@ convertMethodSignature(J9VMThread *vmThread, J9UTF8 *methodSig)
bufferSize += 3;
break;
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
{
i += 1;
UDATA objSize = 0;
Expand Down
3 changes: 0 additions & 3 deletions runtime/vm/jnicsup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,6 @@ UDATA JNICALL pushArguments(J9VMThread *vmThread, J9Method* method, void *args)
}
skipSignature = ('L' == *sigChar++);
case 'L':
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
case 'Q':
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
/* skip the rest of the signature */
if (skipSignature) {
while (';' != *sigChar) {
Expand Down
10 changes: 0 additions & 10 deletions runtime/vm/resolvesupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,16 +336,6 @@ resolveClassRef(J9VMThread *vmStruct, J9ConstantPool *ramCP, UDATA cpIndex, UDAT
goto done;
}

#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
if ((';' == *(char *)(classNameData + (classNameLength - 1)))
&& ('Q' == *(char *)classNameData)
) {
/* we are dealing with signature envelope, extract the name from it */
classNameData += 1;
classNameLength -= 2;
}
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */

resolvedClass = internalFindClassUTF8(vmStruct, classNameData, classNameLength,
classLoader, findClassFlags);

Expand Down

0 comments on commit 45bf250

Please sign in to comment.