Lines 526-537
Link Here
|
526 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
526 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
527 |
return false; |
527 |
return false; |
528 |
} |
528 |
} |
529 |
int position; |
529 |
int position = local.getAnalysisId(this.maxFieldCount); |
530 |
if (local instanceof FieldBinding) { |
|
|
531 |
position = local.id; |
532 |
} else { |
533 |
position = local.id + this.maxFieldCount; |
534 |
} |
535 |
if (position < BitCacheSize) { |
530 |
if (position < BitCacheSize) { |
536 |
// use bits |
531 |
// use bits |
537 |
return ( |
532 |
return ( |
Lines 562-573
Link Here
|
562 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
557 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
563 |
return false; |
558 |
return false; |
564 |
} |
559 |
} |
565 |
int position; |
560 |
int position = local.getAnalysisId(this.maxFieldCount); |
566 |
if (local instanceof FieldBinding) { |
|
|
567 |
position = local.id; |
568 |
} else { |
569 |
position = local.id + this.maxFieldCount; |
570 |
} |
571 |
if (position < BitCacheSize) { |
561 |
if (position < BitCacheSize) { |
572 |
// use bits |
562 |
// use bits |
573 |
return (this.nullBit1 & this.nullBit3 |
563 |
return (this.nullBit1 & this.nullBit3 |
Lines 594-605
Link Here
|
594 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
584 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
595 |
return false; |
585 |
return false; |
596 |
} |
586 |
} |
597 |
int position; |
587 |
int position = local.getAnalysisId(this.maxFieldCount); |
598 |
if (local instanceof FieldBinding) { |
|
|
599 |
position = local.id; |
600 |
} else { |
601 |
position = local.id + this.maxFieldCount; |
602 |
} |
603 |
if (position < BitCacheSize) { |
588 |
if (position < BitCacheSize) { |
604 |
// use bits |
589 |
// use bits |
605 |
return (this.nullBit1 & this.nullBit2 |
590 |
return (this.nullBit1 & this.nullBit2 |
Lines 755-761
Link Here
|
755 |
if ((this.tagBits & UNREACHABLE_OR_DEAD) != 0) { |
740 |
if ((this.tagBits & UNREACHABLE_OR_DEAD) != 0) { |
756 |
return true; |
741 |
return true; |
757 |
} |
742 |
} |
758 |
return isDefinitelyAssigned(field.id); |
743 |
return isDefinitelyAssigned(field.getAnalysisId(this.maxFieldCount)); |
759 |
} |
744 |
} |
760 |
|
745 |
|
761 |
final public boolean isDefinitelyAssigned(LocalVariableBinding local) { |
746 |
final public boolean isDefinitelyAssigned(LocalVariableBinding local) { |
Lines 782-797
Link Here
|
782 |
local.constant() != Constant.NotAConstant) { // String instances |
767 |
local.constant() != Constant.NotAConstant) { // String instances |
783 |
return true; |
768 |
return true; |
784 |
} |
769 |
} |
785 |
int position; |
|
|
786 |
if (local instanceof FieldBinding) { |
770 |
if (local instanceof FieldBinding) { |
787 |
if (local.isFinal() && ((FieldBinding)local).isStatic()) { |
771 |
if (local.isFinal() && ((FieldBinding)local).isStatic()) { |
788 |
// static final field's null status may not be in the flow info |
772 |
// static final field's null status may not be in the flow info |
789 |
return (((FieldBinding) local).getNullStatusForStaticFinalField() == FlowInfo.NON_NULL); |
773 |
return (((FieldBinding) local).getNullStatusForStaticFinalField() == FlowInfo.NON_NULL); |
790 |
} |
774 |
} |
791 |
position = local.id; |
|
|
792 |
} else { |
793 |
position = local.id + this.maxFieldCount; |
794 |
} |
775 |
} |
|
|
776 |
int position = local.getAnalysisId(this.maxFieldCount); |
795 |
if (position < BitCacheSize) { // use bits |
777 |
if (position < BitCacheSize) { // use bits |
796 |
return ((this.nullBit1 & this.nullBit3 & (~this.nullBit2 | this.nullBit4)) |
778 |
return ((this.nullBit1 & this.nullBit3 & (~this.nullBit2 | this.nullBit4)) |
797 |
& (1L << position)) != 0; |
779 |
& (1L << position)) != 0; |
Lines 823-838
Link Here
|
823 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
805 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
824 |
return false; |
806 |
return false; |
825 |
} |
807 |
} |
826 |
int position; |
|
|
827 |
if (local instanceof FieldBinding) { |
808 |
if (local instanceof FieldBinding) { |
828 |
if (local.isFinal() && ((FieldBinding)local).isStatic()) { |
809 |
if (local.isFinal() && ((FieldBinding)local).isStatic()) { |
829 |
// static final field's null status may not be in the flow info |
810 |
// static final field's null status may not be in the flow info |
830 |
return (((FieldBinding) local).getNullStatusForStaticFinalField() == FlowInfo.NULL); |
811 |
return (((FieldBinding) local).getNullStatusForStaticFinalField() == FlowInfo.NULL); |
831 |
} |
812 |
} |
832 |
position = local.id; |
|
|
833 |
} else { |
834 |
position = local.id + this.maxFieldCount; |
835 |
} |
813 |
} |
|
|
814 |
int position = local.getAnalysisId(this.maxFieldCount); |
836 |
if (position < BitCacheSize) { // use bits |
815 |
if (position < BitCacheSize) { // use bits |
837 |
return ((this.nullBit1 & this.nullBit2 |
816 |
return ((this.nullBit1 & this.nullBit2 |
838 |
& (~this.nullBit3 | ~this.nullBit4)) |
817 |
& (~this.nullBit3 | ~this.nullBit4)) |
Lines 858-869
Link Here
|
858 |
(this.tagBits & NULL_FLAG_MASK) == 0) { |
837 |
(this.tagBits & NULL_FLAG_MASK) == 0) { |
859 |
return false; |
838 |
return false; |
860 |
} |
839 |
} |
861 |
int position; |
840 |
int position = local.getAnalysisId(this.maxFieldCount); |
862 |
if (local instanceof FieldBinding) { |
|
|
863 |
position = local.id; |
864 |
} else { |
865 |
position = local.id + this.maxFieldCount; |
866 |
} |
867 |
if (position < BitCacheSize) { // use bits |
841 |
if (position < BitCacheSize) { // use bits |
868 |
return ((this.nullBit1 & this.nullBit4 |
842 |
return ((this.nullBit1 & this.nullBit4 |
869 |
& ~this.nullBit2 & ~this.nullBit3) & (1L << position)) != 0; |
843 |
& ~this.nullBit2 & ~this.nullBit3) & (1L << position)) != 0; |
Lines 905-911
Link Here
|
905 |
} |
879 |
} |
906 |
|
880 |
|
907 |
final public boolean isPotentiallyAssigned(FieldBinding field) { |
881 |
final public boolean isPotentiallyAssigned(FieldBinding field) { |
908 |
return isPotentiallyAssigned(field.id); |
882 |
return isPotentiallyAssigned(field.getAnalysisId(this.maxFieldCount)); |
909 |
} |
883 |
} |
910 |
|
884 |
|
911 |
final public boolean isPotentiallyAssigned(LocalVariableBinding local) { |
885 |
final public boolean isPotentiallyAssigned(LocalVariableBinding local) { |
Lines 922-933
Link Here
|
922 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
896 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
923 |
return false; |
897 |
return false; |
924 |
} |
898 |
} |
925 |
int position; |
899 |
int position = local.getAnalysisId(this.maxFieldCount); |
926 |
if (local instanceof FieldBinding) { |
|
|
927 |
position = local.id; |
928 |
} else { |
929 |
position = local.id + this.maxFieldCount; |
930 |
} |
931 |
if (position < BitCacheSize) { // use bits |
900 |
if (position < BitCacheSize) { // use bits |
932 |
// use bits |
901 |
// use bits |
933 |
return ((this.nullBit3 & (~this.nullBit1 | ~this.nullBit2)) |
902 |
return ((this.nullBit3 & (~this.nullBit1 | ~this.nullBit2)) |
Lines 953-968
Link Here
|
953 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
922 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
954 |
return false; |
923 |
return false; |
955 |
} |
924 |
} |
956 |
int position; |
|
|
957 |
if (local instanceof FieldBinding) { |
925 |
if (local instanceof FieldBinding) { |
958 |
if (local.isFinal() && ((FieldBinding)local).isStatic()) { |
926 |
if (local.isFinal() && ((FieldBinding)local).isStatic()) { |
959 |
// static final field's null status may not be in the flow info |
927 |
// static final field's null status may not be in the flow info |
960 |
return (((FieldBinding) local).getNullStatusForStaticFinalField() == FlowInfo.POTENTIALLY_NULL); |
928 |
return (((FieldBinding) local).getNullStatusForStaticFinalField() == FlowInfo.POTENTIALLY_NULL); |
961 |
} |
929 |
} |
962 |
position = local.id; |
|
|
963 |
} else { |
964 |
position = local.id + this.maxFieldCount; |
965 |
} |
930 |
} |
|
|
931 |
int position = local.getAnalysisId(this.maxFieldCount); |
966 |
if (position < BitCacheSize) { |
932 |
if (position < BitCacheSize) { |
967 |
// use bits |
933 |
// use bits |
968 |
return ((this.nullBit2 & (~this.nullBit1 | ~this.nullBit3)) |
934 |
return ((this.nullBit2 & (~this.nullBit1 | ~this.nullBit3)) |
Lines 988-999
Link Here
|
988 |
(this.tagBits & NULL_FLAG_MASK) == 0) { |
954 |
(this.tagBits & NULL_FLAG_MASK) == 0) { |
989 |
return false; |
955 |
return false; |
990 |
} |
956 |
} |
991 |
int position; |
957 |
int position = local.getAnalysisId(this.maxFieldCount); |
992 |
if (local instanceof FieldBinding) { |
|
|
993 |
position = local.id; |
994 |
} else { |
995 |
position = local.id + this.maxFieldCount; |
996 |
} |
997 |
if (position < BitCacheSize) { // use bits |
958 |
if (position < BitCacheSize) { // use bits |
998 |
return (this.nullBit4 |
959 |
return (this.nullBit4 |
999 |
& (~this.nullBit1 | ~this.nullBit2 & ~this.nullBit3) |
960 |
& (~this.nullBit1 | ~this.nullBit2 & ~this.nullBit3) |
Lines 1019-1030
Link Here
|
1019 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
980 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
1020 |
return false; |
981 |
return false; |
1021 |
} |
982 |
} |
1022 |
int position; |
983 |
int position = local.getAnalysisId(this.maxFieldCount); |
1023 |
if (local instanceof FieldBinding) { |
|
|
1024 |
position = local.id; |
1025 |
} else { |
1026 |
position = local.id + this.maxFieldCount; |
1027 |
} |
1028 |
if (position < BitCacheSize) { // use bits |
984 |
if (position < BitCacheSize) { // use bits |
1029 |
return (this.nullBit1 & this.nullBit3 & this.nullBit4 & (1L << position)) != 0; |
985 |
return (this.nullBit1 & this.nullBit3 & this.nullBit4 & (1L << position)) != 0; |
1030 |
} |
986 |
} |
Lines 1048-1059
Link Here
|
1048 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
1004 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
1049 |
return false; |
1005 |
return false; |
1050 |
} |
1006 |
} |
1051 |
int position; |
1007 |
int position = local.getAnalysisId(this.maxFieldCount); |
1052 |
if (local instanceof FieldBinding) { |
|
|
1053 |
position = local.id; |
1054 |
} else { |
1055 |
position = local.id + this.maxFieldCount; |
1056 |
} |
1057 |
if (position < BitCacheSize) { |
1008 |
if (position < BitCacheSize) { |
1058 |
// use bits |
1009 |
// use bits |
1059 |
return (this.nullBit1 & this.nullBit2 |
1010 |
return (this.nullBit1 & this.nullBit2 |
Lines 1326-1332
Link Here
|
1326 |
|
1277 |
|
1327 |
public void markAsDefinitelyAssigned(FieldBinding field) { |
1278 |
public void markAsDefinitelyAssigned(FieldBinding field) { |
1328 |
if (this != DEAD_END) |
1279 |
if (this != DEAD_END) |
1329 |
markAsDefinitelyAssigned(field.id); |
1280 |
markAsDefinitelyAssigned(field.getAnalysisId(this.maxFieldCount)); |
1330 |
} |
1281 |
} |
1331 |
|
1282 |
|
1332 |
public void markAsDefinitelyAssigned(LocalVariableBinding local) { |
1283 |
public void markAsDefinitelyAssigned(LocalVariableBinding local) { |
Lines 1465-1477
Link Here
|
1465 |
if (this != DEAD_END) { |
1416 |
if (this != DEAD_END) { |
1466 |
this.tagBits |= NULL_FLAG_MASK; |
1417 |
this.tagBits |= NULL_FLAG_MASK; |
1467 |
long mask; |
1418 |
long mask; |
1468 |
int position; |
1419 |
int position = local.getAnalysisId(this.maxFieldCount); |
1469 |
// position is zero-based |
|
|
1470 |
if (local instanceof FieldBinding) { |
1471 |
position = local.id; |
1472 |
} else { |
1473 |
position = local.id + this.maxFieldCount; |
1474 |
} |
1475 |
if (position < BitCacheSize) { |
1420 |
if (position < BitCacheSize) { |
1476 |
// use bits |
1421 |
// use bits |
1477 |
// mark assigned null |
1422 |
// mark assigned null |
Lines 1523-1535
Link Here
|
1523 |
public void resetNullInfo(VariableBinding local) { |
1468 |
public void resetNullInfo(VariableBinding local) { |
1524 |
if (this != DEAD_END) { |
1469 |
if (this != DEAD_END) { |
1525 |
this.tagBits |= NULL_FLAG_MASK; |
1470 |
this.tagBits |= NULL_FLAG_MASK; |
1526 |
int position; |
|
|
1527 |
long mask; |
1471 |
long mask; |
1528 |
if (local instanceof FieldBinding) { |
1472 |
int position = local.getAnalysisId(this.maxFieldCount); |
1529 |
position = local.id; |
|
|
1530 |
} else { |
1531 |
position = local.id + this.maxFieldCount; |
1532 |
} |
1533 |
if (position < BitCacheSize) { |
1473 |
if (position < BitCacheSize) { |
1534 |
// use bits |
1474 |
// use bits |
1535 |
this.nullBit1 &= (mask = ~(1L << position)); |
1475 |
this.nullBit1 &= (mask = ~(1L << position)); |
Lines 1593-1605
Link Here
|
1593 |
// protected from non-object locals in calling methods |
1533 |
// protected from non-object locals in calling methods |
1594 |
if (this != DEAD_END) { |
1534 |
if (this != DEAD_END) { |
1595 |
this.tagBits |= NULL_FLAG_MASK; |
1535 |
this.tagBits |= NULL_FLAG_MASK; |
1596 |
int position; |
|
|
1597 |
long mask; |
1536 |
long mask; |
1598 |
if (local instanceof FieldBinding) { |
1537 |
int position = local.getAnalysisId(this.maxFieldCount); |
1599 |
position = local.id; |
|
|
1600 |
} else { |
1601 |
position = local.id + this.maxFieldCount; |
1602 |
} |
1603 |
if (position < BitCacheSize) { |
1538 |
if (position < BitCacheSize) { |
1604 |
// use bits |
1539 |
// use bits |
1605 |
mask = 1L << position; |
1540 |
mask = 1L << position; |
Lines 1645-1657
Link Here
|
1645 |
public void markPotentiallyNullBit(VariableBinding local) { |
1580 |
public void markPotentiallyNullBit(VariableBinding local) { |
1646 |
if (this != DEAD_END) { |
1581 |
if (this != DEAD_END) { |
1647 |
this.tagBits |= NULL_FLAG_MASK; |
1582 |
this.tagBits |= NULL_FLAG_MASK; |
1648 |
int position; |
|
|
1649 |
long mask; |
1583 |
long mask; |
1650 |
if (local instanceof FieldBinding) { |
1584 |
int position = local.getAnalysisId(this.maxFieldCount); |
1651 |
position = local.id; |
|
|
1652 |
} else { |
1653 |
position = local.id + this.maxFieldCount; |
1654 |
} |
1655 |
if (position < BitCacheSize) { |
1585 |
if (position < BitCacheSize) { |
1656 |
// use bits |
1586 |
// use bits |
1657 |
mask = 1L << position; |
1587 |
mask = 1L << position; |
Lines 1697-1709
Link Here
|
1697 |
public void markPotentiallyNonNullBit(VariableBinding local) { |
1627 |
public void markPotentiallyNonNullBit(VariableBinding local) { |
1698 |
if (this != DEAD_END) { |
1628 |
if (this != DEAD_END) { |
1699 |
this.tagBits |= NULL_FLAG_MASK; |
1629 |
this.tagBits |= NULL_FLAG_MASK; |
1700 |
int position; |
|
|
1701 |
long mask; |
1630 |
long mask; |
1702 |
if (local instanceof FieldBinding) { |
1631 |
int position = local.getAnalysisId(this.maxFieldCount); |
1703 |
position = local.id; |
|
|
1704 |
} else { |
1705 |
position = local.id + this.maxFieldCount; |
1706 |
} |
1707 |
if (position < BitCacheSize) { |
1632 |
if (position < BitCacheSize) { |
1708 |
// use bits |
1633 |
// use bits |
1709 |
mask = 1L << position; |
1634 |
mask = 1L << position; |
Lines 2238-2249
Link Here
|
2238 |
} |
2163 |
} |
2239 |
|
2164 |
|
2240 |
public void markedAsNullOrNonNullInAssertExpression(VariableBinding binding) { |
2165 |
public void markedAsNullOrNonNullInAssertExpression(VariableBinding binding) { |
2241 |
int position; |
2166 |
int position = binding.getAnalysisId(this.maxFieldCount); |
2242 |
if (binding instanceof FieldBinding) { |
|
|
2243 |
position = binding.id; |
2244 |
} else { |
2245 |
position = binding.id + this.maxFieldCount; |
2246 |
} |
2247 |
int oldLength; |
2167 |
int oldLength; |
2248 |
if (this.nullStatusChangedInAssert == null) { |
2168 |
if (this.nullStatusChangedInAssert == null) { |
2249 |
this.nullStatusChangedInAssert = new int[position + 1]; |
2169 |
this.nullStatusChangedInAssert = new int[position + 1]; |
Lines 2257-2268
Link Here
|
2257 |
} |
2177 |
} |
2258 |
|
2178 |
|
2259 |
public boolean isMarkedAsNullOrNonNullInAssertExpression(VariableBinding binding) { |
2179 |
public boolean isMarkedAsNullOrNonNullInAssertExpression(VariableBinding binding) { |
2260 |
int position; |
2180 |
int position = binding.getAnalysisId(this.maxFieldCount); |
2261 |
if (binding instanceof FieldBinding) { |
|
|
2262 |
position = binding.id; |
2263 |
} else { |
2264 |
position = binding.id + this.maxFieldCount; |
2265 |
} |
2266 |
if(this.nullStatusChangedInAssert == null || position >= this.nullStatusChangedInAssert.length) { |
2181 |
if(this.nullStatusChangedInAssert == null || position >= this.nullStatusChangedInAssert.length) { |
2267 |
return false; |
2182 |
return false; |
2268 |
} |
2183 |
} |