<s> package org . eclipse . jdt . internal . compiler . flow ; import org . eclipse . jdt . internal . compiler . lookup . LocalVariableBinding ; public class NullInfoRegistry extends UnconditionalFlowInfo { public NullInfoRegistry ( UnconditionalFlowInfo upstream ) { this . maxFieldCount = upstream . maxFieldCount ; if ( ( upstream . tagBits & NULL_FLAG_MASK ) != 0 ) { long u1 , u2 , u3 , u4 , nu2 , nu3 , nu4 ; this . nullBit2 = ( u1 = upstream . nullBit1 ) & ( u2 = upstream . nullBit2 ) & ( nu3 = ~ ( u3 = upstream . nullBit3 ) ) & ( nu4 = ~ ( u4 = upstream . nullBit4 ) ) ; this . nullBit3 = u1 & ( nu2 = ~ u2 ) & u3 & nu4 ; this . nullBit4 = u1 & nu2 & nu3 & u4 ; if ( ( this . nullBit2 | this . nullBit3 | this . nullBit4 ) != 0 ) { this . tagBits |= NULL_FLAG_MASK ; } if ( upstream . extra != null ) { this . extra = new long [ extraLength ] [ ] ; int length = upstream . extra [ 2 ] . length ; for ( int i = 2 ; i < extraLength ; i ++ ) { this . extra [ i ] = new long [ length ] ; } for ( int i = 0 ; i < length ; i ++ ) { this . extra [ 2 + 1 ] [ i ] = ( u1 = upstream . extra [ 1 + 1 ] [ i ] ) & ( u2 = upstream . extra [ 2 + 1 ] [ i ] ) & ( nu3 = ~ ( u3 = upstream . extra [ 3 + 1 ] [ i ] ) ) & ( nu4 = ~ ( u4 = upstream . extra [ 4 + 1 ] [ i ] ) ) ; this . extra [ 3 + 1 ] [ i ] = u1 & ( nu2 = ~ u2 ) & u3 & nu4 ; this . extra [ 4 + 1 ] [ i ] = u1 & nu2 & nu3 & u4 ; if ( ( this . extra [ 2 + 1 ] [ i ] | this . extra [ 3 + 1 ] [ i ] | this . extra [ 4 + 1 ] [ i ] ) != 0 ) { this . tagBits |= NULL_FLAG_MASK ; } } } } } public NullInfoRegistry add ( NullInfoRegistry other ) { if ( ( other . tagBits & NULL_FLAG_MASK ) == 0 ) { return this ; } this . tagBits |= NULL_FLAG_MASK ; this . nullBit1 |= other . nullBit1 ; this . nullBit2 |= other . nullBit2 ; this . nullBit3 |= other . nullBit3 ; this . nullBit4 |= other . nullBit4 ; if ( other . extra != null ) { if ( this . extra == null ) { this . extra = new long [ extraLength ] [ ] ; for ( int i = 2 , length = other . extra [ 2 ] . length ; i < extraLength ; i ++ ) { System . arraycopy ( other . extra [ i ] , 0 , ( this . extra [ i ] = new long [ length ] ) , 0 , length ) ; } } else { int length = this . extra [ 2 ] . length , otherLength = other . extra [ 2 ] . length ; if ( otherLength > length ) { for ( int i = 2 ; i < extraLength ; i ++ ) { System . arraycopy ( this . extra [ i ] , 0 , ( this . extra [ i ] = new long [ otherLength ] ) , 0 , length ) ; System . arraycopy ( other . extra [ i ] , length , this . extra [ i ] , length , otherLength - length ) ; } } else if ( otherLength < length ) { length = otherLength ; } for ( int i = 2 ; i < extraLength ; i ++ ) { for ( int j = 0 ; j < length ; j ++ ) { this . extra [ i ] [ j ] |= other . extra [ i ] [ j ] ; } } } } return this ; } public void markAsComparedEqualToNonNull ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { this . nullBit1 |= ( 1L << position ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == 290 ) { this . nullBit1 = 0 ; } } } else { int vectorIndex = ( position / BitCacheSize ) - 1 ; if ( this . extra == null ) { int length = vectorIndex + 1 ; this . extra = new long [ extraLength ] [ ] ; for ( int j = 2 ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ length ] ; } } else { int oldLength ; if ( vectorIndex >= ( oldLength = this . extra [ 2 ] . length ) ) { for ( int j = 2 ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , 0 , ( this . extra [ j ] = new long [ vectorIndex + 1 ] ) , 0 , oldLength ) ; } } } this . extra [ 2 ] [ vectorIndex ] |= ( 1L << ( position % BitCacheSize ) ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == 300 ) { this . extra [ 5 ] [ vectorIndex ] = ~ 0 ; } } } } } public void markAsDefinitelyNonNull ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { this . nullBit3 |= ( 1L << position ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == 290 ) { this . nullBit1 = 0 ; } } } else { int vectorIndex = ( position / BitCacheSize ) - 1 ; if ( this . extra == null ) { int length = vectorIndex + 1 ; this . extra = new long [ extraLength ] [ ] ; for ( int j = 2 ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ length ] ; } } else { int oldLength ; if ( vectorIndex >= ( oldLength = this . extra [ 2 ] . length ) ) { for ( int j = 2 ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , 0 , ( this . extra [ j ] = new long [ vectorIndex + 1 ] ) , 0 , oldLength ) ; } } } this . extra [ 4 ] [ vectorIndex ] |= ( 1L << ( position % BitCacheSize ) ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == 300 ) { this . extra [ 5 ] [ vectorIndex ] = ~ 0 ; } } } } } public void markAsDefinitelyNull ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { this . nullBit2 |= ( 1L << position ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == 290 ) { this . nullBit1 = 0 ; } } } else { int vectorIndex = ( position / BitCacheSize ) - 1 ; if ( this . extra == null ) { int length = vectorIndex + 1 ; this . extra = new long [ extraLength ] [ ] ; for ( int j = 2 ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ length ] ; } } else { int oldLength ; if ( vectorIndex >= ( oldLength = this . extra [ 2 ] . length ) ) { for ( int j = 2 ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , 0 , ( this . extra [ j ] = new long [ vectorIndex + 1 ] ) , 0 , oldLength ) ; } } } this . extra [ 3 ] [ vectorIndex ] |= ( 1L << ( position % BitCacheSize ) ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == 300 ) { this . extra [ 5 ] [ vectorIndex ] = ~ 0 ; } } } } } public void markAsDefinitelyUnknown ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { this . nullBit4 |= ( 1L << position ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == 290 ) { this . nullBit1 = 0 ; } } } else { int vectorIndex = ( position / BitCacheSize ) - 1 ; if ( this . extra == null ) { int length = vectorIndex + 1 ; this . extra = new long [ extraLength ] [ ] ; for ( int j = 2 ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ length ] ; } } else { int oldLength ; if ( vectorIndex >= ( oldLength = this . extra [ 2 ] . length ) ) { for ( int j = 2 ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , 0 , ( this . extra [ j ] = new long [ vectorIndex + 1 ] ) , 0 , oldLength ) ; } } } this . extra [ 5 ] [ vectorIndex ] |= ( 1L << ( position % BitCacheSize ) ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == 300 ) { this . extra [ 5 ] [ vectorIndex ] = ~ 0 ; } } } } } public UnconditionalFlowInfo mitigateNullInfoOf ( FlowInfo flowInfo ) { if ( ( this . tagBits & NULL_FLAG_MASK ) == 0 ) { return flowInfo . unconditionalInits ( ) ; } long m , m1 , nm1 , m2 , nm2 , m3 , a2 , a3 , a4 , s1 , s2 , ns2 , s3 , ns3 , s4 , ns4 ; boolean newCopy = false ; UnconditionalFlowInfo source = flowInfo . unconditionalInits ( ) ; m1 = ( s1 = source . nullBit1 ) & ( s3 = source . nullBit3 ) & ( s4 = source . nullBit4 ) & ( ( a2 = this . nullBit2 ) | ( a4 = this . nullBit4 ) ) ; m2 = s1 & ( s2 = this . nullBit2 ) & ( s3 ^ s4 ) & ( ( a3 = this . nullBit3 ) | a4 ) ; m3 = s1 & ( s2 & ( ns3 = ~ s3 ) & ( ns4 = ~ s4 ) & ( a3 | a4 ) | ( ns2 = ~ s2 ) & s3 & ns4 & ( a2 | a4 ) | ns2 & ns3 & s4 & ( a2 | a3 ) ) ; if ( ( m = ( m1 | m2 | m3 ) ) != 0 ) { newCopy = true ; source = source . unconditionalCopy ( ) ; source . nullBit1 &= ~ m ; source . nullBit2 &= ( nm1 = ~ m1 ) & ( ( nm2 = ~ m2 ) | a4 ) ; source . nullBit3 &= ( nm1 | a2 ) & nm2 ; source . nullBit4 &= nm1 & nm2 ; long x = ~ this . nullBit1 & a2 & a3 & a4 ; if ( x != 0 ) { source . nullBit1 &= ~ x ; source . nullBit2 |= x ; source . nullBit3 |= x ; source . nullBit4 |= x ; } } if ( this . extra != null && source . extra != null ) { int length = this . extra [ 2 ] . length , sourceLength = source . extra [ 0 ] . length ; if ( sourceLength < length ) { length = sourceLength ; } for ( int i = 0 ; i < length ; i ++ ) { m1 = ( s1 = source . extra [ 1 + 1 ] [ i ] ) & ( s3 = source . extra [ 3 + 1 ] [ i ] ) & ( s4 = source . extra [ 4 + 1 ] [ i ] ) & ( ( a2 = this . extra [ 2 + 1 ] [ i ] ) | ( a4 = this . extra [ 4 + 1 ] [ i ] ) ) ; m2 = s1 & ( s2 = this . extra [ 2 + 1 ] [ i ] ) & ( s3 ^ s4 ) & ( ( a3 = this . extra [ 3 + 1 ] [ i ] ) | a4 ) ; m3 = s1 & ( s2 & ( ns3 = ~ s3 ) & ( ns4 = ~ s4 ) & ( a3 | a4 ) | ( ns2 = ~ s2 ) & s3 & ns4 & ( a2 | a4 ) | ns2 & ns3 & s4 & ( a2 | a3 ) ) ; if ( ( m = ( m1 | m2 | m3 ) ) != 0 ) { if ( ! newCopy ) { newCopy = true ; source = source . unconditionalCopy ( ) ; } source . extra [ 1 + 1 ] [ i ] &= ~ m ; source . extra [ 2 + 1 ] [ i ] &= ( nm1 = ~ m1 ) & ( ( nm2 = ~ m2 ) | a4 ) ; source . extra [ 3 + 1 ] [ i ] &= ( nm1 | a2 ) & nm2 ; source . extra [ 4 + 1 ] [ i ] &= nm1 & nm2 ; } } } return source ; } public String toString ( ) { if ( this . extra == null ) { return "" + this . nullBit1 + this . nullBit2 + this . nullBit3 + this . nullBit4 + ">" ; } else { String nullS = "" + this . nullBit1 + this . nullBit2 + this . nullBit3 + this . nullBit4 ; int i , ceil ; for ( i = 0 , ceil = this . extra [ 0 ] . length > 3 ? 3 : this . extra [ 0 ] . length ; i < ceil ; i ++ ) { nullS += "," + this . extra [ 2 ] [ i ] + this . extra [ 3 ] [ i ] + this . extra [ 4 ] [ i ] + this . extra [ 5 ] [ i ] ; } if ( ceil < this . extra [ 0 ] . length ) { nullS += ",..." ; } return nullS + "]>" ; } } public void markPotentiallyUnknownBit ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; long mask ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { mask = 1L << position ; isTrue ( ( this . nullBit1 & mask ) == 0 , "" ) ; this . nullBit4 |= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == 46 ) { this . nullBit4 = ~ 0 ; } } } else { int vectorIndex = ( position / BitCacheSize ) - 1 ; if ( this . extra == null ) { int length = vectorIndex + 1 ; this . extra = new long [ extraLength ] [ ] ; for ( int j = 2 ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ length ] ; } } else { int oldLength ; if ( vectorIndex >= ( oldLength = this . extra [ 2 ] . length ) ) { for ( int j = 2 ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , 0 , ( this . extra [ j ] = new long [ vectorIndex + 1 ] ) , 0 , oldLength ) ; } } } mask = 1L << ( position % BitCacheSize ) ; isTrue ( ( this . extra [ 2 ] [ vectorIndex ] & mask ) == 0 , "" ) ; this . extra [ 5 ] [ vectorIndex ] |= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == 47 ) { this . extra [ 5 ] [ vectorIndex ] = ~ 0 ; } } } } } public void markPotentiallyNullBit ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; long mask ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { mask = 1L << position ; isTrue ( ( this . nullBit1 & mask ) == 0 , "" ) ; this . nullBit2 |= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == 40 ) { this . nullBit4 = ~ 0 ; } } } else { int vectorIndex = ( position / BitCacheSize ) - 1 ; if ( this . extra == null ) { int length = vectorIndex + 1 ; this . extra = new long [ extraLength ] [ ] ; for ( int j = 2 ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ length ] ; } } else { int oldLength ; if ( vectorIndex >= ( oldLength = this . extra [ 2 ] . length ) ) { for ( int j = 2 ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , 0 , ( this . extra [ j ] = new long [ vectorIndex + 1 ] ) , 0 , oldLength ) ; } } } mask = 1L << ( position % BitCacheSize ) ; this . extra [ 3 ] [ vectorIndex ] |= mask ; isTrue ( ( this . extra [ 2 ] [ vectorIndex ] & mask ) == 0 , "" ) ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == 41 ) { this . extra [ 5 ] [ vectorIndex ] = ~ 0 ; } } } } } public void markPotentiallyNonNullBit ( LocalVariableBinding local ) { if ( this != DEAD_END ) { this . tagBits |= NULL_FLAG_MASK ; int position ; long mask ; if ( ( position = local . id + this . maxFieldCount ) < BitCacheSize ) { mask = 1L << position ; isTrue ( ( this . nullBit1 & mask ) == 0 , "" ) ; this . nullBit3 |= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == 42 ) { this . nullBit4 = ~ 0 ; } } } else { int vectorIndex = ( position / BitCacheSize ) - 1 ; if ( this . extra == null ) { int length = vectorIndex + 1 ; this . extra = new long [ extraLength ] [ ] ; for ( int j = 2 ; j < extraLength ; j ++ ) { this . extra [ j ] = new long [ length ] ; } } else { int oldLength ; if ( vectorIndex >= ( oldLength = this . extra [ 2 ] . length ) ) { for ( int j = 2 ; j < extraLength ; j ++ ) { System . arraycopy ( this . extra [ j ] , 0 , ( this . extra [ j ] = new long [ vectorIndex + 1 ] ) , 0 , oldLength ) ; } } } mask = 1L << ( position % BitCacheSize ) ; isTrue ( ( this . extra [ 2 ] [ vectorIndex ] & mask ) == 0 , "" ) ; this . extra [ 4 ] [ vectorIndex ] |= mask ; if ( COVERAGE_TEST_FLAG ) { if ( CoverageTestId == 43 ) { this . extra [ 5 ] [ vectorIndex ] = ~ 0 ; } } } } } } </s>