Skip to content

bugc: emit invoke/return contexts for internal function calls#185

Merged
gnidan merged 1 commit intocall-returnfrom
compiler-emit-call-contexts
Mar 11, 2026
Merged

bugc: emit invoke/return contexts for internal function calls#185
gnidan merged 1 commit intocall-returnfrom
compiler-emit-call-contexts

Conversation

@gnidan
Copy link
Member

@gnidan gnidan commented Mar 11, 2026

Summary

  • Adds invoke context on the caller's JUMP instruction with argument pointers (stack slots)
  • Adds return context on the continuation JUMPDEST with return value pointer (stack slot 0)
  • Adds invoke context on the callee's entry JUMPDEST with argument pointers
  • Uses as unknown as Format.Program.Context casts since invoke/return TS types aren't generated yet (only YAML schemas exist on this branch)

All existing tests pass (361/361). No new tests needed — contexts are additive debug info that doesn't affect bytecode behavior.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-03-11 07:58 UTC

@gnidan gnidan force-pushed the compiler-emit-call-contexts branch 2 times, most recently from 6e265af to 0a0ce4a Compare March 11, 2026 07:47
Add debug context annotations for function call boundaries
using the typed Format.Program.Context.Invoke and
Context.Return interfaces:

- Invoke context on caller's JUMP instruction with target
  pointer and argument group pointers (stack slots)
- Return context on continuation JUMPDEST with data pointer
  to return value at stack slot 0
- Invoke context on callee entry JUMPDEST with target and
  argument pointers

Includes tests verifying context emission for single-arg,
multi-arg, nested, and void function call scenarios.
@gnidan gnidan force-pushed the compiler-emit-call-contexts branch from 0a0ce4a to 822ecb0 Compare March 11, 2026 07:53
@gnidan gnidan merged commit da00fb8 into call-return Mar 11, 2026
4 checks passed
@gnidan gnidan deleted the compiler-emit-call-contexts branch March 11, 2026 07:54
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