Skip to content

feature/universal runtime#309

Merged
nahime0 merged 77 commits into
mainfrom
feature/universal-runtime
May 28, 2026
Merged

feature/universal runtime#309
nahime0 merged 77 commits into
mainfrom
feature/universal-runtime

Conversation

@nahime0
Copy link
Copy Markdown
Member

@nahime0 nahime0 commented May 27, 2026

Summary

Implements the universal runtime callable descriptor work from the roadmap. Runtime callables now carry the metadata needed for signature/default/by-ref/variadic handling, receiver and capture environments, and descriptor-backed invocation across the supported callable shapes.

What Changed

  • Added runtime callable descriptor coverage for string callbacks, callable arrays, closures, first-class callables, object __invoke, static and instance methods, builtins, and extern callable shapes.
  • Routed dynamic callable execution through descriptor invokers for call_user_func(), call_user_func_array(), preg_replace_callback(), SPL iterator/callback helpers, array callbacks, fibers, and direct expression calls.
  • Preserved receiver and capture environments for runtime-selected callable arrays, first-class method callables, closure aliases, branch-selected descriptors, and invokable objects.
  • Normalized descriptor invocation metadata for named arguments, defaults, variadics, by-reference parameters, spread arguments, and hidden receiver/capture parameters.
  • Added stateful FFI callback trampolines: descriptor-backed callables passed to extern callable parameters are retained in a per-callsite slot and exposed to C as generated ABI-compatible trampoline symbols.
  • Updated docs and roadmap entries to describe the runtime callable descriptor model and the supported extern callback boundary.

FFI Callback Boundary

Extern callback descriptors now support fixed C-compatible scalar/pointer signatures: int, float, bool, ptr, and void returns, with parameters from int, float, bool, and ptr. PHP heap/value types across the C callback boundary, such as string, arrays, objects, variadics, defaults, and by-reference callback parameters, remain rejected until their ownership and lifetime rules are modeled safely.

Verification

  • cargo check
  • Focused FFI callback tests
  • Focused extern callable error tests
  • cargo build
  • cargo test -- --include-ignored
  • git diff --check
  • Assembly comment alignment checks for touched codegen files

nahime0 added 30 commits May 26, 2026 15:16
nahime0 added 27 commits May 28, 2026 04:56
@nahime0 nahime0 marked this pull request as ready for review May 28, 2026 16:12
@nahime0 nahime0 merged commit 38d1199 into main May 28, 2026
2 checks passed
@nahime0 nahime0 deleted the feature/universal-runtime branch May 28, 2026 16:27
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