Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2006, 2010 IBM Corporation and others. |
2 |
* Copyright (c) 2006, 2011 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 402-406
Link Here
|
402 |
return nullS + "]>"; //$NON-NLS-1$ |
402 |
return nullS + "]>"; //$NON-NLS-1$ |
403 |
} |
403 |
} |
404 |
} |
404 |
} |
|
|
405 |
|
406 |
/** |
407 |
* Mark a local as potentially having been assigned to an unknown value. |
408 |
* @param local the local to mark |
409 |
*/ |
410 |
public void markPotentiallyUnknownBit(LocalVariableBinding local) { |
411 |
// protected from non-object locals in calling methods |
412 |
if (this != DEAD_END) { |
413 |
this.tagBits |= NULL_FLAG_MASK; |
414 |
int position; |
415 |
long mask; |
416 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
417 |
// use bits |
418 |
mask = 1L << position; |
419 |
isTrue((this.nullBit1 & mask) == 0, "Adding 'unknown' mark in unexpected state"); //$NON-NLS-1$ |
420 |
this.nullBit4 |= mask; |
421 |
if (COVERAGE_TEST_FLAG) { |
422 |
if(CoverageTestId == 46) { |
423 |
this.nullBit4 = ~0; |
424 |
} |
425 |
} |
426 |
} else { |
427 |
// use extra vector |
428 |
int vectorIndex = (position / BitCacheSize) - 1; |
429 |
if (this.extra == null) { |
430 |
int length = vectorIndex + 1; |
431 |
this.extra = new long[extraLength][]; |
432 |
for (int j = 2; j < extraLength; j++) { |
433 |
this.extra[j] = new long[length]; |
434 |
} |
435 |
} else { |
436 |
int oldLength; // might need to grow the arrays |
437 |
if (vectorIndex >= (oldLength = this.extra[2].length)) { |
438 |
for (int j = 2; j < extraLength; j++) { |
439 |
System.arraycopy(this.extra[j], 0, |
440 |
(this.extra[j] = new long[vectorIndex + 1]), 0, |
441 |
oldLength); |
442 |
} |
443 |
} |
444 |
} |
445 |
mask = 1L << (position % BitCacheSize); |
446 |
isTrue((this.extra[2][vectorIndex] & mask) == 0, "Adding 'unknown' mark in unexpected state"); //$NON-NLS-1$ |
447 |
this.extra[5][vectorIndex] |= mask; |
448 |
if (COVERAGE_TEST_FLAG) { |
449 |
if(CoverageTestId == 47) { |
450 |
this.extra[5][vectorIndex] = ~0; |
451 |
} |
452 |
} |
453 |
} |
454 |
} |
455 |
} |
456 |
|
457 |
public void markPotentiallyNullBit(LocalVariableBinding local) { |
458 |
if (this != DEAD_END) { |
459 |
this.tagBits |= NULL_FLAG_MASK; |
460 |
int position; |
461 |
long mask; |
462 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
463 |
// use bits |
464 |
mask = 1L << position; |
465 |
isTrue((this.nullBit1 & mask) == 0, "Adding 'potentially null' mark in unexpected state"); //$NON-NLS-1$ |
466 |
this.nullBit2 |= mask; |
467 |
if (COVERAGE_TEST_FLAG) { |
468 |
if(CoverageTestId == 40) { |
469 |
this.nullBit4 = ~0; |
470 |
} |
471 |
} |
472 |
} else { |
473 |
// use extra vector |
474 |
int vectorIndex = (position / BitCacheSize) - 1; |
475 |
if (this.extra == null) { |
476 |
int length = vectorIndex + 1; |
477 |
this.extra = new long[extraLength][]; |
478 |
for (int j = 2; j < extraLength; j++) { |
479 |
this.extra[j] = new long[length]; |
480 |
} |
481 |
} else { |
482 |
int oldLength; // might need to grow the arrays |
483 |
if (vectorIndex >= (oldLength = this.extra[2].length)) { |
484 |
for (int j = 2; j < extraLength; j++) { |
485 |
System.arraycopy(this.extra[j], 0, |
486 |
(this.extra[j] = new long[vectorIndex + 1]), 0, |
487 |
oldLength); |
488 |
} |
489 |
} |
490 |
} |
491 |
mask = 1L << (position % BitCacheSize); |
492 |
this.extra[3][vectorIndex] |= mask; |
493 |
isTrue((this.extra[2][vectorIndex] & mask) == 0, "Adding 'potentially null' mark in unexpected state"); //$NON-NLS-1$ |
494 |
if (COVERAGE_TEST_FLAG) { |
495 |
if(CoverageTestId == 41) { |
496 |
this.extra[5][vectorIndex] = ~0; |
497 |
} |
498 |
} |
499 |
} |
500 |
} |
501 |
} |
502 |
|
503 |
public void markPotentiallyNonNullBit(LocalVariableBinding local) { |
504 |
if (this != DEAD_END) { |
505 |
this.tagBits |= NULL_FLAG_MASK; |
506 |
int position; |
507 |
long mask; |
508 |
if ((position = local.id + this.maxFieldCount) < BitCacheSize) { |
509 |
// use bits |
510 |
mask = 1L << position; |
511 |
isTrue((this.nullBit1 & mask) == 0, "Adding 'potentially non-null' mark in unexpected state"); //$NON-NLS-1$ |
512 |
this.nullBit3 |= mask; |
513 |
if (COVERAGE_TEST_FLAG) { |
514 |
if(CoverageTestId == 42) { |
515 |
this.nullBit4 = ~0; |
516 |
} |
517 |
} |
518 |
} else { |
519 |
// use extra vector |
520 |
int vectorIndex = (position / BitCacheSize) - 1; |
521 |
if (this.extra == null) { |
522 |
int length = vectorIndex + 1; |
523 |
this.extra = new long[extraLength][]; |
524 |
for (int j = 2; j < extraLength; j++) { |
525 |
this.extra[j] = new long[length]; |
526 |
} |
527 |
} else { |
528 |
int oldLength; // might need to grow the arrays |
529 |
if (vectorIndex >= (oldLength = this.extra[2].length)) { |
530 |
for (int j = 2; j < extraLength; j++) { |
531 |
System.arraycopy(this.extra[j], 0, |
532 |
(this.extra[j] = new long[vectorIndex + 1]), 0, |
533 |
oldLength); |
534 |
} |
535 |
} |
536 |
} |
537 |
mask = 1L << (position % BitCacheSize); |
538 |
isTrue((this.extra[2][vectorIndex] & mask) == 0, "Adding 'potentially non-null' mark in unexpected state"); //$NON-NLS-1$ |
539 |
this.extra[4][vectorIndex] |= mask; |
540 |
if (COVERAGE_TEST_FLAG) { |
541 |
if(CoverageTestId == 43) { |
542 |
this.extra[5][vectorIndex] = ~0; |
543 |
} |
544 |
} |
545 |
} |
546 |
} |
547 |
} |
405 |
} |
548 |
} |
406 |
|
549 |
|