Skip to content

Language: class const object expressions JIT/AOT (#4021) - #4046

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-4021-class-const-object-jit-aot
Jun 1, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-4021-class-const-object-jit-aot

Conversation

@PurHur

@PurHur PurHur commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Materialize PHP 8.3 class constants with new object expressions as immortal module-global __object__* singletons in __init__ (allocateClassConstantObject, non-refcounted header, no GC registration).
  • php-src reference: Zend/zend_compile.c — zend_compile_const_expr; Zend/zend_constants.c — persistent constant values.
  • Capability row class_const_object: VM/JIT/AOT yes; JIT MCJIT execute remains harness-unstable (CI: Run JIT compliance tests in CI (fix LLVM skip in PHPUnit) #98) — guarded by ClassConstObjectJitCompileTest (LLVM module verify).

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php test/compliance/cases/language/class_const_object_run.php'
# 1\n1\n

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/compile.php -o /tmp/cco test/compliance/cases/language/class_const_object_run.php && /tmp/cco'
# 1\n1\n

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter ClassConstObjectJitCompileTest'
# OK (1 test, 4 assertions)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter "VMTest::testCases.*class_const_object|AotTest::testCases.*class_const_object"'
# OK (2 tests, 6 assertions)

Closes #4021

Made with Cursor

…4021)

Materialize PHP 8.3 object class constants as non-refcounted module globals
in __init__ via allocateClassConstantObject(); AOT fixture and LLVM verify test.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit ac61d28 into master Jun 1, 2026
@PurHur
PurHur deleted the agent/issue-4021-class-const-object-jit-aot branch June 1, 2026 17:19
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.

Language: class const object expressions JIT/AOT — shared identity (phase 2 of #3196)

1 participant