Skip to content

php-in-php: JIT SessionEncodeRuntime — route session_encode()/session_decode() through VmSession PHP not ~530-line LLVM (#1492) #9440

Description

@PurHur

Category

php-in-php — session serializer LLVM → ext/session PHP

Problem

lib/JIT/Builtin/SessionEncodeRuntime.php (~530 lines) lowers session_encode() / session_decode() into bespoke LLVM (php_session_encode / decode paths). VM session logic already lives in ext/session/ PHP modules; JIT should call the same PHP implementations via trampoline, not duplicate serializer state machines in LLVM.

Pairs with #9411 (SessionGcRuntime → VmSession PHP) and #9360 (PendingHeadersRuntime).

php-src reference

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php -r '"'"'session_start(); $_SESSION["k"]="v"; echo session_encode();'"'"''

Today JIT path may diverge or require SessionEncodeRuntime::ensureLinked() LLVM. After migration, bin/jit.php with same snippet must match VM output byte-for-byte.

Scope

Done when

  • VM + JIT + AOT session_encode() / session_decode() share one PHP implementation.
  • Compliance session encode/decode PHPTs green (add session_encode_roundtrip.phpt if missing).
  • PR cites lines removed from SessionEncodeRuntime.php.
  • No new C in runtime/ for session serialization.

Related

#1492, #9411, #9376, #9360.

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

    area:compilerCompiler / CFG / JITenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevExphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions