• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

KarpelesLab / goro / 25337588561

04 May 2026 07:00PM UTC coverage: 8.284% (+0.3%) from 7.969%
25337588561

push

github

MagicalTux
vm: native throw, improved object method dispatch

Adds:
- OP_THROW + throwNode emitter case (runnableThrow). Pops
  the operand and routes through phpobj.ThrowObject. Lets
  VM-compiled functions throw exceptions that AST-level
  try/catch wrappers (or AST callers) can catch normally.
- compiler.CallInstanceMethod public helper. Mirrors the
  AST runObjectFunc.Run dispatch: abstract check,
  private/protected visibility against ctx.Class(),
  __call fallback when inaccessible, late-static binding
  for static methods. The VM's OP_OBJECT_CALL now routes
  through this so visibility errors fire for VM-compiled
  call sites just like the AST path.
- runNoDiscardStatement unwrap in emitStmt — the wrapper
  exists to attach a #[NoDiscard] post-call warning; the
  VM's call path doesn't yet preserve it, but unwrapping
  lets the inner call statement still get VM-compiled.
  Loss: VM-compiled call sites won't fire the NoDiscard
  warning. Acceptable for now.

Property write ($obj->prop = value) was attempted but
deferred: subtle interactions with typed properties,
hooks, and backtrace info don't yet match the AST
WriteValue path. Falls back to AST per-function.

phpt suite under GORO_VM=1 has ~20 known regressions, all
of them the kind that come from value-based VM dispatch:
by-ref parameter passing (the VM passes pre-evaluated
ZVals; the AST passes Runnables and binds Writables for
&\$x), backtrace file/line info for nested calls, and
GMP object identity in chained operations. Out of 12k+
tests these are <0.2%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

37 of 161 new or added lines in 7 files covered. (22.98%)

7 existing lines in 2 files now uncovered.

9480 of 114432 relevant lines covered (8.28%)

895.66 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

14.11
/core/phpobj/zobject.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc