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

KarpelesLab / goro / 25322649549
13%

Build:
DEFAULT BRANCH: master
Ran 04 May 2026 01:47PM UTC
Jobs 1
Files 390
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

04 May 2026 01:46PM UTC coverage: 5.803% (+0.2%) from 5.579%
25322649549

push

github

MagicalTux
vm: dispatch closure bodies through the bytecode VM

Closure bodies (top-level functions, anonymous closures,
arrow fns) now optionally compile to bytecode and dispatch
through the VM instead of the AST tree-walker.

Wiring:
- New core/vm/ClosureBody wraps a *vm.Function as a Runnable
  that translates an OpRet result into a *phperr.PhpReturn
  error so ZClosure.callBody picks it up via CatchReturn —
  zero changes to the existing return / exception flow.
- core/compiler/vmaccess.go exposes two hook variables
  (TryBuildVMClosureBody, TryBuildVMScript) plus a public
  IsVMCompiled helper for tests.
- core/vm/vmcompiler/register.go installs both hooks at init
  and reads GORO_VM=1 to gate them. SetEnabled(bool) lets
  tests/benchmarks toggle at runtime.
- All five SAPIs blank-import the vmcompiler package so the
  hooks are registered.
- collectStaticVars unwraps ClosureBody.Inner() so static-var
  collection still works (it would no-op anyway today since
  static-var-using bodies fall back to AST).

Bench impact (vs. AST-only baseline, per-iter):
  Fibonacci (recursion-heavy):  -20% CPU  (27.3M -> 21.1M ns)
  Arithmetic (binop-heavy):     -20% CPU  (43.8M -> 35.1M ns)
  FunctionCalls:                flat
  ArrayOps:                     -5% CPU  (foreach falls back)
  StringConcat:                 flat
The Fibonacci win comes from OpRet returning the value
directly — no per-call PhpReturn allocation. Arithmetic
benefits from the tight loop dispatch staying in one Go frame.

Allocs are slightly higher under VM in two benches; the VM's
stack scratch buffer is the main cause. A pool for those
buffers is a follow-up.

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

60 of 82 new or added lines in 6 files covered. (73.17%)

519 existing lines in 9 files now uncovered.

6582 of 113417 relevant lines covered (5.8%)

642.74 hits per line

Uncovered Changes

Lines Coverage ∆ File
10
44.44
core/vm/closure_body.go
5
83.33
core/vm/vmcompiler/register.go
3
4.53
0.16% core/compiler/closure.go
2
47.34
1.81% core/compiler/compile.go
2
78.72
1.58% core/compiler/vmaccess.go

Coverage Regressions

Lines Coverage ∆ File
391
7.62
0.33% core/compiler/compile-func.go
45
47.34
1.81% core/compiler/compile.go
45
0.0
0.0% sapi/php-test/main.go
12
0.0
0.0% sapi/php-cli/main.go
9
78.72
1.58% core/compiler/vmaccess.go
8
4.53
0.16% core/compiler/closure.go
4
0.0
0.0% sapi/php-httpd/main.go
3
0.0
0.0% sapi/php-fpm/main.go
2
0.0
0.0% sapi/php-cgi/main.go
Jobs
ID Job ID Ran Files Coverage
1 25322649549.1 04 May 2026 01:47PM UTC 390
5.8
GitHub Action Run
Source Files on build 25322649549
  • Tree
  • List 390
  • Changed 21
  • Source Changed 9
  • Coverage Changed 21
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25322649549
  • 5247fee4 on github
  • Prev Build on master (#25322184655)
  • Next Build on master (#25323398578)
  • 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