Search in sources :

Example 1 with PointerMarshalerMethod

use of org.robovm.compiler.MarshalerLookup.PointerMarshalerMethod in project robovm by robovm.

the class BridgeMethodCompiler method updateObject.

private void updateObject(SootMethod method, Function fn, Value env, long flags, List<MarshaledArg> marshaledArgs) {
    for (MarshaledArg value : marshaledArgs) {
        MarshalerMethod marshalerMethod = config.getMarshalerLookup().findMarshalerMethod(new MarshalSite(method, value.paramIndex));
        SootMethod afterMethod = ((PointerMarshalerMethod) marshalerMethod).getAfterBridgeCallMethod();
        if (afterMethod != null) {
            Invokestatic invokestatic = new Invokestatic(getInternalName(method.getDeclaringClass()), getInternalName(afterMethod.getDeclaringClass()), afterMethod.getName(), getDescriptor(afterMethod));
            trampolines.add(invokestatic);
            call(fn, invokestatic.getFunctionRef(), env, value.object, value.handle, new IntegerConstant(flags));
        }
    }
}
Also used : MarshalSite(org.robovm.compiler.MarshalerLookup.MarshalSite) Invokestatic(org.robovm.compiler.trampoline.Invokestatic) PointerMarshalerMethod(org.robovm.compiler.MarshalerLookup.PointerMarshalerMethod) SootMethod(soot.SootMethod) MarshalerMethod(org.robovm.compiler.MarshalerLookup.MarshalerMethod) PointerMarshalerMethod(org.robovm.compiler.MarshalerLookup.PointerMarshalerMethod) IntegerConstant(org.robovm.compiler.llvm.IntegerConstant)

Example 2 with PointerMarshalerMethod

use of org.robovm.compiler.MarshalerLookup.PointerMarshalerMethod in project robovm by robovm.

the class CallbackMethodCompiler method updateNative.

private void updateNative(SootMethod method, Function fn, Value env, long flags, List<MarshaledArg> marshaledArgs) {
    for (MarshaledArg value : marshaledArgs) {
        MarshalerMethod marshalerMethod = config.getMarshalerLookup().findMarshalerMethod(new MarshalSite(method, value.paramIndex));
        SootMethod afterMethod = ((PointerMarshalerMethod) marshalerMethod).getAfterCallbackCallMethod();
        if (afterMethod != null) {
            Invokestatic invokestatic = new Invokestatic(getInternalName(method.getDeclaringClass()), getInternalName(afterMethod.getDeclaringClass()), afterMethod.getName(), getDescriptor(afterMethod));
            trampolines.add(invokestatic);
            call(fn, invokestatic.getFunctionRef(), env, value.handle, value.object, new IntegerConstant(flags));
        }
    }
}
Also used : MarshalSite(org.robovm.compiler.MarshalerLookup.MarshalSite) Invokestatic(org.robovm.compiler.trampoline.Invokestatic) PointerMarshalerMethod(org.robovm.compiler.MarshalerLookup.PointerMarshalerMethod) SootMethod(soot.SootMethod) MarshalerMethod(org.robovm.compiler.MarshalerLookup.MarshalerMethod) PointerMarshalerMethod(org.robovm.compiler.MarshalerLookup.PointerMarshalerMethod) IntegerConstant(org.robovm.compiler.llvm.IntegerConstant)

Aggregations

MarshalSite (org.robovm.compiler.MarshalerLookup.MarshalSite)2 MarshalerMethod (org.robovm.compiler.MarshalerLookup.MarshalerMethod)2 PointerMarshalerMethod (org.robovm.compiler.MarshalerLookup.PointerMarshalerMethod)2 IntegerConstant (org.robovm.compiler.llvm.IntegerConstant)2 Invokestatic (org.robovm.compiler.trampoline.Invokestatic)2 SootMethod (soot.SootMethod)2