--- old/src/hotspot/share/utilities/constantTag.hpp 2019-03-11 14:27:27.278354033 +0100 +++ new/src/hotspot/share/utilities/constantTag.hpp 2019-03-11 14:27:27.066354036 +0100 @@ -40,8 +40,8 @@ JVM_CONSTANT_Invalid = 0, // For bad value initialization JVM_CONSTANT_InternalMin = 100, // First implementation tag (aside from bad value of course) JVM_CONSTANT_UnresolvedClass = 100, // Temporary tag until actual use - JVM_CONSTANT_ClassIndex = 101, // Temporary tag while constructing constant pool - JVM_CONSTANT_StringIndex = 102, // Temporary tag while constructing constant pool + JVM_CONSTANT_ClassIndex = 101, // Temporary tag while constructing constant pool, class redefinition + JVM_CONSTANT_StringIndex = 102, // Temporary tag while constructing constant pool, class redefinition JVM_CONSTANT_UnresolvedClassInError = 103, // Error tag due to resolution error JVM_CONSTANT_MethodHandleInError = 104, // Error tag due to resolution error JVM_CONSTANT_MethodTypeInError = 105, // Error tag due to resolution error @@ -49,12 +49,13 @@ JVM_CONSTANT_InternalMax = 106 // Last implementation tag }; +#define JVM_CONSTANT_QDESC_BIT (1 << 7) class constantTag { private: jbyte _tag; public: - bool is_klass() const { return _tag == JVM_CONSTANT_Class; } + bool is_klass() const { return value() == JVM_CONSTANT_Class; } bool is_field () const { return _tag == JVM_CONSTANT_Fieldref; } bool is_method() const { return _tag == JVM_CONSTANT_Methodref; } bool is_interface_method() const { return _tag == JVM_CONSTANT_InterfaceMethodref; } @@ -69,11 +70,15 @@ bool is_invalid() const { return _tag == JVM_CONSTANT_Invalid; } bool is_unresolved_klass() const { - return _tag == JVM_CONSTANT_UnresolvedClass || _tag == JVM_CONSTANT_UnresolvedClassInError; + return value() == JVM_CONSTANT_UnresolvedClass || value() == JVM_CONSTANT_UnresolvedClassInError; } bool is_unresolved_klass_in_error() const { - return _tag == JVM_CONSTANT_UnresolvedClassInError; + return value() == JVM_CONSTANT_UnresolvedClassInError; + } + + bool is_Qdescriptor_klass() const { + return (_tag & JVM_CONSTANT_QDESC_BIT) != 0; } bool is_method_handle_in_error() const { @@ -116,9 +121,14 @@ _tag = JVM_CONSTANT_Invalid; } constantTag(jbyte tag) { - assert((tag >= 0 && tag <= JVM_CONSTANT_NameAndType) || - (tag >= JVM_CONSTANT_MethodHandle && tag <= JVM_CONSTANT_InvokeDynamic) || - (tag >= JVM_CONSTANT_InternalMin && tag <= JVM_CONSTANT_InternalMax), "Invalid constant tag"); + jbyte entry_tag = tag & ~JVM_CONSTANT_QDESC_BIT; + assert((((tag & JVM_CONSTANT_QDESC_BIT) == 0) && (entry_tag >= 0 && entry_tag <= JVM_CONSTANT_NameAndType) || + (entry_tag >= JVM_CONSTANT_MethodHandle && entry_tag <= JVM_CONSTANT_InvokeDynamic) || + (entry_tag >= JVM_CONSTANT_InternalMin && entry_tag <= JVM_CONSTANT_InternalMax)) + || (((tag & JVM_CONSTANT_QDESC_BIT) != 0) && (entry_tag == JVM_CONSTANT_Class || + entry_tag == JVM_CONSTANT_UnresolvedClass || entry_tag == JVM_CONSTANT_UnresolvedClassInError + || entry_tag == JVM_CONSTANT_ClassIndex)) + , "Invalid constant tag"); _tag = tag; } @@ -136,7 +146,8 @@ return constantTag(); } - jbyte value() const { return _tag; } + jbyte value() const { return _tag & ~JVM_CONSTANT_QDESC_BIT; } + jbyte tag() const { return _tag; } jbyte error_value() const; jbyte non_error_value() const;