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

KarpelesLab / goro / 25354602159
13%

Build:
DEFAULT BRANCH: master
Ran 05 May 2026 02:29AM UTC
Jobs 1
Files 398
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

05 May 2026 02:27AM UTC coverage: 8.954% (+0.4%) from 8.556%
25354602159

push

github

MagicalTux
vm: inline closures + indirect calls (-21% on FunctionCalls)

Adds two opcodes that together unblock anonymous-closure
patterns common in real PHP (array_map, usort, ReactPHP-
style promise chains, …):

- OP_MAKE_CLOSURE A=index runs the *ZClosure template at
  SubClosures[A] via its AST Run() method. ZClosure.Run
  already does the right thing for both inline closures
  (dup + capture + Spawn) and named function declarations
  (RegisterFunction, returns null) — we just delegate to
  it from the bytecode level.
- OP_CALL_INDIRECT B=argc pops B args + a callable and
  invokes it. The callable is resolved at runtime via the
  new compiler.ResolveCallable helper which handles:
  - ZObject with __invoke (closures, invokable classes)
  - ZString function names
  - [object|class, method] array callables

The emitter also lowers *runnableFunctionCallRef to
OP_CALL_INDIRECT — that's the AST node used for $f() (call
through a variable) and similar shapes.

IsSlotSafe was too conservative for closures: anonymous
*ZClosure with no `use` captures is now slot-safe, while
*ZClosure with use captures or named *ZClosure (which
declares a global function) still mark the surrounding
scope unsafe. The closure construction code uses
ctx.OffsetCheck/OffsetGet to read captures, so the
hashtable mirror has to be live whenever there are use
captures.

Bench impact (vs. AST baseline):

  Arithmetic    -54%  (was -48%)
  Fibonacci     -18%
  ArrayOps      -31%  (was -12%)
  StringConcat  -17%  (was -22%, now -17% with noise)
  FunctionCalls -21%  (was +6% — biggest swing! function
                       declarations now compile through
                       OP_MAKE_CLOSURE rather than falling
                       back to AST)

phpt under GORO_VM=1: 16 regressions (was 25). Closure-
heavy tests that used to fail on the array_map / usort /
preg_replace_callback path now compile and run natively.

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

85 of 158 new or added lines in 6 files covered. (53.8%)

11 existing lines in 3 files now uncovered.

10280 of 114811 relevant lines covered (8.95%)

1063.67 hits per line

Uncovered Changes

Lines Coverage ∆ File
51
34.98
0.92% core/compiler/dispatch.go
13
60.87
8.37% core/vm/vmcompiler/emit_call.go
8
62.1
0.99% core/vm/vm.go
1
77.68
2.44% core/compiler/vmaccess.go

Coverage Regressions

Lines Coverage ∆ File
8
0.0
-2.8% core/compiler/compile-attributed.go
2
81.47
0.01% core/vm/vmcompiler/emit_expr.go
1
20.79
0.11% core/phpctx/global.go
Jobs
ID Job ID Ran Files Coverage
1 25354602159.1 05 May 2026 02:29AM UTC 398
8.95
GitHub Action Run
Source Files on build 25354602159
  • Tree
  • List 398
  • Changed 25
  • Source Changed 8
  • Coverage Changed 25
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25354602159
  • 404bbfc1 on github
  • Prev Build on master (#25341221200)
  • Next Build on master (#25354718639)
  • Delete
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