agra
c02b6b3b1b
ffi #jni_main: Alias.new(args) constructor dispatch via JNI NewObject
...
Adds the constructor-invocation arm of the foreign-class DSL:
`SurfaceView.new(ctx)` (where `SurfaceView` is a `#foreign #jni_class`
with `static new :: (ctx: *Context) -> *Self;`) lowers to
`FindClass(env, "android/view/SurfaceView") + GetMethodID(env, cls,
"<init>", "(args)V") + NewObject(env, cls, mid, args...)`. Returns
the fresh jobject.
- inst.zig: `JniMsgSend.is_constructor` flag + `parent_class_path`
re-purposed to carry the class being constructed (alongside its
existing nonvirtual-super-class use). Mutually exclusive with
`is_static` / `is_nonvirtual`.
- lower.zig: `lowerCall.field_access` arm now recognises
`Alias.method(args)` where `Alias` resolves in `foreign_class_map`
and the matching member is `static`. `new` routes to a new
`lowerForeignStaticCall` that derives a `(args)V` JNI descriptor
and emits a `JniMsgSend` with `is_constructor=true`. Non-`new`
static calls report a clear "use #jni_static_call" diagnostic
until that sugar lands.
- emit_llvm.zig: new `NewObject` vtable slot (28) + `emitJniConstructor`
helper expanding the FindClass+GetMethodID+NewObject chain. The
jni_msg_send arm short-circuits to it when `is_constructor` is set.
Smoke `ffi-jni-main-03-ctor.sx` exercises both this slice and the
previous super-dispatch slice in a single `onCreate` body: calls
`super.onCreate(b)` then constructs a `SurfaceView` with the Activity
as Context. IR shows the expected six-stage chain (FindClass+GetMethodID+
CallNonvirtual + FindClass+GetMethodID+NewObject); APK builds clean.
Naming caveat: the Java type `android.content.Context` clashes with
sx stdlib's `Context :: struct {...}` (heap-context). The smoke aliases
it `JContext` — future work could add a path-prefix or `as` rename
form on `#jni_class` to avoid the manual rename.
133 host / 6 cross / zig build test all green.
2026-05-20 17:14:51 +03:00
..
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 19:44:20 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-28 18:03:38 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-20 18:22:42 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 19:44:20 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-15 12:02:36 +02:00
2026-02-22 22:16:30 +02:00
2026-02-22 22:16:30 +02:00
2026-02-22 17:24:04 +02:00
2026-02-22 17:24:04 +02:00
2026-02-22 17:24:04 +02:00
2026-02-22 17:24:04 +02:00
2026-02-22 17:24:04 +02:00
2026-02-28 18:03:38 +02:00
2026-02-23 13:45:44 +02:00
2026-02-23 13:45:44 +02:00
2026-02-25 15:51:22 +02:00
2026-02-25 15:51:22 +02:00
2026-03-02 21:00:55 +02:00
2026-03-02 21:00:55 +02:00
2026-02-15 19:44:20 +02:00
2026-03-04 17:12:56 +02:00
2026-03-05 16:20:36 +02:00
2026-03-05 16:20:36 +02:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 13:19:08 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-17 19:36:37 +03:00
2026-05-18 00:11:23 +03:00
2026-05-18 00:11:23 +03:00
2026-05-18 00:11:23 +03:00
2026-05-18 00:11:23 +03:00
2026-05-18 00:11:23 +03:00
2026-05-18 00:11:23 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-19 12:06:08 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 18:32:55 +03:00
2026-05-18 18:32:55 +03:00
2026-05-19 00:22:35 +03:00
2026-05-19 00:22:35 +03:00
2026-05-19 11:31:04 +03:00
2026-05-19 11:31:04 +03:00
2026-05-19 19:18:31 +03:00
2026-05-19 19:18:31 +03:00
2026-05-19 21:14:31 +03:00
2026-05-19 21:14:31 +03:00
2026-05-19 11:15:13 +03:00
2026-05-19 11:15:13 +03:00
2026-05-19 11:21:16 +03:00
2026-05-19 11:32:36 +03:00
2026-05-19 11:41:06 +03:00
2026-05-19 11:41:06 +03:00
2026-05-19 11:44:43 +03:00
2026-05-19 11:44:43 +03:00
2026-05-19 11:46:47 +03:00
2026-05-19 11:46:47 +03:00
2026-05-19 11:48:34 +03:00
2026-05-19 11:48:34 +03:00
2026-05-19 11:51:34 +03:00
2026-05-19 11:51:34 +03:00
2026-05-19 11:57:44 +03:00
2026-05-19 11:57:44 +03:00
2026-05-19 11:59:18 +03:00
2026-05-19 11:59:18 +03:00
2026-05-19 12:46:53 +03:00
2026-05-19 12:46:53 +03:00
2026-05-19 21:25:42 +03:00
2026-05-19 21:25:42 +03:00
2026-05-19 21:41:26 +03:00
2026-05-20 13:53:25 +03:00
2026-05-19 21:41:26 +03:00
2026-05-19 22:26:03 +03:00
2026-05-20 13:53:25 +03:00
2026-05-19 22:26:03 +03:00
2026-05-19 22:30:05 +03:00
2026-05-20 13:53:25 +03:00
2026-05-19 22:30:05 +03:00
2026-05-19 22:31:58 +03:00
2026-05-20 13:53:25 +03:00
2026-05-19 22:31:58 +03:00
2026-05-19 22:33:58 +03:00
2026-05-20 13:53:25 +03:00
2026-05-19 22:33:58 +03:00
2026-05-19 22:36:36 +03:00
2026-05-20 13:53:25 +03:00
2026-05-19 22:36:36 +03:00
2026-05-19 22:40:47 +03:00
2026-05-20 13:53:25 +03:00
2026-05-19 22:40:47 +03:00
2026-05-20 09:24:14 +03:00
2026-05-20 09:24:14 +03:00
2026-05-20 09:30:02 +03:00
2026-05-20 09:30:02 +03:00
2026-05-20 09:35:09 +03:00
2026-05-20 09:35:09 +03:00
2026-05-20 10:02:56 +03:00
2026-05-20 10:02:56 +03:00
2026-05-20 10:05:30 +03:00
2026-05-20 10:05:30 +03:00
2026-05-20 10:10:23 +03:00
2026-05-20 10:10:23 +03:00
2026-05-20 10:15:10 +03:00
2026-05-20 10:15:10 +03:00
2026-05-20 11:07:41 +03:00
2026-05-20 13:53:25 +03:00
2026-05-20 11:07:41 +03:00
2026-05-20 10:41:24 +03:00
2026-05-20 10:41:24 +03:00
2026-05-20 10:54:37 +03:00
2026-05-20 13:53:25 +03:00
2026-05-20 10:54:37 +03:00
2026-05-20 13:53:25 +03:00
2026-05-20 13:53:25 +03:00
2026-05-20 14:42:03 +03:00
2026-05-20 14:42:03 +03:00
2026-05-20 16:57:30 +03:00
2026-05-20 16:57:30 +03:00
2026-05-20 17:14:51 +03:00
2026-05-20 17:14:51 +03:00
2026-05-19 12:45:49 +03:00
2026-05-19 12:45:49 +03:00
2026-05-19 12:56:53 +03:00
2026-05-19 12:56:53 +03:00
2026-05-19 12:59:13 +03:00
2026-05-19 19:18:31 +03:00
2026-05-19 12:59:13 +03:00
2026-05-19 18:39:10 +03:00
2026-05-19 18:39:10 +03:00
2026-05-19 18:44:14 +03:00
2026-05-19 18:44:14 +03:00
2026-05-19 18:45:57 +03:00
2026-05-19 19:18:31 +03:00
2026-05-19 18:50:26 +03:00
2026-05-19 18:51:56 +03:00
2026-05-19 18:51:56 +03:00
2026-05-19 18:53:19 +03:00
2026-05-19 18:53:19 +03:00
2026-05-19 18:57:41 +03:00
2026-05-19 18:57:41 +03:00
2026-05-19 19:00:47 +03:00
2026-05-19 19:00:47 +03:00
2026-05-19 20:12:09 +03:00
2026-05-19 20:12:09 +03:00
2026-05-19 21:19:09 +03:00
2026-05-19 21:19:09 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00
2026-05-18 17:40:10 +03:00