@Test
 public void testJoin8() {
   Stamp bExact = StampFactory.exactNonNull(getType(B.class));
   Stamp dExact = StampFactory.exact(getType(D.class));
   Stamp join = join(bExact, dExact);
   Assert.assertFalse(join.isLegal());
 }
 @Test
 public void testJoin6() {
   Stamp dExactNonNull = StampFactory.exactNonNull(getType(D.class));
   Stamp alwaysNull = StampFactory.alwaysNull();
   Stamp join = join(alwaysNull, dExactNonNull);
   Assert.assertFalse(join.isLegal());
   Assert.assertFalse(StampTool.isPointerNonNull(join));
   Assert.assertFalse(StampTool.isPointerAlwaysNull(join));
 }
Exemple #3
0
 public static Stamp meet(Collection<? extends StampProvider> values) {
   Iterator<? extends StampProvider> iterator = values.iterator();
   if (iterator.hasNext()) {
     Stamp stamp = iterator.next().stamp();
     while (iterator.hasNext()) {
       stamp = stamp.meet(iterator.next().stamp());
     }
     return stamp;
   } else {
     return StampFactory.forVoid();
   }
 }
Exemple #4
0
 public static Stamp negate(Stamp stamp) {
   Kind kind = stamp.kind();
   if (stamp instanceof IntegerStamp) {
     IntegerStamp integerStamp = (IntegerStamp) stamp;
     if (integerStamp.lowerBound() != kind.getMinValue()) {
       // TODO(ls) check if the mask calculation is correct...
       return new IntegerStamp(
           kind,
           -integerStamp.upperBound(),
           -integerStamp.lowerBound(),
           IntegerStamp.defaultMask(kind) & (integerStamp.mask() | -integerStamp.mask()));
     }
   }
   return StampFactory.forKind(kind);
 }