Changeset 13900


Ignore:
Timestamp:
Oct 29, 2019 1:59:02 PM (3 weeks ago)
Author:
jwedin
Message:

Changed so that node count dumping is done on the root node instead of statically on ASTNode. Refactored some fields to no longer be static. Changed so that DSSets are given their id in the constructor. #5865

Location:
branches/dev-jw-2590/Compiler
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-jw-2590/Compiler/ModelicaCompiler/src/jastadd/ModelicaCompiler.jrag

    r13781 r13900  
    563563     * The dump will be saved in a file named <code>"node_count.txt"</code>.
    564564     */
    565     protected void dumpNodeCountFile()
     565    protected void dumpNodeCountFile(Root root)
    566566            throws IOException {
    567567        if (dumpMemoryUse) {
    568568            String file = "node_count.txt";
    569569            log.debug("Dumping node counts to '" + file + "'...");
    570             ASTNode.dumpNodeCount(file);
     570            root.dumpNodeCount(file);
    571571        }
    572572    }
     
    12231223        icd.flattenInstClassDecl(fc);
    12241224        dumpMemoryUseFile(fc, "flat", true);
    1225         dumpNodeCountFile();
     1225        dumpNodeCountFile(icd.root());
    12261226        icd = null;
    12271227        ASTNode.endStep("flatten()");
     
    25922592   
    25932593    private static ArrayList<ModuleContributor> CONTRIBUTORS = new ArrayList<>();
    2594     private static HashMap<Module, String> libraryNames = new HashMap<>();
     2594    private HashMap<Module, String> libraryNames = new HashMap<>();
    25952595   
    25962596    public abstract static class ModuleContributor {
  • branches/dev-jw-2590/Compiler/ModelicaMiddleEnd/src/jastadd/Profiling.jrag

    r12940 r13900  
    401401    }
    402402
    403     private static Map<Class,Counter> ASTNode.buildNodeCountMap = null;
     403    private Map<Class,Counter> ASTNode.buildNodeCountMap = null;
    404404
    405405    private static NodeCountExtra[] ASTNode.nodeCountExtra = new NodeCountExtra[] { };
     
    413413     * Output a list of the number of instances of each node class.
    414414     */
    415     public static void ASTNode.dumpNodeCount(String file)
     415    public void ASTNode.dumpNodeCount(String file)
    416416            throws IOException {
    417417        ArrayList<Counter> list = new ArrayList<Counter>();
  • branches/dev-jw-2590/Compiler/ModelicaMiddleEnd/src/jastadd/structural/DynamicStates.jrag

    r13357 r13900  
    263263    public class IndexReductionBiPGraph {
    264264        public static class DSSet {
    265             private static Enumerator e = new Enumerator();
    266265            public final Set<IndexReductionEq> eqns = new LinkedHashSet<IndexReductionEq>();
    267266            public final Set<IndexReductionVar> vars = new LinkedHashSet<IndexReductionVar>();
    268             public final int id = e.next();
     267            public final int id;
    269268            public FExp[][] coefficients;
     269
     270            public DSSet(int id) {
     271                this.id = id;
     272            }
    270273           
    271274            public String toString() {
     
    309312                worklist.add(eqn);
    310313        }
     314
     315        Enumerator enumerator = new Enumerator();
    311316        while (!worklist.isEmpty()) {
    312317            IndexReductionEq eqn = worklist.poll();
     
    324329            DSSet set = dsLookup.get(eqn);
    325330            if (set == null)
    326                 set = new DSSet();
     331                set = new DSSet(enumerator.next());
    327332            Collection<IndexReductionEq> otherEqns = new ArrayList<IndexReductionEq>();
    328333            ASTNode.log.debug("    Path not found, set %d", set.id);
  • branches/dev-jw-2590/Compiler/ModelicaMiddleEnd/src/jastadd/structural/Graphs.jadd

    r13444 r13900  
    21742174   
    21752175    public abstract class AbstractBiPGraph {
    2176         private final static Enumerator visitEnumerator = new Enumerator(1);
     2176        private final Enumerator visitEnumerator = new Enumerator(1);
    21772177        public abstract class AugmentingPathAlgorithm<R> {
    21782178            private final R TRUE_VALUE;
Note: See TracChangeset for help on using the changeset viewer.