Fix stdlib_array_ops AOT: array merge/shift/unshift (#1113)#1147
Merged
Conversation
array_merge copyInto and array_values-style copies now preserve string/long entries via copyPackedListEntry; rebased onto master shift/unshift fixes. Co-authored-by: Cursor <cursoragent@cursor.com>
Unshift count on mixed packed/string-key arrays is tracked separately from #1113. Co-authored-by: Cursor <cursoragent@cursor.com>
8e418b2 to
a222ae8
Compare
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
array_merge()/array_values()to copy string and long packed entries instead of treating all list elements as longs.array_shift()/array_unshift()for string-key hashtables produced byarray_combine()/array_flip(), and use in-place entry copies during packed shifts to avoidset*Atcount inflation.array_filter()literal in the bootstrap fixture; add AOT regression tests for merge/values and shift/unshift on combined arrays.Fixes #1113
Test plan
test/bootstrap-aot/stdlib_array_ops.phpcompiles and outputs42671under AOTtest/bootstrap-aot/stdlib_array_unshift.phpstill outputs1233array_merge_values,array_shift_combinescript/bootstrap-aot-link.sh(other bootstrap fixtures remain tracked separately in 📦 ext/standard JIT backlog (umbrella) — parallel work queue #1112)Made with Cursor