Skip to content

Direct-call lowering: rt.InvokeValue → direct Go calls #270

Description

@nnunley

Tracking issue for direct-call lowering — lifting the rt.LookupVar → Var.Deref → rt.InvokeValue trampoline into direct Go calls in the -tags gogen_ir lowered tree. Sub-issue of #258. Reconciled against main @ d4c36cf2 (#251), 2026-06-19.

Already in main

Pending slices (sub-issues)

  • Slice 2 — native-module cross-ns direct calls (branch feat/native-direct-calls, ticket lg-dq58). Seeds *lowered-registry* from (rt/native-modules) and emits the Go imports so the dormant :native? path activates end-to-end. Eliminates 94 seq trampolines → corefns.Seq. Perf-neutral (these native calls are cold). Implemented on-branch (3 commits); needs rebase onto current main + bundle regen.
  • Slice 3 — global-lowered-registry: hot cross-ns lowered direct calls (planned follow-on, named in the lg-dq58 commit). Targets the hot trampolines — cross-ns calls into lowered licm/typeinfer/build. This is where the actual perf win is; Slice 2 deliberately leaves it.

Adjacent (not filed here)

  • Lambda lifting — queued after direct-call per the roadmap; distinct optimization, no branch yet.
  • Structured Go emission (ir.structurize) is already merged in mainlower-body is structured-first (if/for/break/continue for reducible CFGs) and falls back to the goto emitter when structurize reports :fallbacks > 0. It is the proper-emission mechanism, not pending direct-call work. Its residual fallbacks are exactly the gogen_ir: close ir.structurize fallbacks for the 18 func-decl-bail defns #263 bucket (driving structurize :fallbacks → 0).

Superseded branches (archive, not filed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions