Skip to content

runtime/jit: expose typed allocation for closure contexts - #1

Closed
carli2 wants to merge 1 commit into
jit-foreign-frames-go1.27.0from
jit-typed-closure-allocation
Closed

carli2 wants to merge 1 commit into
jit-foreign-frames-go1.27.0from
jit-typed-closure-allocation

Conversation

@carli2

@carli2 carli2 commented Sep 3, 2026

Copy link
Copy Markdown

Summary

  • add runtime/jit.AllocTyped for one-object JIT closure environments
  • keep the private runtime.mallocgc ABI inside the runtime package
  • derive allocation size and GC pointer layout from the supplied runtime type
  • cover zeroing and pointer retention across GC

Validation

  • rebuilt the complete Go toolchain with Go 1.26.7 as bootstrap
  • GOEXPERIMENT=jit go test runtime/jit
  • MemCP GOEXPERIMENT=jit go test ./scm using the rebuilt toolchain

This lets JIT clients create Go-compatible, precisely typed trailing closure contexts without linking directly to the unstable runtime.mallocgc signature.

@carli2

carli2 commented Sep 3, 2026

Copy link
Copy Markdown
Author

Superseded: this raw runtime-type allocation API is too low-level and was based on the downstream Go 1.27 snapshot. The replacement will be an explicit repeatable-tail allocation API on the master-based upstream branch used by golang#81237.

@carli2 carli2 closed this Sep 3, 2026
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