Skip to content

Stdlib: JIT set_error_handler / restore_error_handler (North Star 2) - #1932

Merged
PurHur merged 1 commit into
masterfrom
agent/stdlib-error-handler-jit
May 25, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/stdlib-error-handler-jit

Conversation

@PurHur

@PurHur PurHur commented May 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implement LLVM/JIT lowering for set_error_handler() and restore_error_handler() with compile-time string user-function callbacks (wave 3 Stdlib: set_error_handler() — VM + LLVM JIT/AOT #1379).
  • Add lib/AOT/runtime/phpc_error_handler.c and wire trigger_error() JIT path through __compiler_trigger_error → user handler dispatch.
  • Grow M2 spine smoke bundle by 2 units (JitErrorHandler, ErrorHandlerOutput) — 595/603 toward full inventory.
  • VM compliance unchanged; JIT PHPTs + ErrorHandlerJITTest added for when MCJIT runtime symbols resolve.

Closes #1379

North Star alignment

Supports #1492 / #1056 (self-host): error-handler builtins are no longer VM-only deferred in SelfHostBuiltinPolicy; spine includes new JIT leaf modules.

Test plan

  • vendor/bin/phpunit --filter ErrorHandler (VM PHPTs)
  • php bin/compile.php -l test/selfhost/compiler_lib_spine_smoke/main.php
  • ./script/ci-fast.sh --filter ErrorHandler in Docker (php-compiler:22.04-dev)
  • Full ./script/ci-local.sh (LLVM) on merge host

Made with Cursor

…1379)

Add native C runtime stack, LLVM lowering with compile-time string callbacks,
trigger_error dispatch via __compiler_trigger_error, M2 spine units (+2), and
compliance PHPTs. Closes #1379. Toward North Star 2 (#1492, #1056).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 7f3fcf8 into master May 25, 2026
@PurHur
PurHur deleted the agent/stdlib-error-handler-jit branch June 2, 2026 03:31
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: set_error_handler() — VM + LLVM JIT/AOT

1 participant