Skip to content

JIT: spl_autoload_register compile-time lowering (#1369 phase 2) #1776

@PurHur

Description

@PurHur

Problem

#1369 closed with VM spl_autoload_register() on master. Capability matrix and docs/stdlib-jit-audit.md still mark JIT as no — project builds that rely on PSR-4 at runtime cannot use phpc serve --jit or JIT compliance for autoloaded classes.

#1762 (dynamic require / manifest PSR-4 at AOT build time) is orthogonal: this issue is JIT lowering when autoload callbacks run during JIT execution.

Goal

spl_autoload_register callbacks compile under LLVM 9 the same way other ext/standard/ builtins do, for the MiniWebApp / self-host subset:

  1. Register callback list in VM hashtable (already works)
  2. JIT TYPE_CALL into autoload callbacks for known class names (static string FQCN v1)
  3. Document dynamic class names as VM-only in docs/capabilities.md

Implementation hints

Layer Files Notes
Builtin ext/standard/spl_autoload_register.php VM entry exists
JIT stub lib/JIT/Builtin/ Add or extend autoload invoke path
Class load lib/VM.php, lib/Runtime.php Mirror VM autoload trigger before JIT
Lint lib/Lint/UnsupportedRegistry.php Remove JIT deferral when green
Tests test/unit/SplAutoloadRegisterBuiltinTest.php Extend with @group llvm execute

Unblock order

#1369 VM ✅ → this issue (JIT) → #1770 project includes → #207 serve --jit

Acceptance criteria

./script/ci-local.sh --filter SplAutoloadRegister
# JIT path (when LLVM ready):
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
  vendor/bin/phpunit --group llvm --filter SplAutoloadRegister

Verification (local / Docker only)

No GitHub Actions (#394 ✅). Use ./script/docker-ci-local.sh on harness hosts.

Dependencies

Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions