Class ClassWeaver


  • public class ClassWeaver
    extends java.lang.Object
    This class is the main entry point for the Weave tool. It uses ClassFlow to parse and analyze a class file, and writes out a CPS transformed file if needed
    • Field Detail

      • classInfoList

        java.util.List<ClassInfo> classInfoList
      • stateClasses_

        static java.lang.ThreadLocal<java.util.HashMap<java.lang.String,​ClassInfo>> stateClasses_
      • samWeavers

        java.util.ArrayList<SAMweaver> samWeavers
    • Constructor Detail

      • ClassWeaver

        public ClassWeaver​(KilimContext context,
                           java.io.InputStream is)
                    throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • reset

        public static void reset()
      • accept

        private void accept​(org.objectweb.asm.ClassVisitor cv)
      • toStringArray

        static java.lang.String[] toStringArray​(java.util.List list)
      • addClassInfo

        void addClassInfo​(ClassInfo ci)
      • getClassInfos

        public java.util.List<ClassInfo> getClassInfos()
      • needsWeaving

        boolean needsWeaving​(MethodFlow mf)
      • needsWeaving

        boolean needsWeaving()
      • createStateClass

        java.lang.String createStateClass​(ValInfoList valInfoList)
        Create a custom class (structure) to hold the state. The name of the state reflects the numbers of the various VMtypes in valInfoList. class kilim.SO2IJ3 reflects a class that stores two Objects one Integer and 3 longs.
                    class kilim.SO2IJ3 extends kilim.State {
                       public Object f1, f2;
                       public int f3;
                       public long f4, f5, f6;
                    } 
         
        If there's no data to store, we use the kilim.State class directly to store the basic amount of data necessary to restore the stack.
      • makeClassName

        private java.lang.String makeClassName​(int[] numByType)
      • isInterface

        boolean isInterface()
      • getSAMWeaver

        SAMweaver getSAMWeaver​(java.lang.String owner,
                               java.lang.String methodName,
                               java.lang.String desc,
                               boolean itf)
      • getName

        java.lang.String getName()