comparison src/share/vm/opto/cfgnode.cpp @ 23849:09687c445ce1

8141551: C2 can not handle returns with inccompatible interface arrays Reviewed-by: kvn
author shshahma
date Thu, 21 Apr 2016 21:53:15 +0530
parents c1091733abe6
children f13e777eb255
comparison
equal deleted inserted replaced
23848:3e1cd663c2d3 23849:09687c445ce1
971 const Type* ft = t->filter_speculative(_type); // Worst case type 971 const Type* ft = t->filter_speculative(_type); // Worst case type
972 972
973 #ifdef ASSERT 973 #ifdef ASSERT
974 // The following logic has been moved into TypeOopPtr::filter. 974 // The following logic has been moved into TypeOopPtr::filter.
975 const Type* jt = t->join_speculative(_type); 975 const Type* jt = t->join_speculative(_type);
976 if( jt->empty() ) { // Emptied out??? 976 if (jt->empty()) { // Emptied out???
977 977
978 // Check for evil case of 't' being a class and '_type' expecting an 978 // Check for evil case of 't' being a class and '_type' expecting an
979 // interface. This can happen because the bytecodes do not contain 979 // interface. This can happen because the bytecodes do not contain
980 // enough type info to distinguish a Java-level interface variable 980 // enough type info to distinguish a Java-level interface variable
981 // from a Java-level object variable. If we meet 2 classes which 981 // from a Java-level object variable. If we meet 2 classes which
982 // both implement interface I, but their meet is at 'j/l/O' which 982 // both implement interface I, but their meet is at 'j/l/O' which
983 // doesn't implement I, we have no way to tell if the result should 983 // doesn't implement I, we have no way to tell if the result should
984 // be 'I' or 'j/l/O'. Thus we'll pick 'j/l/O'. If this then flows 984 // be 'I' or 'j/l/O'. Thus we'll pick 'j/l/O'. If this then flows
985 // into a Phi which "knows" it's an Interface type we'll have to 985 // into a Phi which "knows" it's an Interface type we'll have to
986 // uplift the type. 986 // uplift the type.
987 if( !t->empty() && ttip && ttip->is_loaded() && ttip->klass()->is_interface() ) 987 if (!t->empty() && ttip && ttip->is_loaded() && ttip->klass()->is_interface()) {
988 { assert(ft == _type, ""); } // Uplift to interface 988 assert(ft == _type, ""); // Uplift to interface
989 else if( !t->empty() && ttkp && ttkp->is_loaded() && ttkp->klass()->is_interface() ) 989 } else if (!t->empty() && ttkp && ttkp->is_loaded() && ttkp->klass()->is_interface()) {
990 { assert(ft == _type, ""); } // Uplift to interface 990 assert(ft == _type, ""); // Uplift to interface
991 // Otherwise it's something stupid like non-overlapping int ranges 991 } else {
992 // found on dying counted loops. 992 // We also have to handle 'evil cases' of interface- vs. class-arrays
993 else 993 Type::get_arrays_base_elements(jt, _type, NULL, &ttip);
994 { assert(ft == Type::TOP, ""); } // Canonical empty value 994 if (!t->empty() && ttip != NULL && ttip->is_loaded() && ttip->klass()->is_interface()) {
995 assert(ft == _type, ""); // Uplift to array of interface
996 } else {
997 // Otherwise it's something stupid like non-overlapping int ranges
998 // found on dying counted loops.
999 assert(ft == Type::TOP, ""); // Canonical empty value
1000 }
1001 }
995 } 1002 }
996 1003
997 else { 1004 else {
998 1005
999 // If we have an interface-typed Phi and we narrow to a class type, the join 1006 // If we have an interface-typed Phi and we narrow to a class type, the join