Fri, 11 Oct 2013 11:23:49 -0400
8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
Summary: more missing cases for JVM_CONSTANT_Method{Handle,Type}InError
Reviewed-by: hseigel, dcubed
1.1 --- a/src/share/vm/oops/constantPool.cpp Fri Oct 11 13:48:02 2013 +0200 1.2 +++ b/src/share/vm/oops/constantPool.cpp Fri Oct 11 11:23:49 2013 -0400 1.3 @@ -864,32 +864,14 @@ 1.4 } 1.5 1.6 1.7 -jbyte normalize_error_tag(jbyte tag) { 1.8 - switch (tag) { 1.9 - case JVM_CONSTANT_UnresolvedClassInError: 1.10 - return JVM_CONSTANT_UnresolvedClass; 1.11 - case JVM_CONSTANT_MethodHandleInError: 1.12 - return JVM_CONSTANT_MethodHandle; 1.13 - case JVM_CONSTANT_MethodTypeInError: 1.14 - return JVM_CONSTANT_MethodType; 1.15 - default: 1.16 - return tag; 1.17 - } 1.18 -} 1.19 - 1.20 // Compare this constant pool's entry at index1 to the constant pool 1.21 // cp2's entry at index2. 1.22 bool ConstantPool::compare_entry_to(int index1, constantPoolHandle cp2, 1.23 int index2, TRAPS) { 1.24 1.25 - jbyte t1 = tag_at(index1).value(); 1.26 - jbyte t2 = cp2->tag_at(index2).value(); 1.27 - 1.28 - 1.29 - // JVM_CONSTANT_UnresolvedClassInError tag is equal to JVM_CONSTANT_UnresolvedClass 1.30 - // when comparing (and the other error tags) 1.31 - t1 = normalize_error_tag(t1); 1.32 - t2 = normalize_error_tag(t2); 1.33 + // The error tags are equivalent to non-error tags when comparing 1.34 + jbyte t1 = tag_at(index1).non_error_value(); 1.35 + jbyte t2 = cp2->tag_at(index2).non_error_value(); 1.36 1.37 if (t1 != t2) { 1.38 // Not the same entry type so there is nothing else to check. Note
2.1 --- a/src/share/vm/utilities/constantTag.cpp Fri Oct 11 13:48:02 2013 +0200 2.2 +++ b/src/share/vm/utilities/constantTag.cpp Fri Oct 11 11:23:49 2013 -0400 2.3 @@ -51,7 +51,9 @@ 2.4 case JVM_CONSTANT_ClassIndex : 2.5 case JVM_CONSTANT_StringIndex : 2.6 case JVM_CONSTANT_MethodHandle : 2.7 + case JVM_CONSTANT_MethodHandleInError : 2.8 case JVM_CONSTANT_MethodType : 2.9 + case JVM_CONSTANT_MethodTypeInError : 2.10 return T_OBJECT; 2.11 default: 2.12 ShouldNotReachHere(); 2.13 @@ -60,6 +62,19 @@ 2.14 } 2.15 2.16 2.17 +jbyte constantTag::non_error_value() const { 2.18 + switch (_tag) { 2.19 + case JVM_CONSTANT_UnresolvedClassInError: 2.20 + return JVM_CONSTANT_UnresolvedClass; 2.21 + case JVM_CONSTANT_MethodHandleInError: 2.22 + return JVM_CONSTANT_MethodHandle; 2.23 + case JVM_CONSTANT_MethodTypeInError: 2.24 + return JVM_CONSTANT_MethodType; 2.25 + default: 2.26 + return _tag; 2.27 + } 2.28 +} 2.29 + 2.30 2.31 const char* constantTag::internal_name() const { 2.32 switch (_tag) {
3.1 --- a/src/share/vm/utilities/constantTag.hpp Fri Oct 11 13:48:02 2013 +0200 3.2 +++ b/src/share/vm/utilities/constantTag.hpp Fri Oct 11 11:23:49 2013 -0400 3.3 @@ -108,7 +108,8 @@ 3.4 _tag = tag; 3.5 } 3.6 3.7 - jbyte value() { return _tag; } 3.8 + jbyte value() const { return _tag; } 3.9 + jbyte non_error_value() const; 3.10 3.11 BasicType basic_type() const; // if used with ldc, what kind of value gets pushed? 3.12