Skip to content

format: make invoke.target optional for internal calls#213

Merged
gnidan merged 2 commits into
transform-contextfrom
architect-invoke-target-optional
Jun 18, 2026
Merged

format: make invoke.target optional for internal calls#213
gnidan merged 2 commits into
transform-contextfrom
architect-invoke-target-optional

Conversation

@gnidan

@gnidan gnidan commented Apr 16, 2026

Copy link
Copy Markdown
Member

Internal calls via JUMP normally carry a code pointer to the
callee's entry point. When the compiler inlines a function,
the JUMP is elided — there is no physical call instruction
and no code target to point at. The callee identity
(identifier, declaration, type) remains meaningful, but
the target pointer does not.

Same pattern as #211 (making return.data optional). Unblocks
inlining: bugc can emit invoke contexts on inlined first
instructions without fabricating a target pointer.

  • Schema: drop target from InternalCall.required, expand
    description, add worked example for inlined case
  • TS types: mark target optional; guard relaxed accordingly
  • Spec page: document optionality and point at a separate
    transform annotation (via gather) for the inlining
  • bugc: guard target access in patchInvokeInContext; tests
    assert target defined before dereferencing

Internal calls via JUMP normally carry a code pointer to the
callee's entry point. When the compiler inlines a function,
the JUMP is elided — there is no physical call instruction
and no code target to point at. The callee identity
(identifier, declaration, type) remains meaningful, but the
target pointer does not.

Same pattern as #211 (making return.data optional). Unblocks
inlining: bugc can emit invoke contexts on inlined first
instructions without fabricating a target pointer.

- Schema: drop target from InternalCall.required, expand
  description, add worked example for inlined case
- TS types: mark target optional; guard relaxed
- Spec page: document optionality and point at transform +
  gather for inlining annotation
- bugc: guard target access in patchInvokeInContext; tests
  assert target defined before dereferencing
@github-actions

github-actions Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-18 02:36 UTC

@gnidan gnidan changed the base branch from main to transform-context April 16, 2026 08:06
Pair with #212's flat-form guidance: when an inlined body's
first instruction carries both an invoke and a transform,
those belong as sibling keys on a single context — gather
isn't needed because `invoke` and `transform` don't collide.
@gnidan gnidan merged commit 3518f49 into transform-context Jun 18, 2026
4 checks passed
@gnidan gnidan deleted the architect-invoke-target-optional branch June 18, 2026 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant