Package joust.optimisers.runnables

Source Code of joust.optimisers.runnables.FinalFolder

package joust.optimisers.runnables;


import joust.optimisers.finalfold.FinalValueFinder;
import joust.optimisers.unroll.ContextInliningTranslator;
import joust.tree.annotatedtree.AJCForest;
import joust.tree.annotatedtree.AJCTree;
import joust.utils.logging.LogUtils;
import lombok.experimental.ExtensionMethod;
import lombok.extern.java.Log;

import java.util.logging.Logger;

@Log
@ExtensionMethod({Logger.class, LogUtils.LogExtensions.class})
public class FinalFolder extends OptimisationRunnable {
    @Override
    public void run() {
        FinalValueFinder finder = new FinalValueFinder();

        for (AJCTree tree : AJCForest.getInstance().rootNodes) {
            finder.visitTree(tree);
        }

        ContextInliningTranslator inliner = new ContextInliningTranslator(finder.values);

        for (AJCTree tree : AJCForest.getInstance().rootNodes) {
            inliner.visitTree(tree);
        }

        if (inliner.makingChanges()) {
            AJCForest.getInstance().initialAnalysis();
        }
    }

    @Override
    public String getName() {
        return "FinalFolder";
    }
}
TOP

Related Classes of joust.optimisers.runnables.FinalFolder

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.