Skip to content

php-in-php: JIT SessionLifecycleRuntime — route session_start/write_close/destroy through VmSession PHP not ~460-line LLVM (#1492) #9446

Description

@PurHur

Category

php-in-php · php-src-strict

Problem

Session lifecycle builtins (session_start, session_write_close, session_destroy, status transitions) have VM logic in ext/standard/VmSession.php and helpers, but JIT/AOT still link lib/JIT/Builtin/SessionLifecycleRuntime.php (~461 lines) with LLVM globals (sg_SESSION, hex session id generation, write-close paths).

Related migrations #9411 (session_gc), #9440 (session_encode/decode), #9376 (session_name headers) must share one PHP session SSOT — lifecycle LLVM is the largest remaining non-encode chunk.

php-src reference

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "
session_start();
\$_SESSION[\"k\"] = 1;
session_write_close();
var_dump(session_status());
session_start();
var_dump(\$_SESSION[\"k\"]);
session_destroy();
var_dump(session_status());
"'

wc -l lib/JIT/Builtin/SessionLifecycleRuntime.php

Scope (this repo)

Path Work
lib/JIT/Builtin/SessionLifecycleRuntime.php Shrink to trampoline; delete LLVM session state machine
ext/standard/session_start.php, session_destroy.php, … JIT lower() → VmSession
ext/standard/VmSession.php SSOT lifecycle + #9376 header guards
Tests test/compliance/cases/stdlib/session_*.phpt JIT

Done when

Related

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