Skip to content

AOT-safe UndefinedVariableJitHelper guards without broken LLVM bridge (#10360) #10524

Description

@PurHur

Strategic pillar

Pillar 4 Correctness — UndefinedVariable guards (#10360), AOT-safe

Aligns with #10533 compiler excellence map.

Priority

P2 — after #10523 merged; do not block initial AOT/web gate restore

Problem

Forward-porting #10360 / UndefinedVariableJitHelper compiled LLVM bridge breaks examples-aot-smoke (module verify on 000-HelloWorld).

Symptoms during phpc build:

  • Global is referenced by parentless instruction (@__value__readString, @phpc_scope_var_init_*)
  • Function return type does not match operand type of return inst
  • Incorrect arg count on undefinedvariablejithelper__emitWarning

Root causes (triaged)

  1. Compiled helper bridge passes (i8*, i32) but PHP emitWarning(string) expects __string__*.
  2. UndefinedVariableRuntime::ensureStandaloneBodies duplicated StringTriggerErrorJit::implement during standalone init (corrupts module).
  3. Nested helper compile without isolation pollutes outer CFG maps (fixed by NestedJitCompileScope in Fix AOT smoke: nested JIT helper compile isolation (#10343) #10498).

Safe interim approach (works for guards)

  • JIT guards call UndefinedVariableRuntime::emitWarningForName() → UndefinedVariableJitHelper::warningMessage() SSOT + __compiler_trigger_error.
  • Do not compile UndefinedVariableJitHelper.php into the standalone module until bridge signatures are correct.
  • Do not register UndefinedVariableRuntime::ensureStandaloneBodies in Context (StringTriggerError already linked).

Done when

  • Guards enabled on master with AOT + VM parity tests green
  • Optional: php-in-PHP emitWarning LLVM bridge with correct __string__* arg (or drop bridge if unused)
  • examples-aot-smoke + UndefinedVariableRuntimeShrinkTest + compliance cases pass

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions