use of soot.util.BitVector in project soot by Sable.
the class TypeResolverBV method merge_primitive_types.
private void merge_primitive_types() throws TypeException {
// merge primitive types with all parents/children
compute_solved();
BitSetIterator varIt = solved.iterator();
while (varIt.hasNext()) {
TypeVariableBV var = typeVariableForId(varIt.next());
if (var.type().type() instanceof IntType || var.type().type() instanceof LongType || var.type().type() instanceof FloatType || var.type().type() instanceof DoubleType) {
BitVector parents;
BitVector children;
boolean finished;
do {
finished = true;
parents = var.parents();
if (parents.length() != 0) {
finished = false;
for (BitSetIterator j = parents.iterator(); j.hasNext(); ) {
if (DEBUG) {
logger.debug(".");
}
TypeVariableBV parent = typeVariableForId(j.next());
var = var.union(parent);
}
}
children = var.children();
if (children.length() != 0) {
finished = false;
for (BitSetIterator j = children.iterator(); j.hasNext(); ) {
if (DEBUG) {
logger.debug(".");
}
TypeVariableBV child = typeVariableForId(j.next());
var = var.union(child);
}
}
} while (!finished);
}
}
}
use of soot.util.BitVector in project soot by Sable.
the class TypeManager method makeMaskOfInterface.
private final BitVector makeMaskOfInterface(SootClass interf) {
if (!(interf.isInterface()))
throw new RuntimeException();
BitVector ret = new BitVector(pag.getAllocNodeNumberer().size());
typeMask.put(interf.getType(), ret);
Collection<SootClass> implementers = fh.getAllImplementersOfInterface(interf);
for (SootClass impl : implementers) {
BitVector other = (BitVector) typeMask.get(impl.getType());
if (other == null)
other = makeClassTypeMask(impl);
ret.or(other);
}
// type-masks exactly the same as the original type-masks
if (implementers.size() == 0) {
for (AllocNode an : anySubtypeAllocs) ret.set(an.getNumber());
}
return ret;
}
use of soot.util.BitVector in project soot by Sable.
the class BitVector_intersects_Test method testNotEquallySizedEmptyBitVectorsDontIntersects.
public void testNotEquallySizedEmptyBitVectorsDontIntersects() {
BitVector a = new BitVector(2048);
BitVector b = new BitVector(1024);
assertFalse(a.intersects(b));
assertFalse(b.intersects(a));
}
use of soot.util.BitVector in project soot by Sable.
the class BitVector_intersects_Test method testNonEmptyBitVectorIntersectsItself.
public void testNonEmptyBitVectorIntersectsItself() {
BitVector a = new BitVector();
a.set(337);
assertTrue(a.intersects(a));
}
use of soot.util.BitVector in project soot by Sable.
the class BitVector_intersects_Test method testEquallySizedEmptyBitVectorsDontIntersects.
public void testEquallySizedEmptyBitVectorsDontIntersects() {
BitVector a = new BitVector(1024);
BitVector b = new BitVector(1024);
assertFalse(a.intersects(b));
assertFalse(b.intersects(a));
}
Aggregations