--- old/src/hotspot/share/utilities/constantTag.cpp 2018-09-28 11:53:57.000000000 -0700 +++ new/src/hotspot/share/utilities/constantTag.cpp 2018-09-28 11:53:57.000000000 -0700 @@ -68,6 +68,31 @@ } +// value as specified in the classfile format +jbyte constantTag::classfile_value() const { + switch (_tag) { + case JVM_CONSTANT_ClassIndex: + case JVM_CONSTANT_UnresolvedClass: + case JVM_CONSTANT_UnresolvedClassInError: + return JVM_CONSTANT_Class; + case JVM_CONSTANT_StringIndex: + return JVM_CONSTANT_String; + case JVM_CONSTANT_MethodHandleInError: + return JVM_CONSTANT_MethodHandle; + case JVM_CONSTANT_MethodTypeInError: + return JVM_CONSTANT_MethodType; + case JVM_CONSTANT_DynamicInError: + return JVM_CONSTANT_Dynamic; + default: + // Return a zero tag for a gap after Long or Double, + // even though that doesn't exactly appear in a classfile. + assert(_tag >= 0 && _tag <= JVM_CONSTANT_ExternalMax, + "cannot interpret tag %d as a standard classfile tag", _tag); + return _tag; + } +} + + jbyte constantTag::non_error_value() const { switch (_tag) { case JVM_CONSTANT_UnresolvedClassInError: