673 }
674
675 // null seen = bit 0 set?
676 static bool was_null_seen(intptr_t v) {
677 return (v & null_seen) != 0;
678 }
679
680 // conflicting type information = bit 1 set?
681 static bool is_type_unknown(intptr_t v) {
682 return (v & type_unknown) != 0;
683 }
684
685 // not type information yet = all bits cleared, ignoring bit 0?
686 static bool is_type_none(intptr_t v) {
687 return (v & type_mask) == 0;
688 }
689
690 // recorded type: cell without bit 0 and 1
691 static intptr_t klass_part(intptr_t v) {
692 intptr_t r = v & type_klass_mask;
693 assert (r != 0, "invalid");
694 return r;
695 }
696
697 // type recorded
698 static Klass* valid_klass(intptr_t k) {
699 if (!is_type_none(k) &&
700 !is_type_unknown(k)) {
701 return (Klass*)klass_part(k);
702 } else {
703 return NULL;
704 }
705 }
706
707 static intptr_t with_status(intptr_t k, intptr_t in) {
708 return k | (in & status_bits);
709 }
710
711 static intptr_t with_status(Klass* k, intptr_t in) {
712 return with_status((intptr_t)k, in);
713 }
714
715 #ifndef PRODUCT
716 static void print_klass(outputStream* st, intptr_t k);
717 #endif
718
719 // GC support
720 static bool is_loader_alive(BoolObjectClosure* is_alive_cl, intptr_t p);
721
|
673 }
674
675 // null seen = bit 0 set?
676 static bool was_null_seen(intptr_t v) {
677 return (v & null_seen) != 0;
678 }
679
680 // conflicting type information = bit 1 set?
681 static bool is_type_unknown(intptr_t v) {
682 return (v & type_unknown) != 0;
683 }
684
685 // not type information yet = all bits cleared, ignoring bit 0?
686 static bool is_type_none(intptr_t v) {
687 return (v & type_mask) == 0;
688 }
689
690 // recorded type: cell without bit 0 and 1
691 static intptr_t klass_part(intptr_t v) {
692 intptr_t r = v & type_klass_mask;
693 return r;
694 }
695
696 // type recorded
697 static Klass* valid_klass(intptr_t k) {
698 if (!is_type_none(k) &&
699 !is_type_unknown(k)) {
700 Klass* res = (Klass*)klass_part(k);
701 assert(res != NULL, "invalid");
702 return res;
703 } else {
704 return NULL;
705 }
706 }
707
708 static intptr_t with_status(intptr_t k, intptr_t in) {
709 return k | (in & status_bits);
710 }
711
712 static intptr_t with_status(Klass* k, intptr_t in) {
713 return with_status((intptr_t)k, in);
714 }
715
716 #ifndef PRODUCT
717 static void print_klass(outputStream* st, intptr_t k);
718 #endif
719
720 // GC support
721 static bool is_loader_alive(BoolObjectClosure* is_alive_cl, intptr_t p);
722
|