Refine search
public static BlockNode getPathCross(MethodNode mth, BlockNode b1, BlockNode b2) { if (b1 == null || b2 == null) { return null; } BitSet b = new BitSet(); b.or(b1.getDomFrontier()); b.and(b2.getDomFrontier()); b.clear(b1.getId()); b.clear(b2.getId()); if (b.cardinality() == 1) { BlockNode end = mth.getBasicBlocks().get(b.nextSetBit(0)); if (isPathExists(b1, end) && isPathExists(b2, end)) { return end; } } if (isPathExists(b1, b2)) { return b2; } if (isPathExists(b2, b1)) { return b1; } return null; }
public PieceStorageImpl(TorrentByteStorage fileCollectionStorage, BitSet availablePieces, int piecesCount, int pieceSize) { this.fileCollectionStorage = fileCollectionStorage; this.readWriteLock = new ReentrantReadWriteLock(); this.piecesCount = piecesCount; this.pieceSize = pieceSize; BitSet bitSet = new BitSet(piecesCount); bitSet.or(availablePieces); if (bitSet.cardinality() != piecesCount) { this.availablePieces = bitSet; } isOpen = false; }
BitSet excludeColor = new BitSet(); BitSet suggestColor = new BitSet(); BitSet globalExcludes = new BitSet(); BitSet usedInOneType = new BitSet(); for (Map.Entry<Character, List<Reg>> e : groups.entrySet()) { excludeParameters(excludeColor, args, type); excludeColor.or(globalExcludes); // exclude index used by other types globalExcludes.or(usedInOneType); usedInOneType.clear();
/** * Performs a deep copy on <i>other</i>. */ public AccessControlEntry(AccessControlEntry other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); this.denyWrite = other.denyWrite; this.denyTruncate = other.denyTruncate; this.denyDelete = other.denyDelete; this.denyAcquire = other.denyAcquire; this.denyRelease = other.denyRelease; }
BlockNode block = basicBlocks.get(i); block.setId(i); block.setDoms(new BitSet(nBlocks)); block.getDoms().set(0, nBlocks); entryBlock.getDoms().clear(); entryBlock.getDoms().set(entryBlock.getId()); BitSet dset = new BitSet(nBlocks); boolean changed; do { dset.clear(); dset.or(d); basicBlocks.forEach(block -> block.getDoms().clear(block.getId())); idom = preds.get(0); } else { BitSet bs = new BitSet(block.getDoms().length()); bs.or(block.getDoms()); for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1)) { BlockNode dom = basicBlocks.get(i);
final BitSet parent2Key = second.getRepresentation(); final BitSet child1Key = new BitSet(length); final BitSet child2Key = new BitSet(length); a.clear(crossoverIndex, length); BitSet b = (BitSet) parent2Key.clone(); b.clear(0, crossoverIndex); c.clear(crossoverIndex, length); BitSet d = (BitSet) parent2Key.clone(); d.clear(0, crossoverIndex); child1Key.or(a); child1Key.or(d); child2Key.or(c); child2Key.or(b); return new ChromosomePair(first.newBitsChromosome(child1Key), second.newBitsChromosome(child2Key));
BitSet outs = new BitSet(basicBlocks.size()); outs.or(block.getDomFrontier()); for (BlockNode s : block.getCleanSuccessors()) { BitSet df = s.getDomFrontier(); if (second.getDomFrontier().get(first.getId())) { fallThroughCases.put(s, second); df = new BitSet(df.size()); df.set(first.getId()); } else if (first.getDomFrontier().get(second.getId())) { fallThroughCases.put(s, first); df = new BitSet(df.size()); df.set(second.getId()); outs.or(df); outs.clear(block.getId()); if (loop != null) { outs.clear(loop.getStart().getId()); outs.andNot(b.getDomFrontier()); if (b.contains(AFlag.LOOP_START)) { outs.clear(b.getId()); } else { for (BlockNode s : b.getCleanSuccessors()) {
@Override public BitSet getAvailablePieces() { try { readWriteLock.readLock().lock(); BitSet result = new BitSet(piecesCount); BitSet availablePieces = this.availablePieces; boolean isFullyDownloaded = availablePieces == null; if (isFullyDownloaded) { result.set(0, piecesCount); return result; } result.or(availablePieces); return result; } finally { readWriteLock.readLock().unlock(); } }
private void removeStrictlyPostDominatedLocations(Set<Location> locations, PostDominatorsAnalysis postDomAnalysis) { BitSet strictlyDominated = new BitSet(); for (Location loc : locations) { BitSet allDominatedBy = postDomAnalysis.getAllDominatedBy(loc.getBasicBlock()); allDominatedBy.clear(loc.getBasicBlock().getLabel()); strictlyDominated.or(allDominatedBy); } LinkedList<Location> locations2 = new LinkedList<>(locations); for (Iterator<Location> i = locations.iterator(); i.hasNext();) { Location loc = i.next(); if (strictlyDominated.get(loc.getBasicBlock().getLabel())) { i.remove(); continue; } for (Location loc2 : locations2) { if (loc.getBasicBlock().equals(loc2.getBasicBlock()) && loc.getHandle().getPosition() > loc2.getHandle().getPosition()) { i.remove(); break; } } } }
private static BitSet validCookieNameOctets(BitSet validCookieValueOctets) { BitSet bits = new BitSet(8); bits.or(validCookieValueOctets); bits.set('(', false); bits.set(')', false); bits.set('<', false); bits.set('>', false); bits.set('@', false); bits.set(':', false); bits.set('/', false); bits.set('[', false); bits.set(']', false); bits.set('?', false); bits.set('=', false); bits.set('{', false); bits.set('}', false); bits.set(' ', false); bits.set('\t', false); return bits; }
private void removeStrictlyDominatedLocations(Set<Location> locations, DominatorsAnalysis domAnalysis) { BitSet strictlyDominated = new BitSet(); for (Location loc : locations) { BitSet allDominatedBy = domAnalysis.getAllDominatedBy(loc.getBasicBlock()); allDominatedBy.clear(loc.getBasicBlock().getLabel()); strictlyDominated.or(allDominatedBy); } LinkedList<Location> locations2 = new LinkedList<>(locations); for (Iterator<Location> i = locations.iterator(); i.hasNext();) { Location loc = i.next(); if (strictlyDominated.get(loc.getBasicBlock().getLabel())) { i.remove(); continue; } for (Location loc2 : locations2) { if (loc.getBasicBlock().equals(loc2.getBasicBlock()) && loc.getHandle().getPosition() > loc2.getHandle().getPosition()) { i.remove(); break; } } } }