8231844: Enhance type signature characters in classfile_constants.h and improve the JVM to use type signature characters more consistently

Increase the use of type signature constants instead of hard coded characters within the JVM.

Co-authored-by: John Rose <john.r.rose@oracle.com>
Reviewed-by: coleenp, dholmes, fparain
This commit is contained in:
Lois Foltan 2019-10-21 13:13:16 -04:00
parent 0192c5a02f
commit fce4320369
43 changed files with 371 additions and 326 deletions

View file

@ -187,7 +187,7 @@ const char* ClassLoader::package_from_name(const char* const class_name, bool* b
*bad_class_name = false;
}
const char* const last_slash = strrchr(class_name, '/');
const char* const last_slash = strrchr(class_name, JVM_SIGNATURE_SLASH);
if (last_slash == NULL) {
// No package name
return NULL;
@ -195,16 +195,16 @@ const char* ClassLoader::package_from_name(const char* const class_name, bool* b
char* class_name_ptr = (char*) class_name;
// Skip over '['s
if (*class_name_ptr == '[') {
if (*class_name_ptr == JVM_SIGNATURE_ARRAY) {
do {
class_name_ptr++;
} while (*class_name_ptr == '[');
} while (*class_name_ptr == JVM_SIGNATURE_ARRAY);
// Fully qualified class names should not contain a 'L'.
// Set bad_class_name to true to indicate that the package name
// could not be obtained due to an error condition.
// In this situation, is_same_class_package returns false.
if (*class_name_ptr == 'L') {
if (*class_name_ptr == JVM_SIGNATURE_CLASS) {
if (bad_class_name != NULL) {
*bad_class_name = true;
}