Search in sources :

Example 1 with SootResolver

use of soot.SootResolver in project robovm by robovm.

the class ObjCProtocolProxyPlugin method init.

private void init() {
    if (initialized) {
        return;
    }
    SootResolver r = SootResolver.v();
    org_robovm_objc_ObjCProtocol = r.makeClassRef(OBJC_PROTOCOL);
    initialized = true;
}
Also used : SootResolver(soot.SootResolver)

Example 2 with SootResolver

use of soot.SootResolver in project robovm by robovm.

the class ObjCBlockPlugin method init.

private void init() {
    if (initialized) {
        return;
    }
    SootResolver r = SootResolver.v();
    org_robovm_objc_ObjCBlock = r.makeClassRef("org.robovm.objc.ObjCBlock");
    java_lang_Boolean = r.makeClassRef("java.lang.Boolean");
    java_lang_Byte = r.makeClassRef("java.lang.Byte");
    java_lang_Short = r.makeClassRef("java.lang.Short");
    java_lang_Character = r.makeClassRef("java.lang.Character");
    java_lang_Integer = r.makeClassRef("java.lang.Integer");
    java_lang_Long = r.makeClassRef("java.lang.Long");
    java_lang_Float = r.makeClassRef("java.lang.Float");
    java_lang_Double = r.makeClassRef("java.lang.Double");
}
Also used : SootResolver(soot.SootResolver)

Example 3 with SootResolver

use of soot.SootResolver in project robovm by robovm.

the class ObjCMemberPlugin method init.

private void init(Config config) {
    if (initialized) {
        return;
    }
    this.config = config;
    if (config.getClazzes().load(OBJC_OBJECT.replace('.', '/')) == null) {
        initialized = true;
        return;
    }
    SootResolver r = SootResolver.v();
    // These have to be resolved to HIERARCHY so that isPhantom() works
    // properly
    org_robovm_objc_ObjCObject = r.resolveClass(OBJC_OBJECT, SootClass.HIERARCHY);
    org_robovm_objc_ObjCExtensions = r.resolveClass(OBJC_EXTENSIONS, SootClass.HIERARCHY);
    // These only have to be DANGLING
    org_robovm_objc_ObjCClass = r.makeClassRef(OBJC_CLASS);
    org_robovm_objc_ObjCSuper = r.makeClassRef(OBJC_SUPER);
    org_robovm_objc_ObjCRuntime = r.makeClassRef(OBJC_RUNTIME);
    org_robovm_objc_Selector = r.makeClassRef(SELECTOR);
    org_robovm_apple_foundation_NSObject = r.makeClassRef(NS_OBJECT);
    org_robovm_apple_foundation_NSObject$Marshaler = r.makeClassRef(NS_OBJECT$MARSHALER);
    org_robovm_apple_foundation_NSString$AsStringMarshaler = r.makeClassRef(NS_STRING$AS_STRING_MARSHALER);
    org_robovm_objc_$M = r.makeClassRef($M);
    org_robovm_apple_uikit_UIEvent = r.makeClassRef(UI_EVENT);
    org_robovm_apple_foundation_NSArray = r.makeClassRef(NS_ARRAY);
    SootClass java_lang_Object = r.makeClassRef("java.lang.Object");
    java_lang_String = r.makeClassRef("java.lang.String");
    java_lang_Class = r.makeClassRef("java.lang.Class");
    org_robovm_objc_Selector_register = Scene.v().makeMethodRef(org_robovm_objc_Selector, "register", Arrays.<Type>asList(java_lang_String.getType()), org_robovm_objc_Selector.getType(), true);
    org_robovm_objc_ObjCObject_getSuper = Scene.v().makeMethodRef(org_robovm_objc_ObjCObject, "getSuper", Collections.<Type>emptyList(), org_robovm_objc_ObjCSuper.getType(), false);
    org_robovm_objc_ObjCObject_updateStrongRef = Scene.v().makeMethodRef(org_robovm_objc_ObjCObject, "updateStrongRef", Arrays.<Type>asList(java_lang_Object.getType(), java_lang_Object.getType()), VoidType.v(), false);
    org_robovm_objc_ObjCClass_getByType = Scene.v().makeMethodRef(org_robovm_objc_ObjCClass, "getByType", Arrays.<Type>asList(java_lang_Class.getType()), org_robovm_objc_ObjCClass.getType(), true);
    org_robovm_objc_ObjCRuntime_bind = Scene.v().makeMethodRef(org_robovm_objc_ObjCRuntime, "bind", Arrays.<Type>asList(java_lang_Class.getType()), VoidType.v(), true);
    org_robovm_objc_ObjCObject_customClass = Scene.v().makeFieldRef(org_robovm_objc_ObjCObject, "customClass", BooleanType.v(), false);
    org_robovm_objc_ObjCExtensions_updateStrongRef = Scene.v().makeMethodRef(org_robovm_objc_ObjCExtensions, "updateStrongRef", Arrays.<Type>asList(org_robovm_objc_ObjCObject.getType(), java_lang_Object.getType(), java_lang_Object.getType()), VoidType.v(), true);
    initialized = true;
}
Also used : RefType(soot.RefType) BooleanType(soot.BooleanType) SootMethodType(org.robovm.compiler.util.generic.SootMethodType) Type(soot.Type) DoubleType(soot.DoubleType) FloatType(soot.FloatType) LongType(soot.LongType) RefLikeType(soot.RefLikeType) PrimType(soot.PrimType) VoidType(soot.VoidType) SootResolver(soot.SootResolver) SootClass(soot.SootClass)

Aggregations

SootResolver (soot.SootResolver)3 SootMethodType (org.robovm.compiler.util.generic.SootMethodType)1 BooleanType (soot.BooleanType)1 DoubleType (soot.DoubleType)1 FloatType (soot.FloatType)1 LongType (soot.LongType)1 PrimType (soot.PrimType)1 RefLikeType (soot.RefLikeType)1 RefType (soot.RefType)1 SootClass (soot.SootClass)1 Type (soot.Type)1 VoidType (soot.VoidType)1