changeset 5455:26ae62bc26c4

Merge
author coleenp
date Fri, 11 Oct 2013 15:04:53 -0400
parents 301ece1880ad 28ca974cc21a
children df268195b0ea 41459da469ae
files
diffstat 3 files changed, 20 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/oops/constantPool.cpp	Fri Oct 11 14:57:27 2013 +0000
+++ b/src/share/vm/oops/constantPool.cpp	Fri Oct 11 15:04:53 2013 -0400
@@ -864,32 +864,14 @@
 }
 
 
-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
--- a/src/share/vm/utilities/constantTag.cpp	Fri Oct 11 14:57:27 2013 +0000
+++ b/src/share/vm/utilities/constantTag.cpp	Fri Oct 11 15:04:53 2013 -0400
@@ -51,7 +51,9 @@
     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 @@
 }
 
 
+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) {
--- a/src/share/vm/utilities/constantTag.hpp	Fri Oct 11 14:57:27 2013 +0000
+++ b/src/share/vm/utilities/constantTag.hpp	Fri Oct 11 15:04:53 2013 -0400
@@ -108,7 +108,8 @@
     _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?