Skip to content

M3 emit-TU: restore Runtime spine pre-lower + RuntimeEmitTuInit (#2552) - #2562

Merged
PurHur merged 2 commits into
masterfrom
fix/m3-emit-tu-spine-restore-2552
May 26, 2026
Merged

PurHur merged 2 commits into
masterfrom
fix/m3-emit-tu-spine-restore-2552

Conversation

@PurHur

@PurHur PurHur commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Restore compileM3EmitTuRuntimeSpineMethodsForRealLowering / compileM3EmitTuRuntimeMethodFromModules (with lib/Runtime.php fallback) dropped during the Fix M3 emit-TU Runtime parse spine binding (#2550) #2557 merge — fixes failing BootstrapRuntimeCompileSmokeTest on master.
  • Land Self-host M3: bootstrap-m3-emit-tu-execute.sh green (emit helper run, no Zend) #2552 wiring: RuntimeEmitTuInit, allocateEmitTuShell property defaults, phpcompiler\runtime::* spine mangling, make bootstrap-m3-emit-tu-execute, and default PHP_COMPILER_M3_COMPILE_DRIVER=1 in bootstrap-m3-emit-tu-execute.sh.
  • Register parseandcompile native decls before {main} emit IR (avoids undefined phpcompiler_runtime__parseandcompile at link).

Gate status

Closes #2552 (spine wiring); tracks remaining execute green in #2442 / #2444.

Test plan

  • vendor/bin/phpunit test/unit/BootstrapRuntimeCompileSmokeTest.php
  • ./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && ./script/bootstrap-m3-emit-tu-execute.sh' (link OK; execute documents parseAndCompile null)

Made with Cursor

PurHur and others added 2 commits May 26, 2026 20:28
Wire bootstrap-m3-emit-tu-execute.sh to PHP_COMPILER_M3_COMPILE_DRIVER,
add RuntimeEmitTuInit (C-floor initVmContext + init* calls), fix spine
symbol naming to phpcompiler\runtime::*, and pre-lower init methods from
declare_class blocks. Emit helper links and runs without segfault; native
parseAndCompile still returns null (phase=parseAndCompile) — next: bind
real parse/compileEmitSmoke lowering in emit TU.

Co-authored-by: Cursor <cursoragent@cursor.com>
Re-add compileM3EmitTuRuntimeMethodFromModules (lib/Runtime.php fallback), RuntimeEmitTuInit for emit-helper alloc, and register parseandcompile native decls before {main} emit IR. Default PHP_COMPILER_M3_COMPILE_DRIVER=1 in bootstrap-m3-emit-tu-execute.sh; fixes BootstrapRuntimeCompileSmokeTest regression on master.

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.

Self-host M3: bootstrap-m3-emit-tu-execute.sh green (emit helper run, no Zend)

1 participant