846 } |
846 } |
847 |
847 |
848 // Until we have harmony between classes and interfaces in the type |
848 // Until we have harmony between classes and interfaces in the type |
849 // lattice, we must tread carefully around phis which implicitly |
849 // lattice, we must tread carefully around phis which implicitly |
850 // convert the one to the other. |
850 // convert the one to the other. |
851 const TypeInstPtr* ttip = _type->isa_instptr(); |
851 const TypeInstPtr* ttip = _type->isa_narrowoop() ? _type->isa_narrowoop()->make_oopptr()->isa_instptr() :_type->isa_instptr(); |
852 bool is_intf = false; |
852 bool is_intf = false; |
853 if (ttip != NULL) { |
853 if (ttip != NULL) { |
854 ciKlass* k = ttip->klass(); |
854 ciKlass* k = ttip->klass(); |
855 if (k->is_loaded() && k->is_interface()) |
855 if (k->is_loaded() && k->is_interface()) |
856 is_intf = true; |
856 is_intf = true; |
865 // We assume that each input of an interface-valued Phi is a true |
865 // We assume that each input of an interface-valued Phi is a true |
866 // subtype of that interface. This might not be true of the meet |
866 // subtype of that interface. This might not be true of the meet |
867 // of all the input types. The lattice is not distributive in |
867 // of all the input types. The lattice is not distributive in |
868 // such cases. Ward off asserts in type.cpp by refusing to do |
868 // such cases. Ward off asserts in type.cpp by refusing to do |
869 // meets between interfaces and proper classes. |
869 // meets between interfaces and proper classes. |
870 const TypeInstPtr* tiip = ti->isa_instptr(); |
870 const TypeInstPtr* tiip = ti->isa_narrowoop() ? ti->is_narrowoop()->make_oopptr()->isa_instptr() : ti->isa_instptr(); |
871 if (tiip) { |
871 if (tiip) { |
872 bool ti_is_intf = false; |
872 bool ti_is_intf = false; |
873 ciKlass* k = tiip->klass(); |
873 ciKlass* k = tiip->klass(); |
874 if (k->is_loaded() && k->is_interface()) |
874 if (k->is_loaded() && k->is_interface()) |
875 ti_is_intf = true; |
875 ti_is_intf = true; |
922 // If we have an interface-typed Phi and we narrow to a class type, the join |
922 // If we have an interface-typed Phi and we narrow to a class type, the join |
923 // should report back the class. However, if we have a J/L/Object |
923 // should report back the class. However, if we have a J/L/Object |
924 // class-typed Phi and an interface flows in, it's possible that the meet & |
924 // class-typed Phi and an interface flows in, it's possible that the meet & |
925 // join report an interface back out. This isn't possible but happens |
925 // join report an interface back out. This isn't possible but happens |
926 // because the type system doesn't interact well with interfaces. |
926 // because the type system doesn't interact well with interfaces. |
927 const TypeInstPtr *jtip = jt->isa_instptr(); |
927 const TypeInstPtr *jtip = jt->isa_narrowoop() ? jt->isa_narrowoop()->make_oopptr()->isa_instptr() : jt->isa_instptr(); |
928 if( jtip && ttip ) { |
928 if( jtip && ttip ) { |
929 if( jtip->is_loaded() && jtip->klass()->is_interface() && |
929 if( jtip->is_loaded() && jtip->klass()->is_interface() && |
930 ttip->is_loaded() && !ttip->klass()->is_interface() ) |
930 ttip->is_loaded() && !ttip->klass()->is_interface() ) { |
931 // Happens in a CTW of rt.jar, 320-341, no extra flags |
931 // Happens in a CTW of rt.jar, 320-341, no extra flags |
932 { assert(ft == ttip->cast_to_ptr_type(jtip->ptr()), ""); jt = ft; } |
932 assert(ft == ttip->cast_to_ptr_type(jtip->ptr()) || |
|
933 ft->isa_narrowoop() && ft->isa_narrowoop()->make_oopptr() == ttip->cast_to_ptr_type(jtip->ptr()), ""); |
|
934 jt = ft; |
|
935 } |
933 } |
936 } |
934 if (jt != ft && jt->base() == ft->base()) { |
937 if (jt != ft && jt->base() == ft->base()) { |
935 if (jt->isa_int() && |
938 if (jt->isa_int() && |
936 jt->is_int()->_lo == ft->is_int()->_lo && |
939 jt->is_int()->_lo == ft->is_int()->_lo && |
937 jt->is_int()->_hi == ft->is_int()->_hi) |
940 jt->is_int()->_hi == ft->is_int()->_hi) |