← All docs

debug_backtrace() - internals

Compiler internals for debug_backtrace(): lowering path, type checks, and runtime helpers.

debug_backtrace() - internals

Where it lives

Lowering notes

  • Uses the eir_primitive strategy from the single-source builtin descriptor.
  • Emits backend-neutral EIR primitives or a small EIR graph through BuiltinLoweringContext.

Semantic descriptor

  • Target strategy: eir_primitive
  • Validation: checker_hook
  • Result type source: checked
  • Result ownership: fresh
  • Effects: static (7 declared effects)
  • Requirements: static (0 requirements)
  • Callable policy: dynamic
  • Target support: macos-aarch64, ios-arm64, ios-sim-arm64, linux-aarch64, linux-x86_64

EIR and runtime boundary

  • Typed EIR target: descriptor-emitted EIR primitives or graph; no opaque builtin call remains.

Signature summary

function debug_backtrace(int $options = 1, int $limit = 0): array

What the type checker enforces

  • Arity: takes 0–2 arguments (2 optional).

Eval interpreter (magician)

Cross-references