comparison src/share/vm/oops/constantPool.cpp @ 12850:28ca974cc21a

8022592: assert at constantTag.cpp:57: ShouldNotReachHere() Summary: more missing cases for JVM_CONSTANT_Method{Handle,Type}InError Reviewed-by: hseigel, dcubed
author coleenp
date Fri, 11 Oct 2013 11:23:49 -0400
parents b4a4fdc1f464
children b8860472c377
comparison
equal deleted inserted replaced
12847:cd7ea1d79dac 12850:28ca974cc21a
862 } 862 }
863 } 863 }
864 } 864 }
865 865
866 866
867 jbyte normalize_error_tag(jbyte tag) {
868 switch (tag) {
869 case JVM_CONSTANT_UnresolvedClassInError:
870 return JVM_CONSTANT_UnresolvedClass;
871 case JVM_CONSTANT_MethodHandleInError:
872 return JVM_CONSTANT_MethodHandle;
873 case JVM_CONSTANT_MethodTypeInError:
874 return JVM_CONSTANT_MethodType;
875 default:
876 return tag;
877 }
878 }
879
880 // Compare this constant pool's entry at index1 to the constant pool 867 // Compare this constant pool's entry at index1 to the constant pool
881 // cp2's entry at index2. 868 // cp2's entry at index2.
882 bool ConstantPool::compare_entry_to(int index1, constantPoolHandle cp2, 869 bool ConstantPool::compare_entry_to(int index1, constantPoolHandle cp2,
883 int index2, TRAPS) { 870 int index2, TRAPS) {
884 871
885 jbyte t1 = tag_at(index1).value(); 872 // The error tags are equivalent to non-error tags when comparing
886 jbyte t2 = cp2->tag_at(index2).value(); 873 jbyte t1 = tag_at(index1).non_error_value();
887 874 jbyte t2 = cp2->tag_at(index2).non_error_value();
888
889 // JVM_CONSTANT_UnresolvedClassInError tag is equal to JVM_CONSTANT_UnresolvedClass
890 // when comparing (and the other error tags)
891 t1 = normalize_error_tag(t1);
892 t2 = normalize_error_tag(t2);
893 875
894 if (t1 != t2) { 876 if (t1 != t2) {
895 // Not the same entry type so there is nothing else to check. Note 877 // Not the same entry type so there is nothing else to check. Note
896 // that this style of checking will consider resolved/unresolved 878 // that this style of checking will consider resolved/unresolved
897 // class pairs as different. 879 // class pairs as different.