Class TypeRefFactory

java.lang.Object
gw.internal.gosu.parser.TypeRefFactory
All Implemented Interfaces:
ITypeRefFactory

public class TypeRefFactory extends Object implements ITypeRefFactory
There is one TypeRefFactory per ModuleTypeLoader.
  • Field Details

    • TRACE

      private static boolean TRACE
    • VERIFY

      private static boolean VERIFY
    • ASM_CHECKER

      private static boolean ASM_CHECKER
    • JAVA_VER

      private static final int JAVA_VER
      See Also:
    • ITYPE_PROXY_CLASS_BY_ITYPE_CLASS

      private static final Map<Class<? extends IType>,Class<? extends AbstractTypeRef>> ITYPE_PROXY_CLASS_BY_ITYPE_CLASS
    • _refByName

      private final WeakFqnCache<AbstractTypeRef> _refByName
    • _bClearing

      private boolean _bClearing
  • Constructor Details

    • TypeRefFactory

      public TypeRefFactory()
  • Method Details

    • create

      public ITypeRef create(IType type)
      Wraps the actual class with a proxy.
      Specified by:
      create in interface ITypeRefFactory
    • getRefTheFastWay

      private ITypeRef getRefTheFastWay(IType type, String strTypeName)
    • getRefTheSafeWay

      private ITypeRef getRefTheSafeWay(IType type, String strTypeName)
    • createTypeRefProxy

      private AbstractTypeRef createTypeRefProxy(IType type)
    • getOrCreateTypeProxy

      private Class<? extends AbstractTypeRef> getOrCreateTypeProxy(Class<? extends IType> typeClass)
    • generateProxyClass

      private Class<? extends AbstractTypeRef> generateProxyClass(Class<? extends IType> typeClass)
    • compileHeader

      private void compileHeader(org.objectweb.asm.ClassVisitor cv, String name, List<Class> interfaces)
    • getInterfaceNames

      private String[] getInterfaceNames(List<Class> interfaces)
    • addDefaultConstructor

      private void addDefaultConstructor(org.objectweb.asm.ClassVisitor cv)
    • compileInterfaceMembers

      private void compileInterfaceMembers(org.objectweb.asm.ClassVisitor cv, Class typeClass)
    • genMethod_DevMode

      private void genMethod_DevMode(org.objectweb.asm.ClassVisitor cv, Method ifaceMethod, Method proxyMethod)
    • genBody_NoRefreshSupport

      private void genBody_NoRefreshSupport(Method ifaceMethod, Method proxyMethod, org.objectweb.asm.MethodVisitor mv)
    • genBody_SupportRefresh

      private void genBody_SupportRefresh(Method ifaceMethod, Method proxyMethod, org.objectweb.asm.MethodVisitor mv)
    • visitDebugLineNumber

      private void visitDebugLineNumber(int iLine, org.objectweb.asm.MethodVisitor mv)
    • insertGetNameStart

      private void insertGetNameStart(org.objectweb.asm.MethodVisitor mv)
    • call_reload

      private void call_reload(org.objectweb.asm.MethodVisitor mv)
    • assignType

      private void assignType(Method ifaceMethod, org.objectweb.asm.MethodVisitor mv, int typeIndex)
    • assignType_FromField

      private void assignType_FromField(Method ifaceMethod, org.objectweb.asm.MethodVisitor mv, int typeIndex)
    • constructRuntimeException

      private void constructRuntimeException(org.objectweb.asm.MethodVisitor mv, int exceptionIndex)
    • delegateMethodCall

      private void delegateMethodCall(Method ifaceMethod, Method proxyMethod, org.objectweb.asm.MethodVisitor mv, int typeIndex)
    • isTypeGosuClassInstance

      private boolean isTypeGosuClassInstance(Class<?> declaringClass)
    • getInterfaceMethod

      private Method getInterfaceMethod(Method method)
    • get

      public ITypeRef get(IType type)
      Specified by:
      get in interface ITypeRefFactory
    • get

      public ITypeRef get(String strTypeName)
      Specified by:
      get in interface ITypeRefFactory
    • clearCaches

      public void clearCaches()
      Specified by:
      clearCaches in interface ITypeRefFactory
    • computeSortIndex

      private int computeSortIndex(Map.Entry<String,Reference<AbstractTypeRef>> entry)
    • setClearing

      private void setClearing(boolean bClearing)
    • isClearing

      public boolean isClearing()
      Specified by:
      isClearing in interface ITypeRefFactory
    • getInterfacesFrom

      private void getInterfacesFrom(Class<? extends IType> classOfType, List<Class> interfaces)
    • getJavaClass

      private Class getJavaClass(IType iface)
    • putRef

      private static void putRef(WeakFqnCache<AbstractTypeRef> map, String key, AbstractTypeRef value)
    • getRef

      private AbstractTypeRef getRef(WeakFqnCache<AbstractTypeRef> map, String key, IType type)
    • getIns

      private int getIns(int opcode, Class type)
    • getIns

      private int getIns(int opcode, String typeName)
    • isWide

      private boolean isWide(Class type)
    • isWide

      private boolean isWide(String typeName)
    • getSlashName

      private String getSlashName(Class type)
    • getSlashName

      private String getSlashName(String typeName)
    • getParameterTypeDescriptors

      private String[] getParameterTypeDescriptors(Method _method)
    • getReturnTypeDescriptor

      private String getReturnTypeDescriptor(Method _method)
    • getDescriptor

      private String getDescriptor(Class<?> returnType)
    • getMethodDescriptor

      private String getMethodDescriptor(Method m)
    • getMethodDescriptor

      private String getMethodDescriptor(String[] paramTypeDescriptors, String returnTypeDescriptor)
    • getMethodExceptions

      private String[] getMethodExceptions(Method method)
    • callMethod

      private void callMethod(org.objectweb.asm.MethodVisitor mv, Method method)
    • verify

      private static void verify(byte[] bytes)
    • getSubordinateRefs

      public List<ITypeRef> getSubordinateRefs(String topLevelTypeName)
      Specified by:
      getSubordinateRefs in interface ITypeRefFactory
    • getTypesWithPrefix

      public List<String> getTypesWithPrefix(String namespace, String prefix)
      Specified by:
      getTypesWithPrefix in interface ITypeRefFactory