ArtifactSet generatedArtifacts = new ArtifactSet();
DistillerRebindPermutationOracle rpo = new DistillerRebindPermutationOracle(
module, compilationState, generatedArtifacts, allPermutations,
genDir, generatorResourcesDir);
PerfLogger.start("Precompile");
UnifiedAst unifiedAst = getCompiler(module).precompile(logger,
module, rpo, declEntryPts, null, jjsOptions,
rpo.getPermuationCount() == 1);
PerfLogger.end();
// Merge all identical permutations together.
Permutation[] permutations = rpo.getPermutations();
// Sort the permutations by an ordered key to ensure determinism.
SortedMap<String, Permutation> merged = new TreeMap<String, Permutation>();
SortedSet<String> liveRebindRequests = unifiedAst.getRebindRequests();
for (Permutation permutation : permutations) {
// Construct a key from the stringified map of live rebind answers.
SortedMap<String, String> rebindAnswers = new TreeMap<String, String>(
permutation.getRebindAnswers());
rebindAnswers.keySet().retainAll(liveRebindRequests);