private void propagateTypes(DependencyConsumer transition) { if (typeSet != null) { dependencyAnalyzer.schedulePropagation(transition, getTypesInternal()); } }
private void propagateTypes(Transition transition) { if (typeSet != null) { dependencyAnalyzer.schedulePropagation(transition, getTypesInternal()); } }
void schedulePropagation(DependencyConsumer consumer, DependencyType[] types) { if (types.length == 0) { return; } if (types.length == 1) { schedulePropagation(consumer, types[0]); return; } if (propagationDepth < PROPAGATION_STACK_THRESHOLD) { ++propagationDepth; for (DependencyType type : types) { consumer.consume(type); } --propagationDepth; } else { tasks.add(() -> { for (DependencyType type : types) { consumer.consume(type); } }); } }
private void scheduleSingleType(DependencyType type, Runnable action) { if (DependencyAnalyzer.shouldLog) { for (DependencyNode node : typeSet.domain) { if (node.filter(type)) { System.out.println(node.tag + " -> " + type.getName()); } } } Transition[] transitions = typeSet.getTransitions().toArray(Transition.class); List<ConsumerWithNode> consumerEntries = typeSet.getConsumers(); if (action != null) { action.run(); } for (Transition transition : transitions) { if (transition.source.filter(type) && transition.filterType(type)) { dependencyAnalyzer.schedulePropagation(transition, type); } } for (ConsumerWithNode entry : consumerEntries) { if (entry.node.filter(type)) { for (DependencyConsumer consumer : entry.consumers) { dependencyAnalyzer.schedulePropagation(consumer, type); } } } }
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); } } }
dependencyAnalyzer.schedulePropagation(transition, typesToPropagate[0]); continue; dependencyAnalyzer.schedulePropagation(transition, typesToPropagate); dependencyAnalyzer.schedulePropagation(consumer, filteredTypes);
node.propagate(types); } else { dependencyAnalyzer.schedulePropagation(transition, types);