Skip to content

php-in-php: get_resource_type/get_resources LLVM — shrink phpc_stream.c (#6821) - #7610

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-stream-resource-jit
Jun 8, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/runtime-php-stream-resource-jit

Conversation

@PurHur

@PurHur PurHur commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

php-src ref: ext/standard/file.c (get_resource_type), ext/standard/basic_functions.c (get_resources).

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter "StreamResourceRuntimeStandalone|StreamCapsRuntimeStandalone|get_resources_jit"'
OK (5 tests, 19 assertions)
wc -l lib/AOT/runtime/phpc_stream.c
# 728 (was 771)

Note: AotTest::testCases get_resources compile failure (Unknown how to assign to a value) reproduces on master before this PR — pre-existing JIT lowering blocker, not introduced here.

Closes #6821 (partial — handle table still in C; further phpc_stream.c migration tracked there).

Made with Cursor

…am.c (#6821)

Lower __compiler_get_resource_type and __compiler_get_resources via
StreamResourceJit LLVM (mirrors ext/standard VmFs parity paths) so AOT
standalone no longer needs those symbols in phpc_stream.c.

C shrink: 43 lines removed from lib/AOT/runtime/phpc_stream.c (771→728);
phpc_stream_was_used exported for LLVM closed-handle Unknown probe.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit ade3f98 into master Jun 8, 2026
@PurHur
PurHur deleted the agent/runtime-php-stream-resource-jit branch June 8, 2026 02:38
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: phpc_stream.c wrapper stack — register/restore in ext/standard PHP before deleting ~867 lines (#5343)

1 participant