Skip to content

Commit

Permalink
Remove q cases that are causing errors with lw5
Browse files Browse the repository at this point in the history
Signed-off-by: Theresa Mammarella <Theresa.T.Mammarella@ibm.com>
  • Loading branch information
theresa-m committed Mar 25, 2024
1 parent 5cb9808 commit 621417b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 54 deletions.
6 changes: 0 additions & 6 deletions jcl/src/java.base/share/classes/java/lang/Class.java
Original file line number Diff line number Diff line change
Expand Up @@ -5594,12 +5594,6 @@ public String descriptorString() {
/*[ENDIF] JAVA_SPEC_VERSION >= 15 */
if (this.isArray()) {
}
/*[IF INLINE-TYPES]*/
else if (this.isPrimitiveClass()) {
name = new StringBuilder(name.length() + 2).
append('Q').append(name).append(';').toString();
}
/*[ENDIF] INLINE-TYPES */
else {
name = new StringBuilder(name.length() + 2).
append('L').append(name).append(';').toString();
Expand Down
14 changes: 3 additions & 11 deletions runtime/jcl/common/java_lang_invoke_MethodHandleNatives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,7 @@ getClassSignature(J9VMThread *currentThread, J9Class * clazz)
if (J9ROMCLASS_IS_ARRAY(clazz->romClass)) {
vm->internalVMFunctions->copyStringToUTF8Helper(currentThread, sigString, J9_STR_NULL_TERMINATE_RESULT | J9_STR_XLAT, 0, J9VMJAVALANGSTRING_LENGTH(currentThread, sigString), (U_8*)sig, utfLength);
} else {
if (J9_IS_J9CLASS_PRIMITIVE_VALUETYPE(clazz)) {
sig[0] = 'Q';
} else {
sig[0] = 'L';
}
sig[0] = 'L';
vm->internalVMFunctions->copyStringToUTF8Helper(currentThread, sigString, J9_STR_XLAT, 0, J9VMJAVALANGSTRING_LENGTH(currentThread, sigString), (U_8*)(sig + 1), utfLength - 1);
sig[utfLength - 2] = ';';
sig[utfLength - 1] = '\0';
Expand Down Expand Up @@ -310,11 +306,7 @@ getClassSignature(J9VMThread *currentThread, J9Class * clazz)
}

if (*name != '[') {
if (J9_IS_J9CLASS_PRIMITIVE_VALUETYPE(myClass)) {
sig[i++] = 'Q';
} else {
sig[i++] = 'L';
}
sig[i++] = 'L';
}

memcpy(sig+i, name, nameLength);
Expand Down Expand Up @@ -1027,7 +1019,7 @@ Java_java_lang_invoke_MethodHandleNatives_resolve(
J9BytecodeVerificationData *verifyData = vm->bytecodeVerificationData;
U_16 sigOffset = 0;

/* Skip the '[', 'L', or 'Q' prefix */
/* Skip the '[' or 'L' prefix */
while ('[' == J9UTF8_DATA(signature)[sigOffset]) {
sigOffset += 1;
}
Expand Down
38 changes: 1 addition & 37 deletions runtime/vm/createramclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1967,42 +1967,6 @@ loadFlattenableFieldValueClasses(J9VMThread *currentThread, J9ClassLoader *class
UDATA signatureLength = J9UTF8_LENGTH(signature);
if (J9_ARE_NO_BITS_SET(modifiers, J9AccStatic)) {
switch (signatureChars[0]) {
case 'Q':
{
J9Class *valueClass = internalFindClassUTF8(currentThread, signatureChars + 1, signatureLength - 2, classLoader, classPreloadFlags);
if (NULL == valueClass) {
result = FALSE;
goto done;
} else {
J9ROMClass *valueROMClass = valueClass->romClass;
/* This restriction has been relaxed from J9ROMCLASS_IS_PRIMITIVE_VALUE_TYPE
* to prevent errors while using the J9ClassIsPrimitiveValueType flag to indicate
* flattening eligibility for nullrestricted fields. Eventually this case will be
* removed with Q types.
*/
if (!J9ROMCLASS_IS_VALUE(valueROMClass)) {
J9UTF8 *badClass = NNSRP_GET(valueROMClass->className, J9UTF8*);
setCurrentExceptionNLSWithArgs(currentThread, J9NLS_VM_ERROR_QTYPE_NOT_VALUE_TYPE, J9VMCONSTANTPOOL_JAVALANGINCOMPATIBLECLASSCHANGEERROR, J9UTF8_LENGTH(badClass), J9UTF8_DATA(badClass));
result = FALSE;
goto done;
}

if (!J9_IS_FIELD_FLATTENED(valueClass, field)) {
*valueTypeFlags |= (J9ClassContainsUnflattenedFlattenables | J9ClassHasReferences);
eligibleForFastSubstitutability = false;
} else if (J9_ARE_NO_BITS_SET(valueClass->classFlags, J9ClassCanSupportFastSubstitutability)) {
eligibleForFastSubstitutability = false;
}

J9FlattenedClassCacheEntry *entry = J9_VM_FCC_ENTRY_FROM_FCC(flattenedClassCache, flattenableFieldCount);
entry->clazz = valueClass;
entry->field = field;
entry->offset = UDATA_MAX;
flattenableFieldCount += 1;
}
*valueTypeFlags |= (valueClass->classFlags & (J9ClassLargestAlignmentConstraintDouble | J9ClassLargestAlignmentConstraintReference | J9ClassHasReferences));
break;
}
case 'D':
eligibleForFastSubstitutability = false;
/* Fall through */
Expand Down Expand Up @@ -2064,7 +2028,7 @@ loadFlattenableFieldValueClasses(J9VMThread *currentThread, J9ClassLoader *class
break;
}
} else {
if ('Q' == signatureChars[0] || J9_ARE_ALL_BITS_SET(modifiers, J9FieldFlagIsNullRestricted)) {
if (J9_ARE_ALL_BITS_SET(modifiers, J9FieldFlagIsNullRestricted)) {
J9FlattenedClassCacheEntry *entry = J9_VM_FCC_ENTRY_FROM_FCC(flattenedClassCache, flattenableFieldCount);
entry->clazz = (J9Class *) J9_VM_FCC_CLASS_FLAGS_STATIC_FIELD;
entry->field = field;
Expand Down

0 comments on commit 621417b

Please sign in to comment.