use of org.graalvm.nativeimage.c.function.CEntryPoint in project graal by oracle.
the class PolyglotNativeAPI method polyglot_create_float.
@SuppressWarnings("UnnecessaryBoxing")
@CEntryPoint(name = "polyglot_create_float")
public static PolyglotStatus polyglot_create_float(IsolateThread isolate_thread, PolyglotContextPointer polyglot_context, float value, PolyglotValuePointerPointer result) {
return withHandledErrors(() -> {
Context ctx = ObjectHandles.getGlobal().get(polyglot_context);
result.write(createHandle(ctx.asValue(Float.valueOf(value))));
});
}
use of org.graalvm.nativeimage.c.function.CEntryPoint in project graal by oracle.
the class PolyglotNativeAPI method polyglot_create_int32.
@SuppressWarnings("UnnecessaryBoxing")
@CEntryPoint(name = "polyglot_create_int32")
public static PolyglotStatus polyglot_create_int32(IsolateThread isolate_thread, PolyglotContextPointer polyglot_context, int value, PolyglotValuePointerPointer result) {
return withHandledErrors(() -> {
Context ctx = ObjectHandles.getGlobal().get(polyglot_context);
result.write(createHandle(ctx.asValue(Integer.valueOf(value))));
});
}
use of org.graalvm.nativeimage.c.function.CEntryPoint in project graal by oracle.
the class PolyglotNativeAPI method polyglot_value_fits_in_int64.
@CEntryPoint(name = "polyglot_value_fits_in_int64")
public static PolyglotStatus polyglot_value_fits_in_int64(IsolateThread isolate_thread, PolyglotValuePointer value, CIntPointer result) {
return withHandledErrors(() -> {
Value dataObject = fetchHandle(value);
result.write(dataObject.fitsInLong() ? 1 : 0);
});
}
use of org.graalvm.nativeimage.c.function.CEntryPoint in project graal by oracle.
the class PolyglotNativeAPI method polyglot_create_object.
@CEntryPoint(name = "polyglot_create_object")
public static PolyglotStatus polyglot_create_object(IsolateThread isolate_thread, PolyglotContextPointer polyglot_context, PolyglotValuePointerPointer result) {
return withHandledErrors(() -> {
Context c = ObjectHandles.getGlobal().get(polyglot_context);
ProxyObject proxy = ProxyObject.fromMap(new HashMap<>());
result.write(createHandle(c.asValue(proxy)));
});
}
use of org.graalvm.nativeimage.c.function.CEntryPoint in project graal by oracle.
the class PolyglotNativeAPI method polyglot_create_uint8.
@SuppressWarnings("UnnecessaryBoxing")
@CEntryPoint(name = "polyglot_create_uint8")
public static PolyglotStatus polyglot_create_uint8(IsolateThread isolate_thread, PolyglotContextPointer polyglot_context, int value, PolyglotValuePointerPointer result) {
return withHandledErrors(() -> {
Context ctx = ObjectHandles.getGlobal().get(polyglot_context);
result.write(createHandle(ctx.asValue(Integer.valueOf(value))));
});
}
Aggregations