private void processNodeToNodeTransitionQueue() { while (!pendingTransitions.isEmpty()) { Transition transition = pendingTransitions.remove(); IntSet pendingTypes = transition.pendingTypes; transition.pendingTypes = null; if (pendingTypes.size() == 1) { DependencyType type = types.get(pendingTypes.iterator().next().value); transition.consume(type); } else { DependencyType[] typesToPropagate = new DependencyType[pendingTypes.size()]; int index = 0; for (IntCursor cursor : pendingTypes) { typesToPropagate[index++] = types.get(cursor.value); } transition.consume(typesToPropagate); } } }
void schedulePropagation(Transition consumer, DependencyType type) { if (!consumer.destination.filter(type)) { return; } if (consumer.pendingTypes == null && propagationDepth < PROPAGATION_STACK_THRESHOLD && consumer.pointsToDomainOrigin() && consumer.destination.propagateCount < 20) { ++propagationDepth; consumer.consume(type); --propagationDepth; } else { if (consumer.pendingTypes == null) { pendingTransitions.add(consumer); consumer.pendingTypes = new IntHashSet(50); } consumer.pendingTypes.add(type.index); } }
void schedulePropagation(Transition consumer, DependencyType[] types) { if (types.length == 0) { return; } if (types.length == 1) { schedulePropagation(consumer, types[0]); return; } if (consumer.pendingTypes == null && propagationDepth < PROPAGATION_STACK_THRESHOLD && consumer.pointsToDomainOrigin() && consumer.destination.propagateCount < 20) { ++propagationDepth; consumer.consume(types); --propagationDepth; } else { if (consumer.pendingTypes == null) { pendingTransitions.add(consumer); consumer.pendingTypes = new IntHashSet(Math.max(50, types.length)); } consumer.pendingTypes.ensureCapacity(types.length + consumer.pendingTypes.size()); for (DependencyType type : types) { consumer.pendingTypes.add(type.index); } } }