# HG changeset patch # User Tom Rodriguez # Date 1454041105 28800 # Node ID 071a85b9e631ba1e6233d622f5b56c64d94aa6c1 # Parent 7eb99acd567febe6c23cff95cc4a5900c1ed2dce Fix interface_vs_oop assertion logic for array types diff -r 7eb99acd567f -r 071a85b9e631 src/share/vm/opto/type.cpp --- 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 diff -r 7eb99acd567f -r 071a85b9e631 src/share/vm/opto/type.hpp --- 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