Skip to content

php-in-php: JIT PendingHeadersRuntime — route header_list()/headers_sent() through VmHttp PHP not ~1k-line LLVM (#1492) #9360

Description

@PurHur

Category

php-in-php — shrink HTTP header stack LLVM

Problem

HTTP response header bookkeeping for JIT/AOT lives in PendingHeadersRuntime.php (~1,083 lines LLVM) managing pending header lists, headers_sent() state, and related globals — parallel to PHP web helpers already used on the VM path.

This duplicates semantics that should live in ext/standard/VmHttp*.php / lib/Web/ and compile through the normal pipeline.

php-src reference

Repro

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

./script/docker-exec.sh -- php bin/vm.php -r '
header("X-Test: 1");
var_export(headers_sent());
var_export(header_list());
'

# JIT/AOT must match after migration:
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/jit.php -r "
header(\"X-Test: 1\");
var_export(headers_sent());
"'

Scope (this repo)

Path Work
ext/standard/VmHttp.php / VmHttpResponse.php SSOT pending header list + sent flag
lib/JIT/Builtin/PendingHeadersRuntime.php Thin bridge only
lib/JIT/Builtin/HttpResponseCode.php Coordinate with #9344 migration
Tests test/compliance/cases/web/headers_sent.phpt, @group serve

Done when

  • PendingHeadersRuntime.php >80% line reduction; PHP owns semantics
  • VM + JIT/AOT agree on repro (headers_sent false before output, true after, header_list contents)
  • Web example examples/001-SimpleWeb stays green
  • PR lists deleted LLVM/C symbols

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 / JITarea:webWeb / CGI / superglobalsenhancementNew 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 apps

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions