Skip to content

Wave 12: bootstrap stdlib array ops fixtures (#1086)#1151

Closed
PurHur wants to merge 1 commit into
masterfrom
fix/wave12-stdlib-array-ops-bootstrap
Closed

Wave 12: bootstrap stdlib array ops fixtures (#1086)#1151
PurHur wants to merge 1 commit into
masterfrom
fix/wave12-stdlib-array-ops-bootstrap

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 23, 2026

Summary

  • Register wave 12 stdlib array builtins (array_push, array_unshift, array_filter, array_combine, array_reverse, compact, extract, sort, etc.) and filter_var/filter_input in SelfHostBuiltinPolicy so they use real Internal JIT lowering when PHP_COMPILER_SELFHOST_AOT=1 instead of no-op ExternalMethod stubs.
  • Harden hashtable mutation persistence: materialize native arrays with correct packed metadata, re-box native arrays as TYPE_VALUE after in-place ops, and write back after sort().
  • Add unit test guarding wave 12 array ops stay on real lowering under self-host AOT.

Partial #1086 — targets the four wave 12 bootstrap fixtures (stdlib_array_ops, array_value_box, stdlib_array_unshift, stdlib_filter).

Fixture results (AOT compile + link + stdout vs Zend)

Fixture Expected AOT actual Status
test/bootstrap-aot/stdlib_array_ops.php 42671 42671 OK
test/bootstrap-aot/array_value_box.php 12 12 OK
test/bootstrap-aot/stdlib_array_unshift.php 1233 1233 OK
test/bootstrap-aot/stdlib_filter.php 420m 420m OK

Test plan

  • Four wave 12 bootstrap fixtures compile, link, and match Zend stdout
  • php vendor/bin/phpunit test/unit/SelfHostBuiltinPolicyTest.php

Made with Cursor

…1086).

Keep array_push, unshift, filter, merge, compact, extract, sort, and related ops on Internal lowering when PHP_COMPILER_SELFHOST_AOT=1, and harden hashtable mutation persistence for native arrays and sort().

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
Copy link
Copy Markdown
Owner Author

PurHur commented May 23, 2026

Superseded by #1162 (merged).

@PurHur PurHur closed this May 23, 2026
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.

1 participant