Skip to content

Shrink CastHelper to thin dispatcher (#10244) - #10834

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-10244-cast-helper-shrink
Jun 23, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-10244-cast-helper-shrink

Conversation

@PurHur

@PurHur PurHur commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #10244

php-src reference

  • Zend/zend_operators.cconvert_to_array, cast_object
  • VM SSOT: lib/VM/CastSupport.php, lib/VM/CastJitHelper.php

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit --filter CastRuntimeShrink
vendor/bin/phpunit --filter EnumArrayCast
php bin/jit.php -r "var_export((array) new stdClass());"
php bin/jit.php -r "var_export((object) [\"a\"=>1]);"
php bin/jit.php -r "var_export((array) false);"
php bin/jit.php -r "var_export((array) true);"
'

Output:

OK (3 tests, 11 assertions)  # CastRuntimeShrinkTest
OK (3 tests, 3 assertions)   # EnumArrayCastTest
array ()
(object) array ('a' => 1,)
array ()
array (0 => true,)

Made with Cursor

Route bool (array) cast through JitVmHelperLink + CastJitHelper PHP; split
native (array)/(object)/(unset) lowering into CastArrayNativeJit,
CastObjectNativeJit, and CastUnsetJit so CastHelper stays ~42 LOC glue.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit b801103 into master Jun 23, 2026
@PurHur
PurHur deleted the agent/issue-10244-cast-helper-shrink branch June 23, 2026 14:20
PurHur added a commit that referenced this pull request Jun 23, 2026
…. (#10851)

Regenerate docs/bootstrap-inventory.md for CastArrayNativeJit/CastObjectNativeJit/CastUnsetJit and related vm.php-path files; extend compiler_lib_spine_smoke includes so inventory --check and spine coverage sync pass.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

php-in-php: JIT CastHelper — route (array)/(object) cast LLVM through VmCast PHP not ~125-line monolith (#1492)

1 participant