Lines 11-16
Link Here
|
11 |
*******************************************************************************/ |
11 |
*******************************************************************************/ |
12 |
package org.eclipse.jdt.internal.compiler.flow; |
12 |
package org.eclipse.jdt.internal.compiler.flow; |
13 |
|
13 |
|
|
|
14 |
import org.eclipse.core.runtime.Assert; |
14 |
import org.eclipse.jdt.internal.compiler.ast.ASTNode; |
15 |
import org.eclipse.jdt.internal.compiler.ast.ASTNode; |
15 |
import org.eclipse.jdt.internal.compiler.impl.Constant; |
16 |
import org.eclipse.jdt.internal.compiler.impl.Constant; |
16 |
import org.eclipse.jdt.internal.compiler.lookup.FieldBinding; |
17 |
import org.eclipse.jdt.internal.compiler.lookup.FieldBinding; |
Lines 1330-1335
Link Here
|
1330 |
} |
1331 |
} |
1331 |
} |
1332 |
} |
1332 |
|
1333 |
|
|
|
1334 |
public void resetNullInfo(LocalVariableBinding local) { |
1335 |
if (this != DEAD_END) { |
1336 |
this.tagBits |= NULL_FLAG_MASK; |
1337 |
int position; |
1338 |
long mask; |
1339 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
1340 |
// use bits |
1341 |
this.nullBit1 &= (mask = ~(1L << position)); |
1342 |
this.nullBit2 &= mask; |
1343 |
this.nullBit3 &= mask; |
1344 |
this.nullBit4 &= mask; |
1345 |
} else { |
1346 |
// use extra vector |
1347 |
int vectorIndex ; |
1348 |
this.extra[2][vectorIndex = (position / BitCacheSize) - 1] |
1349 |
&= (mask = ~(1L << (position % BitCacheSize))); |
1350 |
this.extra[3][vectorIndex] &= mask; |
1351 |
this.extra[4][vectorIndex] &= mask; |
1352 |
this.extra[5][vectorIndex] &= mask; |
1353 |
} |
1354 |
} |
1355 |
} |
1356 |
|
1357 |
/** |
1358 |
* Mark a local as potentially having been assigned to an unknown value. |
1359 |
* @param local the local to mark |
1360 |
*/ |
1361 |
public void markAsPotentiallyUnknown(LocalVariableBinding local) { |
1362 |
// protected from non-object locals in calling methods |
1363 |
if (this != DEAD_END) { |
1364 |
this.tagBits |= NULL_FLAG_MASK; |
1365 |
int position; |
1366 |
long mask; |
1367 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
1368 |
// use bits |
1369 |
mask = 1L << position; |
1370 |
Assert.isTrue((this.nullBit1 & mask) == 0, "Adding 'unknown' mark in unexpected state"); //$NON-NLS-1$ |
1371 |
this.nullBit4 |= mask; |
1372 |
if (COVERAGE_TEST_FLAG) { |
1373 |
if(CoverageTestId == 46) { |
1374 |
this.nullBit4 = ~0; |
1375 |
} |
1376 |
} |
1377 |
} else { |
1378 |
// use extra vector |
1379 |
int vectorIndex = (position / BitCacheSize) - 1; |
1380 |
mask = 1L << (position % BitCacheSize); |
1381 |
Assert.isTrue((this.extra[2][vectorIndex] & mask) == 0, "Adding 'unknown' mark in unexpected state"); //$NON-NLS-1$ |
1382 |
this.extra[5][vectorIndex] |= mask; |
1383 |
if (COVERAGE_TEST_FLAG) { |
1384 |
if(CoverageTestId == 47) { |
1385 |
this.extra[5][vectorIndex] = ~0; |
1386 |
} |
1387 |
} |
1388 |
} |
1389 |
} |
1390 |
} |
1391 |
|
1333 |
public void markAsPotentiallyNull(LocalVariableBinding local) { |
1392 |
public void markAsPotentiallyNull(LocalVariableBinding local) { |
1334 |
if (this != DEAD_END) { |
1393 |
if (this != DEAD_END) { |
1335 |
this.tagBits |= NULL_FLAG_MASK; |
1394 |
this.tagBits |= NULL_FLAG_MASK; |
Lines 1337-1346
Link Here
|
1337 |
long mask; |
1396 |
long mask; |
1338 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
1397 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
1339 |
// use bits |
1398 |
// use bits |
1340 |
this.nullBit1 &= ~(mask = 1L << position); |
1399 |
mask = 1L << position; |
|
|
1400 |
Assert.isTrue((this.nullBit1 & mask) == 0, "Adding 'potentially null' mark in unexpected state"); //$NON-NLS-1$ |
1341 |
this.nullBit2 |= mask; |
1401 |
this.nullBit2 |= mask; |
1342 |
this.nullBit3 &= ~mask; |
|
|
1343 |
this.nullBit4 &= ~mask; |
1344 |
if (COVERAGE_TEST_FLAG) { |
1402 |
if (COVERAGE_TEST_FLAG) { |
1345 |
if(CoverageTestId == 40) { |
1403 |
if(CoverageTestId == 40) { |
1346 |
this.nullBit4 = ~0; |
1404 |
this.nullBit4 = ~0; |
Lines 1348-1359
Link Here
|
1348 |
} |
1406 |
} |
1349 |
} else { |
1407 |
} else { |
1350 |
// use extra vector |
1408 |
// use extra vector |
1351 |
int vectorIndex ; |
1409 |
int vectorIndex = (position / BitCacheSize) - 1; |
1352 |
this.extra[2][vectorIndex = (position / BitCacheSize) - 1] |
1410 |
mask = 1L << (position % BitCacheSize); |
1353 |
&= ~(mask = 1L << (position % BitCacheSize)); |
|
|
1354 |
this.extra[3][vectorIndex] |= mask; |
1411 |
this.extra[3][vectorIndex] |= mask; |
1355 |
this.extra[4][vectorIndex] &= (mask = ~mask); |
1412 |
Assert.isTrue((this.extra[2][vectorIndex] & mask) == 0, "Adding 'potentially null' mark in unexpected state"); //$NON-NLS-1$ |
1356 |
this.extra[5][vectorIndex] &= mask; |
|
|
1357 |
if (COVERAGE_TEST_FLAG) { |
1413 |
if (COVERAGE_TEST_FLAG) { |
1358 |
if(CoverageTestId == 41) { |
1414 |
if(CoverageTestId == 41) { |
1359 |
this.extra[5][vectorIndex] = ~0; |
1415 |
this.extra[5][vectorIndex] = ~0; |
Lines 1363-1368
Link Here
|
1363 |
} |
1419 |
} |
1364 |
} |
1420 |
} |
1365 |
|
1421 |
|
|
|
1422 |
public void markAsPotentiallyNonNull(LocalVariableBinding local) { |
1423 |
if (this != DEAD_END) { |
1424 |
this.tagBits |= NULL_FLAG_MASK; |
1425 |
int position; |
1426 |
long mask; |
1427 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
1428 |
// use bits |
1429 |
mask = 1L << position; |
1430 |
Assert.isTrue((this.nullBit1 & mask) == 0, "Adding 'potentially non-null' mark in unexpected state"); //$NON-NLS-1$ |
1431 |
this.nullBit3 |= mask; |
1432 |
if (COVERAGE_TEST_FLAG) { |
1433 |
if(CoverageTestId == 42) { |
1434 |
this.nullBit4 = ~0; |
1435 |
} |
1436 |
} |
1437 |
} else { |
1438 |
// use extra vector |
1439 |
int vectorIndex = (position / BitCacheSize) - 1; |
1440 |
mask = 1L << (position % BitCacheSize); |
1441 |
Assert.isTrue((this.extra[2][vectorIndex] & mask) == 0, "Adding 'potentially non-null' mark in unexpected state"); //$NON-NLS-1$ |
1442 |
this.extra[4][vectorIndex] |= mask; |
1443 |
if (COVERAGE_TEST_FLAG) { |
1444 |
if(CoverageTestId == 43) { |
1445 |
this.extra[5][vectorIndex] = ~0; |
1446 |
} |
1447 |
} |
1448 |
} |
1449 |
} |
1450 |
} |
1451 |
|
1366 |
public UnconditionalFlowInfo mergedWith(UnconditionalFlowInfo otherInits) { |
1452 |
public UnconditionalFlowInfo mergedWith(UnconditionalFlowInfo otherInits) { |
1367 |
if ((otherInits.tagBits & UNREACHABLE) != 0 && this != DEAD_END) { |
1453 |
if ((otherInits.tagBits & UNREACHABLE) != 0 && this != DEAD_END) { |
1368 |
if (COVERAGE_TEST_FLAG) { |
1454 |
if (COVERAGE_TEST_FLAG) { |