Skip to content

php-in-php: delete phpc_unserialize.c, LLVM via StringUnserializeJit (#5991) - #6643

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-unserialize-5991
Jun 6, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/runtime-php-unserialize-5991

Conversation

@PurHur

@PurHur PurHur commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Delete lib/AOT/runtime/phpc_unserialize.c (~344 lines) and remove it from lib/AOT/Linker.php
  • Add lib/JIT/Builtin/StringUnserializeJit.php — LLVM bodies for __compiler_unserialize and phpc_session_decode_payload (php-src: ext/standard/var_unserializer.c subset, Stdlib: unserialize() — VM + LLVM JIT/AOT #1175)
  • StringUnserialize.php now delegates to StringUnserializeJit instead of compiling/linking C bitcode at JIT link time
  • Hook StringUnserialize::implement in Type/String_.php alongside StringSerialize

C runtime shrink

Removed Lines
lib/AOT/runtime/phpc_unserialize.c 344

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit test/compliance/JITTest.php --filter unserialize'
# OK (3 tests, 3 assertions)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit test/compliance/VMTest.php --filter unserialize'
# OK (3 tests, 3 assertions)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit test/unit/JIT/StringUnserializeRuntimeStandaloneTest.php --no-configuration'
# OK (1 test, 6 assertions)

Closes #5991

Made with Cursor

…5991)

Replace AOT/JIT bitcode link of phpc_unserialize.c with PHP-owned LLVM
lowering in lib/JIT/Builtin/StringUnserializeJit.php (scalar/array subset,
phpc_session_decode_payload for session storage). Removes ~344 lines from
lib/AOT/runtime/ and drops the TU from lib/AOT/Linker.php.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit b00b317 into master Jun 6, 2026
@PurHur
PurHur deleted the agent/runtime-php-unserialize-5991 branch June 6, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

php-in-php: unserialize() parser — delete phpc_unserialize.c, VmUnserialize PHP path for VM+JIT+AOT

1 participant