|
Lines 18-23
Link Here
|
| 18 |
import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding; |
18 |
import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding; |
| 19 |
import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; |
19 |
import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; |
| 20 |
import org.eclipse.jdt.internal.compiler.lookup.TagBits; |
20 |
import org.eclipse.jdt.internal.compiler.lookup.TagBits; |
|
|
21 |
import org.eclipse.jdt.internal.compiler.lookup.VariableBinding; |
| 21 |
|
22 |
|
| 22 |
/** |
23 |
/** |
| 23 |
* Record initialization status during definite assignment analysis |
24 |
* Record initialization status during definite assignment analysis |
|
Lines 82-88
Link Here
|
| 82 |
// arrays which have the same size |
83 |
// arrays which have the same size |
| 83 |
|
84 |
|
| 84 |
public int maxFieldCount; // limit between fields and locals |
85 |
public int maxFieldCount; // limit between fields and locals |
| 85 |
|
|
|
| 86 |
// Constants |
86 |
// Constants |
| 87 |
public static final int BitCacheSize = 64; // 64 bits in a long. |
87 |
public static final int BitCacheSize = 64; // 64 bits in a long. |
| 88 |
public int[] nullStatusChangedInAssert; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=303448 |
88 |
public int[] nullStatusChangedInAssert; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=303448 |
|
Lines 515-527
Link Here
|
| 515 |
return this; |
515 |
return this; |
| 516 |
} |
516 |
} |
| 517 |
|
517 |
|
| 518 |
final public boolean cannotBeDefinitelyNullOrNonNull(LocalVariableBinding local) { |
518 |
final public boolean cannotBeDefinitelyNullOrNonNull(VariableBinding local) { |
| 519 |
if ((this.tagBits & NULL_FLAG_MASK) == 0 || |
519 |
if ((this.tagBits & NULL_FLAG_MASK) == 0 || |
| 520 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
520 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
| 521 |
return false; |
521 |
return false; |
| 522 |
} |
522 |
} |
| 523 |
int position; |
523 |
int position; |
| 524 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
524 |
if (local instanceof FieldBinding) { |
|
|
525 |
position = local.id; |
| 526 |
} else { |
| 527 |
position = local.id + this.maxFieldCount; |
| 528 |
} |
| 529 |
if (position < BitCacheSize) { |
| 525 |
// use bits |
530 |
// use bits |
| 526 |
return ( |
531 |
return ( |
| 527 |
(~this.nullBit1 |
532 |
(~this.nullBit1 |
|
Lines 546-558
Link Here
|
| 546 |
& (1L << (position % BitCacheSize))) != 0; |
551 |
& (1L << (position % BitCacheSize))) != 0; |
| 547 |
} |
552 |
} |
| 548 |
|
553 |
|
| 549 |
final public boolean cannotBeNull(LocalVariableBinding local) { |
554 |
final public boolean cannotBeNull(VariableBinding local) { |
| 550 |
if ((this.tagBits & NULL_FLAG_MASK) == 0 || |
555 |
if ((this.tagBits & NULL_FLAG_MASK) == 0 || |
| 551 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
556 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
| 552 |
return false; |
557 |
return false; |
| 553 |
} |
558 |
} |
| 554 |
int position; |
559 |
int position; |
| 555 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
560 |
if (local instanceof FieldBinding) { |
|
|
561 |
position = local.id; |
| 562 |
} else { |
| 563 |
position = local.id + this.maxFieldCount; |
| 564 |
} |
| 565 |
if (position < BitCacheSize) { |
| 556 |
// use bits |
566 |
// use bits |
| 557 |
return (this.nullBit1 & this.nullBit3 |
567 |
return (this.nullBit1 & this.nullBit3 |
| 558 |
& ((this.nullBit2 & this.nullBit4) | ~this.nullBit2) |
568 |
& ((this.nullBit2 & this.nullBit4) | ~this.nullBit2) |
|
Lines 573-585
Link Here
|
| 573 |
& (1L << (position % BitCacheSize))) != 0; |
583 |
& (1L << (position % BitCacheSize))) != 0; |
| 574 |
} |
584 |
} |
| 575 |
|
585 |
|
| 576 |
final public boolean canOnlyBeNull(LocalVariableBinding local) { |
586 |
final public boolean canOnlyBeNull(VariableBinding local) { |
| 577 |
if ((this.tagBits & NULL_FLAG_MASK) == 0 || |
587 |
if ((this.tagBits & NULL_FLAG_MASK) == 0 || |
| 578 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
588 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
| 579 |
return false; |
589 |
return false; |
| 580 |
} |
590 |
} |
| 581 |
int position; |
591 |
int position; |
| 582 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
592 |
if (local instanceof FieldBinding) { |
|
|
593 |
position = local.id; |
| 594 |
} else { |
| 595 |
position = local.id + this.maxFieldCount; |
| 596 |
} |
| 597 |
if (position < BitCacheSize) { |
| 583 |
// use bits |
598 |
// use bits |
| 584 |
return (this.nullBit1 & this.nullBit2 |
599 |
return (this.nullBit1 & this.nullBit2 |
| 585 |
& (~this.nullBit3 | ~this.nullBit4) |
600 |
& (~this.nullBit3 | ~this.nullBit4) |
|
Lines 745-751
Link Here
|
| 745 |
return isDefinitelyAssigned(local.id + this.maxFieldCount); |
760 |
return isDefinitelyAssigned(local.id + this.maxFieldCount); |
| 746 |
} |
761 |
} |
| 747 |
|
762 |
|
| 748 |
final public boolean isDefinitelyNonNull(LocalVariableBinding local) { |
763 |
final public boolean isDefinitelyNonNull(VariableBinding local) { |
|
|
764 |
if (local instanceof FieldBinding && (this.tagBits & NULL_FLAG_MASK) == 0) { |
| 765 |
// no local yet in scope. Came here because of a field being queried for non null |
| 766 |
// will only happen for final fields, since they are assigned in a constructor or static block |
| 767 |
// and we may currently be in some other method |
| 768 |
this.tagBits |= NULL_FLAG_MASK; |
| 769 |
} |
| 749 |
// do not want to complain in unreachable code |
770 |
// do not want to complain in unreachable code |
| 750 |
if ((this.tagBits & UNREACHABLE) != 0 || |
771 |
if ((this.tagBits & UNREACHABLE) != 0 || |
| 751 |
(this.tagBits & NULL_FLAG_MASK) == 0) { |
772 |
(this.tagBits & NULL_FLAG_MASK) == 0) { |
|
Lines 755-761
Link Here
|
| 755 |
local.constant() != Constant.NotAConstant) { // String instances |
776 |
local.constant() != Constant.NotAConstant) { // String instances |
| 756 |
return true; |
777 |
return true; |
| 757 |
} |
778 |
} |
| 758 |
int position = local.id + this.maxFieldCount; |
779 |
int position; |
|
|
780 |
if (local instanceof FieldBinding) { |
| 781 |
if (local.isFinal() && ((FieldBinding)local).isStatic()) { |
| 782 |
// static final field's null status may not be in the flow info |
| 783 |
return (((FieldBinding) local).getNullStatusForStaticFinalField() == FlowInfo.NON_NULL); |
| 784 |
} |
| 785 |
position = local.id; |
| 786 |
} else { |
| 787 |
position = local.id + this.maxFieldCount; |
| 788 |
} |
| 759 |
if (position < BitCacheSize) { // use bits |
789 |
if (position < BitCacheSize) { // use bits |
| 760 |
return ((this.nullBit1 & this.nullBit3 & (~this.nullBit2 | this.nullBit4)) |
790 |
return ((this.nullBit1 & this.nullBit3 & (~this.nullBit2 | this.nullBit4)) |
| 761 |
& (1L << position)) != 0; |
791 |
& (1L << position)) != 0; |
|
Lines 774-787
Link Here
|
| 774 |
& (1L << (position % BitCacheSize))) != 0; |
804 |
& (1L << (position % BitCacheSize))) != 0; |
| 775 |
} |
805 |
} |
| 776 |
|
806 |
|
| 777 |
final public boolean isDefinitelyNull(LocalVariableBinding local) { |
807 |
final public boolean isDefinitelyNull(VariableBinding local) { |
|
|
808 |
if (local instanceof FieldBinding && (this.tagBits & NULL_FLAG_MASK) == 0) { |
| 809 |
// no local yet in scope. Came here because of a field being queried for non null |
| 810 |
// will only happen for final fields, since they are assigned in a constructor or static block |
| 811 |
// and we may currently be in some other method |
| 812 |
this.tagBits |= NULL_FLAG_MASK; |
| 813 |
} |
| 778 |
// do not want to complain in unreachable code |
814 |
// do not want to complain in unreachable code |
| 779 |
if ((this.tagBits & UNREACHABLE) != 0 || |
815 |
if ((this.tagBits & UNREACHABLE) != 0 || |
| 780 |
(this.tagBits & NULL_FLAG_MASK) == 0 || |
816 |
(this.tagBits & NULL_FLAG_MASK) == 0 || |
| 781 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
817 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
| 782 |
return false; |
818 |
return false; |
| 783 |
} |
819 |
} |
| 784 |
int position = local.id + this.maxFieldCount; |
820 |
int position; |
|
|
821 |
if (local instanceof FieldBinding) { |
| 822 |
if (local.isFinal() && ((FieldBinding)local).isStatic()) { |
| 823 |
// static final field's null status may not be in the flow info |
| 824 |
return (((FieldBinding) local).getNullStatusForStaticFinalField() == FlowInfo.NULL); |
| 825 |
} |
| 826 |
position = local.id; |
| 827 |
} else { |
| 828 |
position = local.id + this.maxFieldCount; |
| 829 |
} |
| 785 |
if (position < BitCacheSize) { // use bits |
830 |
if (position < BitCacheSize) { // use bits |
| 786 |
return ((this.nullBit1 & this.nullBit2 |
831 |
return ((this.nullBit1 & this.nullBit2 |
| 787 |
& (~this.nullBit3 | ~this.nullBit4)) |
832 |
& (~this.nullBit3 | ~this.nullBit4)) |
|
Lines 801-813
Link Here
|
| 801 |
& (1L << (position % BitCacheSize))) != 0; |
846 |
& (1L << (position % BitCacheSize))) != 0; |
| 802 |
} |
847 |
} |
| 803 |
|
848 |
|
| 804 |
final public boolean isDefinitelyUnknown(LocalVariableBinding local) { |
849 |
final public boolean isDefinitelyUnknown(VariableBinding local) { |
| 805 |
// do not want to complain in unreachable code |
850 |
// do not want to complain in unreachable code |
| 806 |
if ((this.tagBits & UNREACHABLE) != 0 || |
851 |
if ((this.tagBits & UNREACHABLE) != 0 || |
| 807 |
(this.tagBits & NULL_FLAG_MASK) == 0) { |
852 |
(this.tagBits & NULL_FLAG_MASK) == 0) { |
| 808 |
return false; |
853 |
return false; |
| 809 |
} |
854 |
} |
| 810 |
int position = local.id + this.maxFieldCount; |
855 |
int position; |
|
|
856 |
if (local instanceof FieldBinding) { |
| 857 |
position = local.id; |
| 858 |
} else { |
| 859 |
position = local.id + this.maxFieldCount; |
| 860 |
} |
| 811 |
if (position < BitCacheSize) { // use bits |
861 |
if (position < BitCacheSize) { // use bits |
| 812 |
return ((this.nullBit1 & this.nullBit4 |
862 |
return ((this.nullBit1 & this.nullBit4 |
| 813 |
& ~this.nullBit2 & ~this.nullBit3) & (1L << position)) != 0; |
863 |
& ~this.nullBit2 & ~this.nullBit3) & (1L << position)) != 0; |
|
Lines 860-872
Link Here
|
| 860 |
return isPotentiallyAssigned(local.id + this.maxFieldCount); |
910 |
return isPotentiallyAssigned(local.id + this.maxFieldCount); |
| 861 |
} |
911 |
} |
| 862 |
|
912 |
|
| 863 |
final public boolean isPotentiallyNonNull(LocalVariableBinding local) { |
913 |
final public boolean isPotentiallyNonNull(VariableBinding local) { |
| 864 |
if ((this.tagBits & NULL_FLAG_MASK) == 0 || |
914 |
if ((this.tagBits & NULL_FLAG_MASK) == 0 || |
| 865 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
915 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
| 866 |
return false; |
916 |
return false; |
| 867 |
} |
917 |
} |
| 868 |
int position; |
918 |
int position; |
| 869 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
919 |
if (local instanceof FieldBinding) { |
|
|
920 |
position = local.id; |
| 921 |
} else { |
| 922 |
position = local.id + this.maxFieldCount; |
| 923 |
} |
| 924 |
if (position < BitCacheSize) { |
| 870 |
// use bits |
925 |
// use bits |
| 871 |
return ((this.nullBit3 & (~this.nullBit1 | ~this.nullBit2)) |
926 |
return ((this.nullBit3 & (~this.nullBit1 | ~this.nullBit2)) |
| 872 |
& (1L << position)) != 0; |
927 |
& (1L << position)) != 0; |
|
Lines 885-897
Link Here
|
| 885 |
& (1L << (position % BitCacheSize))) != 0; |
940 |
& (1L << (position % BitCacheSize))) != 0; |
| 886 |
} |
941 |
} |
| 887 |
|
942 |
|
| 888 |
final public boolean isPotentiallyNull(LocalVariableBinding local) { |
943 |
final public boolean isPotentiallyNull(VariableBinding local) { |
| 889 |
if ((this.tagBits & NULL_FLAG_MASK) == 0 || |
944 |
if ((this.tagBits & NULL_FLAG_MASK) == 0 || |
| 890 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
945 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
| 891 |
return false; |
946 |
return false; |
| 892 |
} |
947 |
} |
| 893 |
int position; |
948 |
int position; |
| 894 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
949 |
if (local instanceof FieldBinding) { |
|
|
950 |
if (local.isFinal() && ((FieldBinding)local).isStatic()) { |
| 951 |
// static final field's null status may not be in the flow info |
| 952 |
return (((FieldBinding) local).getNullStatusForStaticFinalField() == FlowInfo.POTENTIALLY_NULL); |
| 953 |
} |
| 954 |
position = local.id; |
| 955 |
} else { |
| 956 |
position = local.id + this.maxFieldCount; |
| 957 |
} |
| 958 |
if (position < BitCacheSize) { |
| 895 |
// use bits |
959 |
// use bits |
| 896 |
return ((this.nullBit2 & (~this.nullBit1 | ~this.nullBit3)) |
960 |
return ((this.nullBit2 & (~this.nullBit1 | ~this.nullBit3)) |
| 897 |
& (1L << position)) != 0; |
961 |
& (1L << position)) != 0; |
|
Lines 910-922
Link Here
|
| 910 |
& (1L << (position % BitCacheSize))) != 0; |
974 |
& (1L << (position % BitCacheSize))) != 0; |
| 911 |
} |
975 |
} |
| 912 |
|
976 |
|
| 913 |
final public boolean isPotentiallyUnknown(LocalVariableBinding local) { |
977 |
final public boolean isPotentiallyUnknown(VariableBinding local) { |
| 914 |
// do not want to complain in unreachable code |
978 |
// do not want to complain in unreachable code |
| 915 |
if ((this.tagBits & UNREACHABLE) != 0 || |
979 |
if ((this.tagBits & UNREACHABLE) != 0 || |
| 916 |
(this.tagBits & NULL_FLAG_MASK) == 0) { |
980 |
(this.tagBits & NULL_FLAG_MASK) == 0) { |
| 917 |
return false; |
981 |
return false; |
| 918 |
} |
982 |
} |
| 919 |
int position = local.id + this.maxFieldCount; |
983 |
int position; |
|
|
984 |
if (local instanceof FieldBinding) { |
| 985 |
position = local.id; |
| 986 |
} else { |
| 987 |
position = local.id + this.maxFieldCount; |
| 988 |
} |
| 920 |
if (position < BitCacheSize) { // use bits |
989 |
if (position < BitCacheSize) { // use bits |
| 921 |
return (this.nullBit4 |
990 |
return (this.nullBit4 |
| 922 |
& (~this.nullBit1 | ~this.nullBit2 & ~this.nullBit3) |
991 |
& (~this.nullBit1 | ~this.nullBit2 & ~this.nullBit3) |
|
Lines 937-949
Link Here
|
| 937 |
& (1L << (position % BitCacheSize))) != 0; |
1006 |
& (1L << (position % BitCacheSize))) != 0; |
| 938 |
} |
1007 |
} |
| 939 |
|
1008 |
|
| 940 |
final public boolean isProtectedNonNull(LocalVariableBinding local) { |
1009 |
final public boolean isProtectedNonNull(VariableBinding local) { |
| 941 |
if ((this.tagBits & NULL_FLAG_MASK) == 0 || |
1010 |
if ((this.tagBits & NULL_FLAG_MASK) == 0 || |
| 942 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
1011 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
| 943 |
return false; |
1012 |
return false; |
| 944 |
} |
1013 |
} |
| 945 |
int position; |
1014 |
int position; |
| 946 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
1015 |
if (local instanceof FieldBinding) { |
|
|
1016 |
position = local.id; |
| 1017 |
} else { |
| 1018 |
position = local.id + this.maxFieldCount; |
| 1019 |
} |
| 1020 |
if (position < BitCacheSize) { |
| 947 |
// use bits |
1021 |
// use bits |
| 948 |
return (this.nullBit1 & this.nullBit3 & this.nullBit4 & (1L << position)) != 0; |
1022 |
return (this.nullBit1 & this.nullBit3 & this.nullBit4 & (1L << position)) != 0; |
| 949 |
} |
1023 |
} |
|
Lines 962-974
Link Here
|
| 962 |
& (1L << (position % BitCacheSize))) != 0; |
1036 |
& (1L << (position % BitCacheSize))) != 0; |
| 963 |
} |
1037 |
} |
| 964 |
|
1038 |
|
| 965 |
final public boolean isProtectedNull(LocalVariableBinding local) { |
1039 |
final public boolean isProtectedNull(VariableBinding local) { |
| 966 |
if ((this.tagBits & NULL_FLAG_MASK) == 0 || |
1040 |
if ((this.tagBits & NULL_FLAG_MASK) == 0 || |
| 967 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
1041 |
(local.type.tagBits & TagBits.IsBaseType) != 0) { |
| 968 |
return false; |
1042 |
return false; |
| 969 |
} |
1043 |
} |
| 970 |
int position; |
1044 |
int position; |
| 971 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
1045 |
if (local instanceof FieldBinding) { |
|
|
1046 |
position = local.id; |
| 1047 |
} else { |
| 1048 |
position = local.id + this.maxFieldCount; |
| 1049 |
} |
| 1050 |
if (position < BitCacheSize) { |
| 972 |
// use bits |
1051 |
// use bits |
| 973 |
return (this.nullBit1 & this.nullBit2 |
1052 |
return (this.nullBit1 & this.nullBit2 |
| 974 |
& (this.nullBit3 ^ this.nullBit4) |
1053 |
& (this.nullBit3 ^ this.nullBit4) |
|
Lines 1001-1015
Link Here
|
| 1001 |
throw new AssertionFailedException("assertion failed: " + message); //$NON-NLS-1$ |
1080 |
throw new AssertionFailedException("assertion failed: " + message); //$NON-NLS-1$ |
| 1002 |
return expression; |
1081 |
return expression; |
| 1003 |
} |
1082 |
} |
| 1004 |
public void markAsComparedEqualToNonNull(LocalVariableBinding local) { |
1083 |
public void markAsComparedEqualToNonNull(VariableBinding local, boolean isSynchronised) { |
| 1005 |
// protected from non-object locals in calling methods |
1084 |
// protected from non-object locals in calling methods |
| 1006 |
if (this != DEAD_END) { |
1085 |
if (this != DEAD_END) { |
| 1007 |
this.tagBits |= NULL_FLAG_MASK; |
1086 |
this.tagBits |= NULL_FLAG_MASK; |
| 1008 |
int position; |
1087 |
int position; |
|
|
1088 |
if (local instanceof FieldBinding) { |
| 1089 |
if (isSynchronised) { |
| 1090 |
position = local.id; |
| 1091 |
} else { |
| 1092 |
this.markNullStatus(local, FlowInfo.POTENTIALLY_NON_NULL, isSynchronised); |
| 1093 |
return; |
| 1094 |
} |
| 1095 |
} else { |
| 1096 |
position = local.id + this.maxFieldCount; |
| 1097 |
} |
| 1009 |
long mask; |
1098 |
long mask; |
| 1010 |
long a1, a2, a3, a4, na2; |
1099 |
long a1, a2, a3, a4, na2; |
| 1011 |
// position is zero-based |
1100 |
// position is zero-based |
| 1012 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
1101 |
if (position < BitCacheSize) { |
| 1013 |
// use bits |
1102 |
// use bits |
| 1014 |
if (((mask = 1L << position) |
1103 |
if (((mask = 1L << position) |
| 1015 |
& (a1 = this.nullBit1) |
1104 |
& (a1 = this.nullBit1) |
|
Lines 1098-1111
Link Here
|
| 1098 |
} |
1187 |
} |
| 1099 |
} |
1188 |
} |
| 1100 |
|
1189 |
|
| 1101 |
public void markAsComparedEqualToNull(LocalVariableBinding local) { |
1190 |
public void markAsComparedEqualToNull(VariableBinding local, boolean isSynchronised) { |
| 1102 |
// protected from non-object locals in calling methods |
1191 |
// protected from non-object locals in calling methods |
| 1103 |
if (this != DEAD_END) { |
1192 |
if (this != DEAD_END) { |
| 1104 |
this.tagBits |= NULL_FLAG_MASK; |
1193 |
this.tagBits |= NULL_FLAG_MASK; |
| 1105 |
int position; |
1194 |
int position; |
| 1106 |
long mask; |
1195 |
long mask; |
| 1107 |
// position is zero-based |
1196 |
// position is zero-based |
| 1108 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
1197 |
if (local instanceof FieldBinding) { |
|
|
1198 |
if (isSynchronised) { |
| 1199 |
position = local.id; |
| 1200 |
} else { |
| 1201 |
this.markNullStatus(local, FlowInfo.POTENTIALLY_NULL, isSynchronised); |
| 1202 |
return; |
| 1203 |
} |
| 1204 |
} else { |
| 1205 |
position = local.id + this.maxFieldCount; |
| 1206 |
} |
| 1207 |
if (position < BitCacheSize) { |
| 1109 |
// use bits |
1208 |
// use bits |
| 1110 |
if (((mask = 1L << position) & this.nullBit1) != 0) { |
1209 |
if (((mask = 1L << position) & this.nullBit1) != 0) { |
| 1111 |
if ((mask |
1210 |
if ((mask |
|
Lines 1236-1249
Link Here
|
| 1236 |
markAsDefinitelyAssigned(local.id + this.maxFieldCount); |
1335 |
markAsDefinitelyAssigned(local.id + this.maxFieldCount); |
| 1237 |
} |
1336 |
} |
| 1238 |
|
1337 |
|
| 1239 |
public void markAsDefinitelyNonNull(LocalVariableBinding local) { |
1338 |
public void markAsDefinitelyNonNull(VariableBinding local, boolean isSynchronised) { |
| 1240 |
// protected from non-object locals in calling methods |
1339 |
// protected from non-object locals in calling methods |
| 1241 |
if (this != DEAD_END) { |
1340 |
if (this != DEAD_END) { |
| 1242 |
this.tagBits |= NULL_FLAG_MASK; |
1341 |
this.tagBits |= NULL_FLAG_MASK; |
| 1243 |
long mask; |
1342 |
long mask; |
| 1244 |
int position; |
1343 |
int position; |
|
|
1344 |
if (local instanceof FieldBinding) { |
| 1345 |
if (isSynchronised) { |
| 1346 |
position = local.id; |
| 1347 |
} else { |
| 1348 |
this.markNullStatus(local, FlowInfo.POTENTIALLY_NON_NULL, isSynchronised); |
| 1349 |
return; |
| 1350 |
} |
| 1351 |
} else { |
| 1352 |
position = local.id + this.maxFieldCount; |
| 1353 |
} |
| 1245 |
// position is zero-based |
1354 |
// position is zero-based |
| 1246 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { // use bits |
1355 |
if (position < BitCacheSize) { // use bits |
| 1247 |
// set assigned non null |
1356 |
// set assigned non null |
| 1248 |
this.nullBit1 |= (mask = 1L << position); |
1357 |
this.nullBit1 |= (mask = 1L << position); |
| 1249 |
this.nullBit3 |= mask; |
1358 |
this.nullBit3 |= mask; |
|
Lines 1258-1265
Link Here
|
| 1258 |
} |
1367 |
} |
| 1259 |
else { |
1368 |
else { |
| 1260 |
// use extra vector |
1369 |
// use extra vector |
| 1261 |
int vectorIndex ; |
1370 |
int vectorIndex = (position / BitCacheSize) - 1; |
| 1262 |
this.extra[2][vectorIndex = (position / BitCacheSize) - 1] |
1371 |
if (this.extra == null) { |
|
|
1372 |
int length = vectorIndex + 1; |
| 1373 |
this.extra = new long[extraLength][]; |
| 1374 |
for (int j = 0; j < extraLength; j++) { |
| 1375 |
this.extra[j] = new long[length]; |
| 1376 |
} |
| 1377 |
} |
| 1378 |
else { |
| 1379 |
int oldLength; // might need to grow the arrays |
| 1380 |
if (vectorIndex >= (oldLength = this.extra[0].length)) { |
| 1381 |
for (int j = 0; j < extraLength; j++) { |
| 1382 |
System.arraycopy(this.extra[j], 0, |
| 1383 |
(this.extra[j] = new long[vectorIndex + 1]), 0, |
| 1384 |
oldLength); |
| 1385 |
} |
| 1386 |
} |
| 1387 |
} |
| 1388 |
this.extra[2][vectorIndex] |
| 1263 |
|= (mask = 1L << (position % BitCacheSize)); |
1389 |
|= (mask = 1L << (position % BitCacheSize)); |
| 1264 |
this.extra[4][vectorIndex] |= mask; |
1390 |
this.extra[4][vectorIndex] |= mask; |
| 1265 |
this.extra[3][vectorIndex] &= (mask = ~mask); |
1391 |
this.extra[3][vectorIndex] &= (mask = ~mask); |
|
Lines 1273-1286
Link Here
|
| 1273 |
} |
1399 |
} |
| 1274 |
} |
1400 |
} |
| 1275 |
|
1401 |
|
| 1276 |
public void markAsDefinitelyNull(LocalVariableBinding local) { |
1402 |
public void markAsDefinitelyNull(VariableBinding local, boolean isSynchronised) { |
| 1277 |
// protected from non-object locals in calling methods |
1403 |
// protected from non-object locals in calling methods |
| 1278 |
if (this != DEAD_END) { |
1404 |
if (this != DEAD_END) { |
| 1279 |
this.tagBits |= NULL_FLAG_MASK; |
1405 |
this.tagBits |= NULL_FLAG_MASK; |
| 1280 |
long mask; |
1406 |
long mask; |
| 1281 |
int position; |
1407 |
int position; |
|
|
1408 |
if (local instanceof FieldBinding) { |
| 1409 |
if (isSynchronised) { |
| 1410 |
position = local.id; |
| 1411 |
} else { |
| 1412 |
this.markNullStatus(local, FlowInfo.POTENTIALLY_NULL, isSynchronised); |
| 1413 |
return; |
| 1414 |
} |
| 1415 |
} else { |
| 1416 |
position = local.id + this.maxFieldCount; |
| 1417 |
} |
| 1282 |
// position is zero-based |
1418 |
// position is zero-based |
| 1283 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { // use bits |
1419 |
if (position < BitCacheSize) { // use bits |
| 1284 |
// mark assigned null |
1420 |
// mark assigned null |
| 1285 |
this.nullBit1 |= (mask = 1L << position); |
1421 |
this.nullBit1 |= (mask = 1L << position); |
| 1286 |
this.nullBit2 |= mask; |
1422 |
this.nullBit2 |= mask; |
|
Lines 1295-1302
Link Here
|
| 1295 |
} |
1431 |
} |
| 1296 |
else { |
1432 |
else { |
| 1297 |
// use extra vector |
1433 |
// use extra vector |
| 1298 |
int vectorIndex ; |
1434 |
int vectorIndex = (position / BitCacheSize) - 1; |
| 1299 |
this.extra[2][vectorIndex = (position / BitCacheSize) - 1] |
1435 |
if (this.extra == null) { |
|
|
1436 |
int length = vectorIndex + 1; |
| 1437 |
this.extra = new long[extraLength][]; |
| 1438 |
for (int j = 0; j < extraLength; j++) { |
| 1439 |
this.extra[j] = new long[length]; |
| 1440 |
} |
| 1441 |
} |
| 1442 |
else { |
| 1443 |
int oldLength; // might need to grow the arrays |
| 1444 |
if (vectorIndex >= (oldLength = this.extra[0].length)) { |
| 1445 |
for (int j = 0; j < extraLength; j++) { |
| 1446 |
System.arraycopy(this.extra[j], 0, |
| 1447 |
(this.extra[j] = new long[vectorIndex + 1]), 0, |
| 1448 |
oldLength); |
| 1449 |
} |
| 1450 |
} |
| 1451 |
} |
| 1452 |
this.extra[2][vectorIndex] |
| 1300 |
|= (mask = 1L << (position % BitCacheSize)); |
1453 |
|= (mask = 1L << (position % BitCacheSize)); |
| 1301 |
this.extra[3][vectorIndex] |= mask; |
1454 |
this.extra[3][vectorIndex] |= mask; |
| 1302 |
this.extra[4][vectorIndex] &= (mask = ~mask); |
1455 |
this.extra[4][vectorIndex] &= (mask = ~mask); |
|
Lines 1316-1329
Link Here
|
| 1316 |
*/ |
1469 |
*/ |
| 1317 |
// PREMATURE may try to get closer to markAsDefinitelyAssigned, but not |
1470 |
// PREMATURE may try to get closer to markAsDefinitelyAssigned, but not |
| 1318 |
// obvious |
1471 |
// obvious |
| 1319 |
public void markAsDefinitelyUnknown(LocalVariableBinding local) { |
1472 |
public void markAsDefinitelyUnknown(VariableBinding local) { |
| 1320 |
// protected from non-object locals in calling methods |
1473 |
// protected from non-object locals in calling methods |
| 1321 |
if (this != DEAD_END) { |
1474 |
if (this != DEAD_END) { |
| 1322 |
this.tagBits |= NULL_FLAG_MASK; |
1475 |
this.tagBits |= NULL_FLAG_MASK; |
| 1323 |
long mask; |
1476 |
long mask; |
| 1324 |
int position; |
1477 |
int position; |
|
|
1478 |
if (local instanceof FieldBinding) { |
| 1479 |
position = local.id; |
| 1480 |
} else { |
| 1481 |
position = local.id + this.maxFieldCount; |
| 1482 |
} |
| 1325 |
// position is zero-based |
1483 |
// position is zero-based |
| 1326 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
1484 |
if (position < BitCacheSize) { |
| 1327 |
// use bits |
1485 |
// use bits |
| 1328 |
// mark assigned null |
1486 |
// mark assigned null |
| 1329 |
this.nullBit1 |= (mask = 1L << position); |
1487 |
this.nullBit1 |= (mask = 1L << position); |
|
Lines 1339-1346
Link Here
|
| 1339 |
} |
1497 |
} |
| 1340 |
else { |
1498 |
else { |
| 1341 |
// use extra vector |
1499 |
// use extra vector |
| 1342 |
int vectorIndex ; |
1500 |
int vectorIndex = (position / BitCacheSize) - 1; |
| 1343 |
this.extra[2][vectorIndex = (position / BitCacheSize) - 1] |
1501 |
if (this.extra == null) { |
|
|
1502 |
int length = vectorIndex + 1; |
| 1503 |
this.extra = new long[extraLength][]; |
| 1504 |
for (int j = 0; j < extraLength; j++) { |
| 1505 |
this.extra[j] = new long[length]; |
| 1506 |
} |
| 1507 |
} |
| 1508 |
else { |
| 1509 |
int oldLength; // might need to grow the arrays |
| 1510 |
if (vectorIndex >= (oldLength = this.extra[0].length)) { |
| 1511 |
for (int j = 0; j < extraLength; j++) { |
| 1512 |
System.arraycopy(this.extra[j], 0, |
| 1513 |
(this.extra[j] = new long[vectorIndex + 1]), 0, |
| 1514 |
oldLength); |
| 1515 |
} |
| 1516 |
} |
| 1517 |
} |
| 1518 |
this.extra[2][vectorIndex] |
| 1344 |
|= (mask = 1L << (position % BitCacheSize)); |
1519 |
|= (mask = 1L << (position % BitCacheSize)); |
| 1345 |
this.extra[5][vectorIndex] |= mask; |
1520 |
this.extra[5][vectorIndex] |= mask; |
| 1346 |
this.extra[3][vectorIndex] &= (mask = ~mask); |
1521 |
this.extra[3][vectorIndex] &= (mask = ~mask); |
|
Lines 1354-1365
Link Here
|
| 1354 |
} |
1529 |
} |
| 1355 |
} |
1530 |
} |
| 1356 |
|
1531 |
|
| 1357 |
public void resetNullInfo(LocalVariableBinding local) { |
1532 |
public void resetNullInfo(VariableBinding local) { |
| 1358 |
if (this != DEAD_END) { |
1533 |
if (this != DEAD_END) { |
| 1359 |
this.tagBits |= NULL_FLAG_MASK; |
1534 |
this.tagBits |= NULL_FLAG_MASK; |
| 1360 |
int position; |
1535 |
int position; |
| 1361 |
long mask; |
1536 |
long mask; |
| 1362 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
1537 |
if (local instanceof FieldBinding) { |
|
|
1538 |
position = local.id; |
| 1539 |
} else { |
| 1540 |
position = local.id + this.maxFieldCount; |
| 1541 |
} |
| 1542 |
if (position < BitCacheSize) { |
| 1363 |
// use bits |
1543 |
// use bits |
| 1364 |
this.nullBit1 &= (mask = ~(1L << position)); |
1544 |
this.nullBit1 &= (mask = ~(1L << position)); |
| 1365 |
this.nullBit2 &= mask; |
1545 |
this.nullBit2 &= mask; |
|
Lines 1367-1374
Link Here
|
| 1367 |
this.nullBit4 &= mask; |
1547 |
this.nullBit4 &= mask; |
| 1368 |
} else { |
1548 |
} else { |
| 1369 |
// use extra vector |
1549 |
// use extra vector |
| 1370 |
int vectorIndex ; |
1550 |
int vectorIndex = (position / BitCacheSize) - 1; |
| 1371 |
this.extra[2][vectorIndex = (position / BitCacheSize) - 1] |
1551 |
if (this.extra == null) { |
|
|
1552 |
int length = vectorIndex + 1; |
| 1553 |
this.extra = new long[extraLength][]; |
| 1554 |
for (int j = 0; j < extraLength; j++) { |
| 1555 |
this.extra[j] = new long[length]; |
| 1556 |
} |
| 1557 |
} |
| 1558 |
else { |
| 1559 |
int oldLength; // might need to grow the arrays |
| 1560 |
if (vectorIndex >= (oldLength = this.extra[0].length)) { |
| 1561 |
for (int j = 0; j < extraLength; j++) { |
| 1562 |
System.arraycopy(this.extra[j], 0, |
| 1563 |
(this.extra[j] = new long[vectorIndex + 1]), 0, |
| 1564 |
oldLength); |
| 1565 |
} |
| 1566 |
} |
| 1567 |
} |
| 1568 |
this.extra[2][vectorIndex] |
| 1372 |
&= (mask = ~(1L << (position % BitCacheSize))); |
1569 |
&= (mask = ~(1L << (position % BitCacheSize))); |
| 1373 |
this.extra[3][vectorIndex] &= mask; |
1570 |
this.extra[3][vectorIndex] &= mask; |
| 1374 |
this.extra[4][vectorIndex] &= mask; |
1571 |
this.extra[4][vectorIndex] &= mask; |
|
Lines 1377-1393
Link Here
|
| 1377 |
} |
1574 |
} |
| 1378 |
} |
1575 |
} |
| 1379 |
|
1576 |
|
|
|
1577 |
public void resetNullInfoForFields() { |
| 1578 |
if (this != DEAD_END) { |
| 1579 |
for (int position = 0; position < this.maxFieldCount; position++) { |
| 1580 |
long mask; |
| 1581 |
if (position < BitCacheSize) { |
| 1582 |
// use bits |
| 1583 |
this.nullBit1 &= (mask = ~(1L << position)); |
| 1584 |
this.nullBit2 &= mask; |
| 1585 |
this.nullBit3 &= mask; |
| 1586 |
this.nullBit4 &= mask; |
| 1587 |
} else { |
| 1588 |
// use extra vector |
| 1589 |
int vectorIndex = (position / BitCacheSize) - 1; |
| 1590 |
if (this.extra == null) { |
| 1591 |
int length = vectorIndex + 1; |
| 1592 |
this.extra = new long[extraLength][]; |
| 1593 |
for (int j = 0; j < extraLength; j++) { |
| 1594 |
this.extra[j] = new long[length]; |
| 1595 |
} |
| 1596 |
} |
| 1597 |
else { |
| 1598 |
int oldLength; // might need to grow the arrays |
| 1599 |
if (vectorIndex >= (oldLength = this.extra[0].length)) { |
| 1600 |
for (int j = 0; j < extraLength; j++) { |
| 1601 |
System.arraycopy(this.extra[j], 0, |
| 1602 |
(this.extra[j] = new long[vectorIndex + 1]), 0, |
| 1603 |
oldLength); |
| 1604 |
} |
| 1605 |
} |
| 1606 |
} |
| 1607 |
this.extra[2][vectorIndex] |
| 1608 |
&= (mask = ~(1L << (position % BitCacheSize))); |
| 1609 |
this.extra[3][vectorIndex] &= mask; |
| 1610 |
this.extra[4][vectorIndex] &= mask; |
| 1611 |
this.extra[5][vectorIndex] &= mask; |
| 1612 |
} |
| 1613 |
} |
| 1614 |
} |
| 1615 |
} |
| 1616 |
|
| 1380 |
/** |
1617 |
/** |
| 1381 |
* Mark a local as potentially having been assigned to an unknown value. |
1618 |
* Mark a local as potentially having been assigned to an unknown value. |
| 1382 |
* @param local the local to mark |
1619 |
* @param local the local to mark |
| 1383 |
*/ |
1620 |
*/ |
| 1384 |
public void markPotentiallyUnknownBit(LocalVariableBinding local) { |
1621 |
public void markPotentiallyUnknownBit(VariableBinding local) { |
| 1385 |
// protected from non-object locals in calling methods |
1622 |
// protected from non-object locals in calling methods |
| 1386 |
if (this != DEAD_END) { |
1623 |
if (this != DEAD_END) { |
| 1387 |
this.tagBits |= NULL_FLAG_MASK; |
1624 |
this.tagBits |= NULL_FLAG_MASK; |
| 1388 |
int position; |
1625 |
int position; |
| 1389 |
long mask; |
1626 |
long mask; |
| 1390 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
1627 |
if (local instanceof FieldBinding) { |
|
|
1628 |
position = local.id; |
| 1629 |
} else { |
| 1630 |
position = local.id + this.maxFieldCount; |
| 1631 |
} |
| 1632 |
if (position < BitCacheSize) { |
| 1391 |
// use bits |
1633 |
// use bits |
| 1392 |
mask = 1L << position; |
1634 |
mask = 1L << position; |
| 1393 |
isTrue((this.nullBit1 & mask) == 0, "Adding 'unknown' mark in unexpected state"); //$NON-NLS-1$ |
1635 |
isTrue((this.nullBit1 & mask) == 0, "Adding 'unknown' mark in unexpected state"); //$NON-NLS-1$ |
|
Lines 1399-1405
Link Here
|
| 1399 |
} |
1641 |
} |
| 1400 |
} else { |
1642 |
} else { |
| 1401 |
// use extra vector |
1643 |
// use extra vector |
| 1402 |
int vectorIndex = (position / BitCacheSize) - 1; |
1644 |
int vectorIndex = (position / BitCacheSize) - 1; |
|
|
1645 |
if (this.extra == null) { |
| 1646 |
int length = vectorIndex + 1; |
| 1647 |
this.extra = new long[extraLength][]; |
| 1648 |
for (int j = 0; j < extraLength; j++) { |
| 1649 |
this.extra[j] = new long[length]; |
| 1650 |
} |
| 1651 |
} |
| 1652 |
else { |
| 1653 |
int oldLength; // might need to grow the arrays |
| 1654 |
if (vectorIndex >= (oldLength = this.extra[0].length)) { |
| 1655 |
for (int j = 0; j < extraLength; j++) { |
| 1656 |
System.arraycopy(this.extra[j], 0, |
| 1657 |
(this.extra[j] = new long[vectorIndex + 1]), 0, |
| 1658 |
oldLength); |
| 1659 |
} |
| 1660 |
} |
| 1661 |
} |
| 1403 |
mask = 1L << (position % BitCacheSize); |
1662 |
mask = 1L << (position % BitCacheSize); |
| 1404 |
isTrue((this.extra[2][vectorIndex] & mask) == 0, "Adding 'unknown' mark in unexpected state"); //$NON-NLS-1$ |
1663 |
isTrue((this.extra[2][vectorIndex] & mask) == 0, "Adding 'unknown' mark in unexpected state"); //$NON-NLS-1$ |
| 1405 |
this.extra[5][vectorIndex] |= mask; |
1664 |
this.extra[5][vectorIndex] |= mask; |
|
Lines 1412-1423
Link Here
|
| 1412 |
} |
1671 |
} |
| 1413 |
} |
1672 |
} |
| 1414 |
|
1673 |
|
| 1415 |
public void markPotentiallyNullBit(LocalVariableBinding local) { |
1674 |
public void markPotentiallyNullBit(VariableBinding local) { |
| 1416 |
if (this != DEAD_END) { |
1675 |
if (this != DEAD_END) { |
| 1417 |
this.tagBits |= NULL_FLAG_MASK; |
1676 |
this.tagBits |= NULL_FLAG_MASK; |
| 1418 |
int position; |
1677 |
int position; |
| 1419 |
long mask; |
1678 |
long mask; |
| 1420 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
1679 |
if (local instanceof FieldBinding) { |
|
|
1680 |
position = local.id; |
| 1681 |
} else { |
| 1682 |
position = local.id + this.maxFieldCount; |
| 1683 |
} |
| 1684 |
if (position < BitCacheSize) { |
| 1421 |
// use bits |
1685 |
// use bits |
| 1422 |
mask = 1L << position; |
1686 |
mask = 1L << position; |
| 1423 |
isTrue((this.nullBit1 & mask) == 0, "Adding 'potentially null' mark in unexpected state"); //$NON-NLS-1$ |
1687 |
isTrue((this.nullBit1 & mask) == 0, "Adding 'potentially null' mark in unexpected state"); //$NON-NLS-1$ |
|
Lines 1429-1435
Link Here
|
| 1429 |
} |
1693 |
} |
| 1430 |
} else { |
1694 |
} else { |
| 1431 |
// use extra vector |
1695 |
// use extra vector |
| 1432 |
int vectorIndex = (position / BitCacheSize) - 1; |
1696 |
int vectorIndex = (position / BitCacheSize) - 1; |
|
|
1697 |
if (this.extra == null) { |
| 1698 |
int length = vectorIndex + 1; |
| 1699 |
this.extra = new long[extraLength][]; |
| 1700 |
for (int j = 0; j < extraLength; j++) { |
| 1701 |
this.extra[j] = new long[length]; |
| 1702 |
} |
| 1703 |
} |
| 1704 |
else { |
| 1705 |
int oldLength; // might need to grow the arrays |
| 1706 |
if (vectorIndex >= (oldLength = this.extra[0].length)) { |
| 1707 |
for (int j = 0; j < extraLength; j++) { |
| 1708 |
System.arraycopy(this.extra[j], 0, |
| 1709 |
(this.extra[j] = new long[vectorIndex + 1]), 0, |
| 1710 |
oldLength); |
| 1711 |
} |
| 1712 |
} |
| 1713 |
} |
| 1433 |
mask = 1L << (position % BitCacheSize); |
1714 |
mask = 1L << (position % BitCacheSize); |
| 1434 |
this.extra[3][vectorIndex] |= mask; |
1715 |
this.extra[3][vectorIndex] |= mask; |
| 1435 |
isTrue((this.extra[2][vectorIndex] & mask) == 0, "Adding 'potentially null' mark in unexpected state"); //$NON-NLS-1$ |
1716 |
isTrue((this.extra[2][vectorIndex] & mask) == 0, "Adding 'potentially null' mark in unexpected state"); //$NON-NLS-1$ |
|
Lines 1442-1453
Link Here
|
| 1442 |
} |
1723 |
} |
| 1443 |
} |
1724 |
} |
| 1444 |
|
1725 |
|
| 1445 |
public void markPotentiallyNonNullBit(LocalVariableBinding local) { |
1726 |
public void markPotentiallyNonNullBit(VariableBinding local) { |
| 1446 |
if (this != DEAD_END) { |
1727 |
if (this != DEAD_END) { |
| 1447 |
this.tagBits |= NULL_FLAG_MASK; |
1728 |
this.tagBits |= NULL_FLAG_MASK; |
| 1448 |
int position; |
1729 |
int position; |
| 1449 |
long mask; |
1730 |
long mask; |
| 1450 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
1731 |
if (local instanceof FieldBinding) { |
|
|
1732 |
position = local.id; |
| 1733 |
} else { |
| 1734 |
position = local.id + this.maxFieldCount; |
| 1735 |
} |
| 1736 |
if (position < BitCacheSize) { |
| 1451 |
// use bits |
1737 |
// use bits |
| 1452 |
mask = 1L << position; |
1738 |
mask = 1L << position; |
| 1453 |
isTrue((this.nullBit1 & mask) == 0, "Adding 'potentially non-null' mark in unexpected state"); //$NON-NLS-1$ |
1739 |
isTrue((this.nullBit1 & mask) == 0, "Adding 'potentially non-null' mark in unexpected state"); //$NON-NLS-1$ |
|
Lines 1459-1465
Link Here
|
| 1459 |
} |
1745 |
} |
| 1460 |
} else { |
1746 |
} else { |
| 1461 |
// use extra vector |
1747 |
// use extra vector |
| 1462 |
int vectorIndex = (position / BitCacheSize) - 1; |
1748 |
int vectorIndex = (position / BitCacheSize) - 1; |
|
|
1749 |
if (this.extra == null) { |
| 1750 |
int length = vectorIndex + 1; |
| 1751 |
this.extra = new long[extraLength][]; |
| 1752 |
for (int j = 0; j < extraLength; j++) { |
| 1753 |
this.extra[j] = new long[length]; |
| 1754 |
} |
| 1755 |
} |
| 1756 |
else { |
| 1757 |
int oldLength; // might need to grow the arrays |
| 1758 |
if (vectorIndex >= (oldLength = this.extra[0].length)) { |
| 1759 |
for (int j = 0; j < extraLength; j++) { |
| 1760 |
System.arraycopy(this.extra[j], 0, |
| 1761 |
(this.extra[j] = new long[vectorIndex + 1]), 0, |
| 1762 |
oldLength); |
| 1763 |
} |
| 1764 |
} |
| 1765 |
} |
| 1463 |
mask = 1L << (position % BitCacheSize); |
1766 |
mask = 1L << (position % BitCacheSize); |
| 1464 |
isTrue((this.extra[2][vectorIndex] & mask) == 0, "Adding 'potentially non-null' mark in unexpected state"); //$NON-NLS-1$ |
1767 |
isTrue((this.extra[2][vectorIndex] & mask) == 0, "Adding 'potentially non-null' mark in unexpected state"); //$NON-NLS-1$ |
| 1465 |
this.extra[4][vectorIndex] |= mask; |
1768 |
this.extra[4][vectorIndex] |= mask; |
|
Lines 1951-1958
Link Here
|
| 1951 |
return this; |
2254 |
return this; |
| 1952 |
} |
2255 |
} |
| 1953 |
|
2256 |
|
| 1954 |
public void markedAsNullOrNonNullInAssertExpression(LocalVariableBinding local) { |
2257 |
public void markedAsNullOrNonNullInAssertExpression(VariableBinding binding) { |
| 1955 |
int position = local.id + this.maxFieldCount; |
2258 |
int position; |
|
|
2259 |
if (binding instanceof FieldBinding) { |
| 2260 |
position = binding.id; |
| 2261 |
} else { |
| 2262 |
position = binding.id + this.maxFieldCount; |
| 2263 |
} |
| 1956 |
int oldLength; |
2264 |
int oldLength; |
| 1957 |
if (this.nullStatusChangedInAssert == null) { |
2265 |
if (this.nullStatusChangedInAssert == null) { |
| 1958 |
this.nullStatusChangedInAssert = new int[position + 1]; |
2266 |
this.nullStatusChangedInAssert = new int[position + 1]; |
|
Lines 1965-1972
Link Here
|
| 1965 |
this.nullStatusChangedInAssert[position] = 1; |
2273 |
this.nullStatusChangedInAssert[position] = 1; |
| 1966 |
} |
2274 |
} |
| 1967 |
|
2275 |
|
| 1968 |
public boolean isMarkedAsNullOrNonNullInAssertExpression(LocalVariableBinding local) { |
2276 |
public boolean isMarkedAsNullOrNonNullInAssertExpression(VariableBinding binding) { |
| 1969 |
int position = local.id + this.maxFieldCount; |
2277 |
int position; |
|
|
2278 |
if (binding instanceof FieldBinding) { |
| 2279 |
position = binding.id; |
| 2280 |
} else { |
| 2281 |
position = binding.id + this.maxFieldCount; |
| 2282 |
} |
| 1970 |
if(this.nullStatusChangedInAssert == null || position >= this.nullStatusChangedInAssert.length) { |
2283 |
if(this.nullStatusChangedInAssert == null || position >= this.nullStatusChangedInAssert.length) { |
| 1971 |
return false; |
2284 |
return false; |
| 1972 |
} |
2285 |
} |