comparison src/share/vm/opto/subnode.cpp @ 783:a9e116455022

6832293: JIT compiler got wrong result in type checking with -server Summary: Check for an object array of interface in CmpPNode::sub(). Reviewed-by: never
author kvn
date Mon, 11 May 2009 17:59:54 -0700
parents 90a66aa50514
children bd02caa94611
comparison
equal deleted inserted replaced
782:900e4df4b0c3 783:a9e116455022
638 bool xklass1 = p1->klass_is_exact(); 638 bool xklass1 = p1->klass_is_exact();
639 int kps = (p0->isa_klassptr()?1:0) + (p1->isa_klassptr()?1:0); 639 int kps = (p0->isa_klassptr()?1:0) + (p1->isa_klassptr()?1:0);
640 if (klass0 && klass1 && 640 if (klass0 && klass1 &&
641 kps != 1 && // both or neither are klass pointers 641 kps != 1 && // both or neither are klass pointers
642 klass0->is_loaded() && !klass0->is_interface() && // do not trust interfaces 642 klass0->is_loaded() && !klass0->is_interface() && // do not trust interfaces
643 klass1->is_loaded() && !klass1->is_interface()) { 643 klass1->is_loaded() && !klass1->is_interface() &&
644 (!klass0->is_obj_array_klass() ||
645 !klass0->as_obj_array_klass()->base_element_klass()->is_interface()) &&
646 (!klass1->is_obj_array_klass() ||
647 !klass1->as_obj_array_klass()->base_element_klass()->is_interface())) {
644 bool unrelated_classes = false; 648 bool unrelated_classes = false;
645 // See if neither subclasses the other, or if the class on top 649 // See if neither subclasses the other, or if the class on top
646 // is precise. In either of these cases, the compare is known 650 // is precise. In either of these cases, the compare is known
647 // to fail if at least one of the pointers is provably not null. 651 // to fail if at least one of the pointers is provably not null.
648 if (klass0->equals(klass1) || // if types are unequal but klasses are 652 if (klass0->equals(klass1) || // if types are unequal but klasses are