Package gw.internal.gosu.parser
Class TypeRefFactory
java.lang.Object
gw.internal.gosu.parser.TypeRefFactory
- All Implemented Interfaces:
ITypeRefFactory
There is one TypeRefFactory per ModuleTypeLoader.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final WeakFqnCache<AbstractTypeRef>private static booleanprivate static final Map<Class<? extends IType>,Class<? extends AbstractTypeRef>> private static final intprivate static booleanprivate static booleanFields inherited from interface gw.lang.reflect.ITypeRefFactory
SYSTEM_PROXY_SUFFIX, USER_PROXY_SUFFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddDefaultConstructor(org.objectweb.asm.ClassVisitor cv) private voidassignType(Method ifaceMethod, org.objectweb.asm.MethodVisitor mv, int typeIndex) private voidassignType_FromField(Method ifaceMethod, org.objectweb.asm.MethodVisitor mv, int typeIndex) private voidcall_reload(org.objectweb.asm.MethodVisitor mv) private voidcallMethod(org.objectweb.asm.MethodVisitor mv, Method method) voidprivate voidcompileHeader(org.objectweb.asm.ClassVisitor cv, String name, List<Class> interfaces) private voidcompileInterfaceMembers(org.objectweb.asm.ClassVisitor cv, Class typeClass) private intprivate voidconstructRuntimeException(org.objectweb.asm.MethodVisitor mv, int exceptionIndex) Wraps the actual class with a proxy.private AbstractTypeRefcreateTypeRefProxy(IType type) private voiddelegateMethodCall(Method ifaceMethod, Method proxyMethod, org.objectweb.asm.MethodVisitor mv, int typeIndex) private voidgenBody_NoRefreshSupport(Method ifaceMethod, Method proxyMethod, org.objectweb.asm.MethodVisitor mv) private voidgenBody_SupportRefresh(Method ifaceMethod, Method proxyMethod, org.objectweb.asm.MethodVisitor mv) private Class<? extends AbstractTypeRef>generateProxyClass(Class<? extends IType> typeClass) private voidgenMethod_DevMode(org.objectweb.asm.ClassVisitor cv, Method ifaceMethod, Method proxyMethod) private StringgetDescriptor(Class<?> returnType) private intprivate intprivate MethodgetInterfaceMethod(Method method) private String[]getInterfaceNames(List<Class> interfaces) private voidgetInterfacesFrom(Class<? extends IType> classOfType, List<Class> interfaces) private ClassgetJavaClass(IType iface) private Stringprivate StringgetMethodDescriptor(String[] paramTypeDescriptors, String returnTypeDescriptor) private String[]getMethodExceptions(Method method) private Class<? extends AbstractTypeRef>getOrCreateTypeProxy(Class<? extends IType> typeClass) private String[]getParameterTypeDescriptors(Method _method) private AbstractTypeRefgetRef(WeakFqnCache<AbstractTypeRef> map, String key, IType type) private ITypeRefgetRefTheFastWay(IType type, String strTypeName) private ITypeRefgetRefTheSafeWay(IType type, String strTypeName) private StringgetReturnTypeDescriptor(Method _method) private StringgetSlashName(Class type) private StringgetSlashName(String typeName) getSubordinateRefs(String topLevelTypeName) getTypesWithPrefix(String namespace, String prefix) private voidinsertGetNameStart(org.objectweb.asm.MethodVisitor mv) booleanprivate booleanisTypeGosuClassInstance(Class<?> declaringClass) private booleanprivate booleanprivate static voidputRef(WeakFqnCache<AbstractTypeRef> map, String key, AbstractTypeRef value) private voidsetClearing(boolean bClearing) private static voidverify(byte[] bytes) private voidvisitDebugLineNumber(int iLine, org.objectweb.asm.MethodVisitor mv)
-
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
-
_bClearing
private boolean _bClearing
-
-
Constructor Details
-
TypeRefFactory
public TypeRefFactory()
-
-
Method Details
-
create
Wraps the actual class with a proxy.- Specified by:
createin interfaceITypeRefFactory
-
getRefTheFastWay
-
getRefTheSafeWay
-
createTypeRefProxy
-
getOrCreateTypeProxy
-
generateProxyClass
-
compileHeader
-
getInterfaceNames
-
addDefaultConstructor
private void addDefaultConstructor(org.objectweb.asm.ClassVisitor cv) -
compileInterfaceMembers
-
genMethod_DevMode
-
genBody_NoRefreshSupport
-
genBody_SupportRefresh
-
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
-
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
-
isTypeGosuClassInstance
-
getInterfaceMethod
-
get
- Specified by:
getin interfaceITypeRefFactory
-
get
- Specified by:
getin interfaceITypeRefFactory
-
clearCaches
public void clearCaches()- Specified by:
clearCachesin interfaceITypeRefFactory
-
computeSortIndex
-
setClearing
private void setClearing(boolean bClearing) -
isClearing
public boolean isClearing()- Specified by:
isClearingin interfaceITypeRefFactory
-
getInterfacesFrom
-
getJavaClass
-
putRef
-
getRef
-
getIns
-
getIns
-
isWide
-
isWide
-
getSlashName
-
getSlashName
-
getParameterTypeDescriptors
-
getReturnTypeDescriptor
-
getDescriptor
-
getMethodDescriptor
-
getMethodDescriptor
-
getMethodExceptions
-
callMethod
-
verify
private static void verify(byte[] bytes) -
getSubordinateRefs
- Specified by:
getSubordinateRefsin interfaceITypeRefFactory
-
getTypesWithPrefix
- Specified by:
getTypesWithPrefixin interfaceITypeRefFactory
-