612 push_object(element_klass);
613 }
614 }
615 }
616
617
618 // ------------------------------------------------------------------
619 // ciTypeFlow::StateVector::do_checkcast
620 void ciTypeFlow::StateVector::do_checkcast(ciBytecodeStream* str) {
621 bool will_link;
622 ciKlass* klass = str->get_klass(will_link);
623 if (!will_link) {
624 // VM's interpreter will not load 'klass' if object is NULL.
625 // Type flow after this block may still be needed in two situations:
626 // 1) C2 uses do_null_assert() and continues compilation for later blocks
627 // 2) C2 does an OSR compile in a later block (see bug 4778368).
628 pop_object();
629 do_null_assert(klass);
630 } else {
631 pop_object();
632 if (str->get_never_null()) {
633 // Casting to a Q-Type contains a NULL check
634 assert(klass->is_valuetype(), "must be a value type");
635 push(outer()->mark_as_never_null(klass));
636 } else {
637 push_object(klass);
638 }
639 }
640 }
641
642 // ------------------------------------------------------------------
643 // ciTypeFlow::StateVector::do_getfield
644 void ciTypeFlow::StateVector::do_getfield(ciBytecodeStream* str) {
645 // could add assert here for type of object.
646 pop_object();
647 do_getstatic(str);
648 }
649
650 // ------------------------------------------------------------------
651 // ciTypeFlow::StateVector::do_getstatic
652 void ciTypeFlow::StateVector::do_getstatic(ciBytecodeStream* str) {
|
612 push_object(element_klass);
613 }
614 }
615 }
616
617
618 // ------------------------------------------------------------------
619 // ciTypeFlow::StateVector::do_checkcast
620 void ciTypeFlow::StateVector::do_checkcast(ciBytecodeStream* str) {
621 bool will_link;
622 ciKlass* klass = str->get_klass(will_link);
623 if (!will_link) {
624 // VM's interpreter will not load 'klass' if object is NULL.
625 // Type flow after this block may still be needed in two situations:
626 // 1) C2 uses do_null_assert() and continues compilation for later blocks
627 // 2) C2 does an OSR compile in a later block (see bug 4778368).
628 pop_object();
629 do_null_assert(klass);
630 } else {
631 pop_object();
632 if (str->is_klass_never_null()) {
633 // Casting to a Q-Type contains a NULL check
634 assert(klass->is_valuetype(), "must be a value type");
635 push(outer()->mark_as_never_null(klass));
636 } else {
637 push_object(klass);
638 }
639 }
640 }
641
642 // ------------------------------------------------------------------
643 // ciTypeFlow::StateVector::do_getfield
644 void ciTypeFlow::StateVector::do_getfield(ciBytecodeStream* str) {
645 // could add assert here for type of object.
646 pop_object();
647 do_getstatic(str);
648 }
649
650 // ------------------------------------------------------------------
651 // ciTypeFlow::StateVector::do_getstatic
652 void ciTypeFlow::StateVector::do_getstatic(ciBytecodeStream* str) {
|