use of org.robovm.compiler.llvm.Store in project robovm by robovm.
the class Functions method trycatchAllEnter.
public static void trycatchAllEnter(Function fn, Value env, BasicBlockRef onNoException, BasicBlockRef onException) {
Variable ctx = fn.newVariable(TRYCATCH_CONTEXT_PTR);
fn.add(new Alloca(ctx, TRYCATCH_CONTEXT));
Variable selPtr = fn.newVariable(new PointerType(I32));
fn.add(new Getelementptr(selPtr, ctx.ref(), 0, 1));
fn.add(new Store(new IntegerConstant(-1), selPtr.ref()));
Value result = call(fn, RVM_TRYCATCH_ENTER, env, ctx.ref());
fn.add(new Switch(result, onException, new IntegerConstant(0), onNoException));
}
use of org.robovm.compiler.llvm.Store in project robovm by robovm.
the class BroMethodCompiler method storeValueForSetter.
protected void storeValueForSetter(SootMethod method, Function function, Type memberType, Value memberPtr, Value env, Value value, long flags) {
soot.Type type = method.getParameterType(0);
if (needsMarshaler(type)) {
MarshalerMethod marshalerMethod = config.getMarshalerLookup().findMarshalerMethod(new MarshalSite(method, 0));
if (memberType instanceof PrimitiveType) {
value = marshalValueObjectToNative(function, marshalerMethod, memberType, env, value, flags);
} else {
if (memberType instanceof StructureType || memberType instanceof ArrayType) {
// The parameter must not be null. We assume that Structs
// never have a NULL handle so we just check that the Java
// Object isn't null.
call(function, CHECK_NULL, env, value);
}
if (memberType instanceof ArrayType) {
// Array
marshalArrayToNative(function, marshalerMethod, env, value, memberPtr, flags, getArrayDimensions(method, 0));
value = null;
} else {
value = marshalObjectToNative(function, marshalerMethod, null, memberType, env, value, flags);
}
}
} else {
value = marshalPrimitiveToNative(function, method, 0, value);
}
if (value != null) {
function.add(new Store(value, memberPtr));
}
}
Aggregations