Category
php-in-php | bootstrap | stdlib
Problem
#4795 tracks bootstrap-native JSON without host ext/json. Today lib/AOT/runtime/phpc_json_decode.c (~649 lines) implements a parallel JSON parser in C for JIT/AOT while VM may delegate to host json_decode(). Self-host (M5) requires JSON in compiled PHP (ext/standard/VmJson.php or equivalent), not a growing C decoder.
php-src reference
Repro (failure today)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "var_dump(json_decode(\"{\\\"a\\\":1}\", true));"
test -f lib/AOT/runtime/phpc_json_decode.c && wc -l lib/AOT/runtime/phpc_json_decode.c
'
| Runtime |
Today |
| VM |
works (often host delegation) |
| AOT bootstrap |
depends on C phpc_json_decode.c / host json |
| C file |
~649 lines still in tree |
Target: one PHP implementation compiled through the pipeline; delete C.
Scope (this repo)
| Module |
Path |
| PHP parser/decoder |
new or extend ext/standard/VmJson.php, json_decode.php |
| JIT/AOT lowering |
lib/JIT/Builtin/ or ext JIT classes — no C fallback |
| Bootstrap gate |
make bootstrap-selfhost-link / php script/bootstrap-inventory.php --check |
| Delete C |
lib/AOT/runtime/phpc_json_decode.c (~649 lines) |
Done when
Related
Links
Category
php-in-php|bootstrap|stdlibProblem
#4795 tracks bootstrap-native JSON without host
ext/json. Todaylib/AOT/runtime/phpc_json_decode.c(~649 lines) implements a parallel JSON parser in C for JIT/AOT while VM may delegate to hostjson_decode(). Self-host (M5) requires JSON in compiled PHP (ext/standard/VmJson.phpor equivalent), not a growing C decoder.php-src reference
ext/json/php_json.c—PHP_FUNCTION(json_decode),php_json_decode_exext/json/json_parser.tab.c— parser (reference only; implement in PHP)Repro (failure today)
phpc_json_decode.c/ host jsonTarget: one PHP implementation compiled through the pipeline; delete C.
Scope (this repo)
ext/standard/VmJson.php,json_decode.phplib/JIT/Builtin/or ext JIT classes — no C fallbackmake bootstrap-selfhost-link/php script/bootstrap-inventory.php --checklib/AOT/runtime/phpc_json_decode.c(~649 lines)Done when
json_decode('{"a":1}', true)matches Zend on VM, JIT, and AOT without hostjson_*phpc_json_decode.cremoved; PR notes ~649 lines removed fromruntime/./script/ci-fast.sh --filter json_decodegreenRelated
Links