This commit is contained in:
agra
2026-05-24 13:42:35 +03:00
parent 49b39ba07a
commit 0ba41b2980
5 changed files with 2 additions and 107 deletions

View File

@@ -196,19 +196,9 @@ pub const Op = union(enum) {
/// Method-ID caching across call sites is added in step 1.17.
jni_msg_send: JniMsgSend,
// ── Protocol dispatch ───────────────────────────────────────────
protocol_call_dynamic: ProtocolCall, // vtable/inline dispatch
protocol_erase: ProtocolErase, // concrete → protocol value (xx)
// ── Closure creation ────────────────────────────────────────────
closure_create: ClosureCreate,
// ── Context ─────────────────────────────────────────────────────
context_load: ContextOp, // read context field
context_store: ContextOp, // write context field
context_save, // save context state (for push)
context_restore: UnaryOp, // restore context state (after push)
// ── Globals ─────────────────────────────────────────────────────
global_get: GlobalId,
global_addr: GlobalId, // address of a global (pointer, not load)
@@ -377,27 +367,11 @@ pub const CompilerCall = struct {
args: []const Ref,
};
pub const ProtocolCall = struct {
receiver: Ref, // protocol value (ctx + vtable/fn_ptrs)
method_index: u32,
args: []const Ref,
};
pub const ProtocolErase = struct {
concrete: Ref,
protocol_type: TypeId,
};
pub const ClosureCreate = struct {
func: FuncId, // trampoline function
env: Ref, // allocated env pointer (or Ref.none for no captures)
};
pub const ContextOp = struct {
field: StringId,
value: Ref, // Ref.none for loads
};
pub const GlobalSet = struct {
global: GlobalId,
value: Ref,