Class OptimizingVisitor

java.lang.Object
eu.bandm.tools.umod.runtime.OptimizingVisitor
Direct Known Subclasses:
MATCH_ONLY_00

public abstract class OptimizingVisitor extends Object
  • Field Details

    • METHODNAMEPREFIX_DESCEND

      public static final String METHODNAMEPREFIX_DESCEND
      See Also:
    • SUFFIX_FILENAME_SCC_DATA

      public static final String SUFFIX_FILENAME_SCC_DATA
      See Also:
    • haspre

      protected boolean haspre
    • haspost

      protected boolean haspost
    • hasdescend

      protected boolean hasdescend
    • METHODNAME_allFields2codeNumber

      public static final String METHODNAME_allFields2codeNumber
      See Also:
    • fieldFlags

      protected boolean[] fieldFlags
    • affectedClasses

      protected Set<Class<?>> affectedClasses
    • methodname_action

      public static final String methodname_action
      See Also:
  • Constructor Details

    • OptimizingVisitor

      protected OptimizingVisitor()
  • Method Details

    • readSccData

      protected static void readSccData(Class<?> generatedRootClass, String filename, Map<Integer,Map<Class<?>,Integer>> class2scc, Map<Integer,Multimap<String,Integer>> field2sccs, Map<Integer,Multimap<Class<?>,Integer>> class2reachedSccs)
    • getLowestGeneratedClass

      protected Class<?> getLowestGeneratedClass()
      Is overwritten by the umod compiler to the lowest generated class. A "null" value indicates a non-user-defined visitor, e.g. Dumper or XML serializer, which is never subject to optimization.
    • getKey

      protected int getKey()
      Overwritten with generated code to return visitor register key number.
    • allFields2codeNumber

      protected String[] allFields2codeNumber()
    • get_class2scc

      protected abstract Map<Integer,Map<Class<?>,Integer>> get_class2scc()
      Overwritten at one single place, namely in basematcher.
    • get_field2sccs

      protected abstract Map<Integer,Multimap<String,Integer>> get_field2sccs()
      Overwritten at one single place, namely in basematcher.
    • get_class2reachedSccs

      protected abstract Map<Integer,Multimap<Class<?>,Integer>> get_class2reachedSccs()
      Overwritten at one single place, namely in basematcher.
    • compile

      public OptimizingVisitor compile()
      The user-derived visitor must not be declared final and CURRENTLY must have one parameter-les constructor, which is used by the code compile here. This also forbids inner claases reading context parameters.
    • collectFlags

      protected void collectFlags()
      Re-defined in the generated code according to the flavour of visitor. Calls "collectFlags_action()", "collectFlags_actionDorewrite()", etc. depending on what method names have to be collected.
      (( Could be "abstract", but this would require a dummy implementation for "Dumper", "XML-(de-)serializer", etc. ))
    • collectFlags_action

      protected void collectFlags_action()
    • collectFlags_actionRewritefields

      protected void collectFlags_actionRewritefields()
    • collectFlags_actionPreDescendPost

      protected void collectFlags_actionPreDescendPost()
    • collectMethods

      protected static void collectMethods(Class<?> cls, Class<?> upto, Set<Class<?>> classes, String methodname)
      Looks for all methods with name "methodname" in class "cls", and inserts the class of their 0th (and only) argument into classes. Does so recursively with the superclasses up to (not including) "upto".
    • calculateFlags

      protected void calculateFlags(Class<?> ownclass, Set<Class<?>> overwritten)