Stdlib: fix AOT sys_getloadavg() + count() on boxed arrays (#27294) - #27431
Merged
Conversation
NestedJIT HashTable returns are not thin-AOT `__hashtable__*` — materialize loadavg via scalar helpers + setDoubleAt. count() on TYPE_VALUE must branch on the box type tag so SplFixedArray Countable dispatch (#26793) does not abort plain array counts. Co-authored-by: Cursor <cursoragent@cursor.com>
2 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sys_getloadavg()no longer segfaults when consuming the return array (is_array/count).HashTableis not a real__hashtable__*under thin AOT (peer gc_status Regression: AOT gc_status() compile fails — Current basic block has no parent function (Zend/zend_builtin_functions.c) #26943 / cal_info Stdlib: AOT/JIT cal_info() still refused — re-#7252 (ext/calendar/calendar.c) #27354). Bridge now takes NestedJIT scalars (resolveOk/loadAt) and materializes via__hashtable__alloc+__hashtable__setDoubleAt.count([1,2,3])abort introduced by Regression: AOT SplFixedArray::fromArray compile fails — object::count() (ext/spl/spl_fixedarray.c) #26793/Stdlib: AOT SplFixedArray::fromArray via __spl_ht + Countable count (#26793) #26918:count()onTYPE_VALUEmust branch on the value-box type tag before Countable/SplFixedArray::countdispatch.php-src:
ext/standard/basic_functions.c—PHP_FUNCTION(sys_getloadavg);ext/standard/array.c—php_count.Test plan
./script/docker-exec.sh— Zend/VM/JIT/AOT printbefore\nafter\n3count([1,2,3])/count([])AOT OK;SplFixedArray::fromArraycount still 3vendor/bin/phpunit --filter VmSysGetloadavgRuntimeShrinkTest— OKvendor/bin/phpunit --filter AotRegressionFixtureCatalogTest— OKphp script/bootstrap-inventory.php --check— OK 6928/6928Exact verification
Not covered: full
ci-local.sh/ compliance suites;bootstrap-selfhost-link(stale gen-0 → Zend fallback, terminated after ~20m compile).Made with Cursor