Skip to content

JIT: session_destroy LLVM lowering (session_regenerate_id done #1895) #1892

Description

@PurHur

Problem

#1186 ✅ closed (#1895 — session_regenerate_id JIT/AOT on master). session_destroy still throws in JIT builds:

'session_destroy() not implemented for JIT in this compiler build (issue #1182)'

docs/capabilities.md correctly lists JIT no; SelfHostBuiltinPolicy maps both to session stubs. 005-SessionsWeb (#1881) logout/regenerate flows need JIT parity for spine/self-host and honest phpc serve --jit (#207).

session_start / session_write_close landed in #1882 / #1890 — reuse the same C runtime (lib/AOT/runtime/phpc_session_lifecycle.c) and lib/JIT/Builtin/Session*.php pattern.

Goal

Implementation hints

Piece Path Notes
VM ext/standard/session_destroy.php, session_regenerate_id.php Already correct
LLVM stubs lib/JIT/Builtin/SessionDestroy.php (new) SessionRegenerateId.php ✅ #1895; register like SessionStart
C runtime lib/AOT/runtime/phpc_session_lifecycle.c Extend destroy helper (regenerate helpers ✅ #1895)
Self-host lib/JIT/SelfHostBuiltinPolicy.php Move from stub → real lowering when safe
Tests test/compliance/cases/stdlib/session_destroy_jit.phpt Two-request destroy clears $_SESSION
Audit php script/audit-stdlib-jit.php Update docs/stdlib-jit-audit.md

Acceptance criteria

./script/ci-local.sh --filter 'session_destroy|session_regenerate'
vendor/bin/phpunit test/compliance/cases/stdlib/session_destroy_jit.phpt
php script/capability-matrix.php   # JIT yes for both

Docker:

docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
  ./script/ci-local.sh --filter SessionDestroy

Dependencies

Links

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions