Skip to content

Close #4023: gc_* JIT compliance tests green - #8409

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-gc-jit-4023
Jun 13, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/runtime-php-gc-jit-4023

Conversation

@PurHur

@PurHur PurHur commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix gc_enabled.phpt and gc_collect_cycles.phpt compile failures (Mixed_ from untyped Node::$next) by using #[\AllowDynamicProperties] (same pattern as gc_collect_cycles_destruct.phpt).
  • Add test/compliance/cases/stdlib/gc_jit.phpt covering JIT gc_enabled() toggle + gc_collect_cycles() on a two-node cycle.

GC JIT/AOT lowering was already landed via GcCollectCyclesRuntime / JitGcToggle / JitGcCollectCycles — this PR closes the open compliance gap from #4023.

C runtime: no changes; only phpc_progress.c remains under lib/AOT/runtime/.

php-src reference

  • ext/standard/basic_functions.c — PHP_FUNCTION(gc_collect_cycles), gc_enable, gc_disable, gc_enabled
  • Zend/zend_gc.c — cycle collector

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit test/compliance/VMTest.php --filter "stdlib/gc_enabled"
vendor/bin/phpunit test/compliance/JITTest.php --filter "stdlib/gc_jit"
vendor/bin/phpunit test/compliance/VMTest.php --filter "runtime/gc_collect_cycles"
php bin/jit.php -r "echo gc_enabled() ? \"on\n\" : \"off\n\"; gc_disable(); echo gc_enabled() ? \"on\n\" : \"off\n\"; gc_enable(); echo gc_collect_cycles(), \"\n\";"
'

Output:

OK (1 test, 1 assertion)   # VM gc_enabled
OK (1 test, 1 assertion)   # JIT gc_jit
OK (1 test, 1 assertion)   # VM gc_collect_cycles
on
off
0

Note: AotTest::gc_enabled compile failure is pre-existing on master (not introduced here).

Closes #4023

Made with Cursor

GC builtins already lower via GcCollectCyclesRuntime on JIT/AOT; VM/JIT
compliance was blocked by untyped Node::$next (Mixed_ compile error).
Use AllowDynamicProperties like gc_collect_cycles_destruct.phpt and add
gc_jit.phpt covering toggle + cycle collection on JIT.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit c6f9289 into master Jun 13, 2026
@PurHur
PurHur deleted the agent/runtime-php-gc-jit-4023 branch June 13, 2026 19:28
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.

Stdlib: gc_disable/gc_enable/gc_enabled/gc_collect_cycles — JIT/AOT (ext/standard + Zend/zend_gc.c)

1 participant