changeset 23293:071a85b9e631

Fix interface_vs_oop assertion logic for array types
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Thu, 28 Jan 2016 20:18:25 -0800
parents 7eb99acd567f
children 5d04cfbd1945
files src/share/vm/opto/type.cpp src/share/vm/opto/type.hpp
diffstat 2 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/type.cpp	Mon Jan 25 14:57:27 2016 -0800
+++ b/src/share/vm/opto/type.cpp	Thu Jan 28 20:18:25 2016 -0800
@@ -1981,12 +1981,12 @@
 
 //----------------------interface_vs_oop---------------------------------------
 #ifdef ASSERT
-bool TypeAry::interface_vs_oop(const Type *t) const {
+bool TypeAry::interface_vs_oop_helper(const Type *t) const {
   const TypeAry* t_ary = t->is_ary();
   if (t_ary) {
     return _elem->interface_vs_oop(t_ary->_elem);
   }
-  return false;
+  return Type::interface_vs_oop_helper(t);
 }
 #endif
 
@@ -4060,12 +4060,12 @@
 
 //----------------------interface_vs_oop---------------------------------------
 #ifdef ASSERT
-bool TypeAryPtr::interface_vs_oop(const Type *t) const {
+bool TypeAryPtr::interface_vs_oop_helper(const Type *t) const {
   const TypeAryPtr* t_aryptr = t->isa_aryptr();
   if (t_aryptr) {
     return _ary->interface_vs_oop(t_aryptr->_ary);
   }
-  return false;
+  return Type::interface_vs_oop_helper(t);
 }
 #endif
 
--- a/src/share/vm/opto/type.hpp	Mon Jan 25 14:57:27 2016 -0800
+++ b/src/share/vm/opto/type.hpp	Thu Jan 28 20:18:25 2016 -0800
@@ -159,11 +159,6 @@
   // Table for efficient dualing of base types
   static const TYPES dual_type[lastype];
 
-#ifdef ASSERT
-  // One type is interface, the other is oop
-  virtual bool interface_vs_oop_helper(const Type *t) const;
-#endif
-
   const Type *meet_helper(const Type *t, bool include_speculative) const;
 
 protected:
@@ -178,6 +173,12 @@
     return dual()->meet_helper(t->dual(), include_speculative)->dual();
   }
 
+#ifdef ASSERT
+  // One type is interface, the other is oop.  Override to perform subtype specific
+  // interface_vs_oop checking.
+  virtual bool interface_vs_oop_helper(const Type *t) const;
+#endif
+
 public:
 
   inline void* operator new( size_t x ) throw() {
@@ -681,7 +682,7 @@
   virtual const Type* remove_speculative() const;
 #ifdef ASSERT
   // One type is interface, the other is oop
-  virtual bool interface_vs_oop(const Type *t) const;
+  virtual bool interface_vs_oop_helper(const Type *t) const;
 #endif
 #ifndef PRODUCT
   virtual void dump2( Dict &d, uint, outputStream *st  ) const; // Specialized per-Type dumping
@@ -1167,7 +1168,7 @@
   // sharpen the type of an int which is used as an array size
 #ifdef ASSERT
   // One type is interface, the other is oop
-  virtual bool interface_vs_oop(const Type *t) const;
+  virtual bool interface_vs_oop_helper(const Type *t) const;
 #endif
 #ifndef PRODUCT
   virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping