Skip to content

php-in-php: delete ParseStrUserScriptDelimitedJit — route user-script refresh through ParseStrNativeJitHelper (#18643 follow-up) #18855

Description

@PurHur

Category

php-in-php · runtime-shrink (#1492, re-#18643)

Problem

lib/JIT/Builtin/ParseStrUserScriptDelimitedJit.php (~1020 LLVM lines) hand-lowers delimited parse_str for user-script AOT superglobal refresh. #18643/#18645 deleted it; #18841 restored LLVM because refresh called __phpc_parse_str_parse_delimited_pairs on raw C strings.

ParseStrNativeJitHelper::parseDelimitedIntoNative is the PHP SSOT; ParseStrRuntime::ensureUserScriptLinked() already bridges __compiler_parse_str / __compiler_parse_cookie_header to that helper. SuperglobalRefreshUserScriptLlvm should convert libc C strings to __string__* via existing cstrToPhpcString() and call those bridges — not emit/link hand-LLVM subhelpers.

php-src reference

PHP implementation target

  • lib/JIT/Builtin/SuperglobalRefreshUserScriptLlvm.php — route form/cookie parse through __compiler_parse_str / __compiler_parse_cookie_header
  • Delete lib/JIT/Builtin/ParseStrUserScriptDelimitedJit.php (~1020 LOC LLVM removed)
  • Update shrink guards in ParseStrRuntimeShrinkTest, SuperglobalRefreshRuntimeShrinkTest, SuperglobalsBracketRuntimeStandaloneTest

Repro

wc -l lib/JIT/Builtin/ParseStrUserScriptDelimitedJit.php  # ~1020 today
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit test/unit/ParseStrRuntimeShrinkTest.php test/aot/NestedSuperglobalsAotTest.php'
./script/check-aot-build-smoke.sh

Done when

  • ParseStrUserScriptDelimitedJit.php deleted; no __phpc_parse_str_* LLVM symbols linked for refresh
  • NestedSuperglobalsAotTest + AOT smoke green (QUERY_STRING flat + nested keys)
  • make bootstrap-selfhost-vm-driver-execute-probe green

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 & DevEx

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions