aboutsummaryrefslogtreecommitdiff
path: root/src/share
diff options
context:
space:
mode:
authorcoleenp <none@none>2013-10-11 11:23:49 -0400
committercoleenp <none@none>2013-10-11 11:23:49 -0400
commit5cbd334572826b65dec6c3f2a10801fe8a8cdb2f (patch)
treee3d2e030d75140a2916b12c589f38f3435721f33 /src/share
parent2efaea969e1a02dc8bd934f1a14dbbde1e3f2345 (diff)
8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
Summary: more missing cases for JVM_CONSTANT_Method{Handle,Type}InError Reviewed-by: hseigel, dcubed
Diffstat (limited to 'src/share')
-rw-r--r--src/share/vm/oops/constantPool.cpp24
-rw-r--r--src/share/vm/utilities/constantTag.cpp15
-rw-r--r--src/share/vm/utilities/constantTag.hpp3
3 files changed, 20 insertions, 22 deletions
diff --git a/src/share/vm/oops/constantPool.cpp b/src/share/vm/oops/constantPool.cpp
index fa13d05d5..73cebb425 100644
--- a/src/share/vm/oops/constantPool.cpp
+++ b/src/share/vm/oops/constantPool.cpp
@@ -864,32 +864,14 @@ void ConstantPool::unreference_symbols() {
}
-jbyte normalize_error_tag(jbyte tag) {
- switch (tag) {
- case JVM_CONSTANT_UnresolvedClassInError:
- return JVM_CONSTANT_UnresolvedClass;
- case JVM_CONSTANT_MethodHandleInError:
- return JVM_CONSTANT_MethodHandle;
- case JVM_CONSTANT_MethodTypeInError:
- return JVM_CONSTANT_MethodType;
- default:
- return tag;
- }
-}
-
// Compare this constant pool's entry at index1 to the constant pool
// cp2's entry at index2.
bool ConstantPool::compare_entry_to(int index1, constantPoolHandle cp2,
int index2, TRAPS) {
- jbyte t1 = tag_at(index1).value();
- jbyte t2 = cp2->tag_at(index2).value();
-
-
- // JVM_CONSTANT_UnresolvedClassInError tag is equal to JVM_CONSTANT_UnresolvedClass
- // when comparing (and the other error tags)
- t1 = normalize_error_tag(t1);
- t2 = normalize_error_tag(t2);
+ // The error tags are equivalent to non-error tags when comparing
+ jbyte t1 = tag_at(index1).non_error_value();
+ jbyte t2 = cp2->tag_at(index2).non_error_value();
if (t1 != t2) {
// Not the same entry type so there is nothing else to check. Note
diff --git a/src/share/vm/utilities/constantTag.cpp b/src/share/vm/utilities/constantTag.cpp
index 25bff0fed..7bc55690a 100644
--- a/src/share/vm/utilities/constantTag.cpp
+++ b/src/share/vm/utilities/constantTag.cpp
@@ -51,7 +51,9 @@ BasicType constantTag::basic_type() const {
case JVM_CONSTANT_ClassIndex :
case JVM_CONSTANT_StringIndex :
case JVM_CONSTANT_MethodHandle :
+ case JVM_CONSTANT_MethodHandleInError :
case JVM_CONSTANT_MethodType :
+ case JVM_CONSTANT_MethodTypeInError :
return T_OBJECT;
default:
ShouldNotReachHere();
@@ -60,6 +62,19 @@ BasicType constantTag::basic_type() const {
}
+jbyte constantTag::non_error_value() const {
+ switch (_tag) {
+ case JVM_CONSTANT_UnresolvedClassInError:
+ return JVM_CONSTANT_UnresolvedClass;
+ case JVM_CONSTANT_MethodHandleInError:
+ return JVM_CONSTANT_MethodHandle;
+ case JVM_CONSTANT_MethodTypeInError:
+ return JVM_CONSTANT_MethodType;
+ default:
+ return _tag;
+ }
+}
+
const char* constantTag::internal_name() const {
switch (_tag) {
diff --git a/src/share/vm/utilities/constantTag.hpp b/src/share/vm/utilities/constantTag.hpp
index 4865ce21f..cedddf6a4 100644
--- a/src/share/vm/utilities/constantTag.hpp
+++ b/src/share/vm/utilities/constantTag.hpp
@@ -108,7 +108,8 @@ class constantTag VALUE_OBJ_CLASS_SPEC {
_tag = tag;
}
- jbyte value() { return _tag; }
+ jbyte value() const { return _tag; }
+ jbyte non_error_value() const;
BasicType basic_type() const; // if used with ldc, what kind of value gets pushed?