runtime: add Go-style funcinfo find index#2012
Closed
cpunion wants to merge 39 commits into
Closed
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 2, 2026
Bring over the cross-branch runtime funcinfo benchmark (hot, deep, multipkg, cold, stdlib scenarios) so xgo-dev#2012 can reproduce its own performance numbers. cold.FirstCallersFrames now walks to the first fully symbolized frame, because synthetic runtime frames (LLGo's runtime.Callers placeholder) carry no file/line and the metric was silently skipped on LLGo. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 2, 2026
Merged
cpunion
marked this pull request as ready for review
July 6, 2026 05:16
This was referenced Jul 6, 2026
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 6, 2026
…s; recover conformance Re-expresses the surviving value of xgo-dev#1882 on top of xgo-dev#2033 (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded): - Failed (non-comma-ok) type assertions panic with a real *runtime.TypeAssertionError built at runtime (TypeAssertError + missing-method lookup from abi tables) instead of a plain errorString; the recovered value implements runtime.Error, matching gc. The source-interface abi type is deliberately not materialized at the assert site: doing so can reference another package's private local-generic symbols (undefined at link); the message's interface name is the documented mdempsky/16 residual. - SIGBUS joins SIGSEGV in the fault-to-panic signal path (per-OS signal constants; darwin/linux). - goroot xfails retired, validated darwin go1.26 + go1.24: recover2.go, recover4.go, zerodivide.go, fixedbugs/issue73917.go, issue73920.go. - recover1.go stays xfailed with an updated reason (recursive-panic sub-call recover masking - Defer-node model follow-up); three ported tests covering the same class are t.Skip'ed with that pointer. - Golden CHECK updates: assert-failure sites now emit TypeAssertError+Panic; constants renumbered from actual IR. Supersedes xgo-dev#1882.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 8, 2026
Re-expresses xgo-dev#1906 on the xgo-dev#2023 base (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded by the stage-5 chain): - cl gains a liveness analysis for stack-allocated objects: allocas whose last use has passed are cleared so bdwgc's conservative stack scan stops keeping dead stack objects (and what they point to) alive; pointer registers are clobbered around the trigger points (llgo_clobber_pointer_regs) and dead stack slots holding the target are zeroed (llgo_clear_stack_ptr, pthread stack-bounds walk). - runtime.SetFinalizer paths (mfinal, runtime_gc, bdwgc binding) hook the cleared-slot machinery so finalizers for dead stack objects run. - xfail: retire deferfin.go, stackobj.go, stackobj3.go, validated on darwin/arm64 go1.24 + go1.26 (stackobj2 already passed). Carries the xgo-dev#2035 shared-GOCACHE commit temporarily (same patch-id, auto-dedups when the chain rebases after xgo-dev#2035 merges). Supersedes xgo-dev#1906.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 8, 2026
Bring over the cross-branch runtime funcinfo benchmark (hot, deep, multipkg, cold, stdlib scenarios) so xgo-dev#2012 can reproduce its own performance numbers. cold.FirstCallersFrames now walks to the first fully symbolized frame, because synthetic runtime frames (LLGo's runtime.Callers placeholder) carry no file/line and the metric was silently skipped on LLGo. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 8, 2026
Post-link table generation plan: parse the linked binary's metadata sections, dedup LTO inline copies against the symbol table, sort with a sentinel, build Go-layout findfunctab via internal/pclntab, and write back into a reserved section with ASLR-safe anchor offsets. Runtime adopts the prebuilt table when the header validates and keeps first-use construction as fallback. Includes the list of platform facts established in xgo-dev#2012 so implementation does not re-derive them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 8, 2026
…upport Re-expresses the surviving value of xgo-dev#1892 on the xgo-dev#2023 base (its other ~10k lines were an earlier draft of the funcinfo/pclntab machinery, since superseded by xgo-dev#2012/xgo-dev#2016/xgo-dev#2019): - //go:nointerface methods no longer satisfy interfaces: the pragma is recorded at import (cl/import.go -> Program.SetNoInterfaceMethod) and filtered out of abi uncommon method tables; GlobalDCE metadata takes the filtered selection list. Retires the typeparam/mdempsky/15 goroot xfails (validated go1.26 darwin, ci directive mode). - Type-assertion failure between same-named types from different scopes appends '(types from different scopes)' (gc wording). - MatchesClosure unwraps closure types on both sides, fixing assertions between closure and plain function types. - reflect.(*rtype).Method builds the method func value with the closure layout allocation (fixes reflect method-value identity). - xfail: retire fixedbugs/issue16130, fixedbugs/issue29735 (validated go1.24 + go1.26 darwin), and reword typeparam/mdempsky/16 - the panic value now implements runtime.Error; the message still lacks the source interface type and prints the command-line-arguments package path.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 8, 2026
Re-expresses xgo-dev#1918 on the xgo-dev#2023 base (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded by the stage-5 chain): - recover() only succeeds when called directly by a deferred function (gc semantics): the panic node records the owning Defer frame at rethrow (panicKey/panicNode + GoDeferData), and Recover checks the caller is that frame's direct deferred call. Closure wraps carry StartRecoverFrameAlias/EndRecoverFrame so method-value and closure adapters stay transparent to the ownership check. - Rethrow keeps the xgo-dev#2023 PanicTraceback hook on the unrecovered path. - xfail: retire fixedbugs/issue4066 (2m-timeout entries; now runs in ~2.7s), fixedbugs/issue73916 and issue73916b (go1.26 recover semantics), validated on darwin/arm64 go1.26. Supersedes xgo-dev#1918.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 8, 2026
…s; recover conformance Re-expresses the surviving value of xgo-dev#1882 on top of xgo-dev#2033 (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded): - Failed (non-comma-ok) type assertions panic with a real *runtime.TypeAssertionError built at runtime (TypeAssertError + missing-method lookup from abi tables) instead of a plain errorString; the recovered value implements runtime.Error, matching gc. The source-interface abi type is deliberately not materialized at the assert site: doing so can reference another package's private local-generic symbols (undefined at link); the message's interface name is the documented mdempsky/16 residual. - SIGBUS joins SIGSEGV in the fault-to-panic signal path (per-OS signal constants; darwin/linux). - goroot xfails retired, validated darwin go1.26 + go1.24: recover2.go, recover4.go, zerodivide.go, fixedbugs/issue73917.go, issue73920.go. - recover1.go stays xfailed with an updated reason (recursive-panic sub-call recover masking - Defer-node model follow-up); three ported tests covering the same class are t.Skip'ed with that pointer. - Golden CHECK updates: assert-failure sites now emit TypeAssertError+Panic; constants renumbered from actual IR. Supersedes xgo-dev#1882.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 8, 2026
Re-expresses xgo-dev#1906 on the xgo-dev#2023 base (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded by the stage-5 chain): - cl gains a liveness analysis for stack-allocated objects: allocas whose last use has passed are cleared so bdwgc's conservative stack scan stops keeping dead stack objects (and what they point to) alive; pointer registers are clobbered around the trigger points (llgo_clobber_pointer_regs) and dead stack slots holding the target are zeroed (llgo_clear_stack_ptr, pthread stack-bounds walk). - runtime.SetFinalizer paths (mfinal, runtime_gc, bdwgc binding) hook the cleared-slot machinery so finalizers for dead stack objects run. - xfail: retire deferfin.go, stackobj.go, stackobj3.go, validated on darwin/arm64 go1.24 + go1.26 (stackobj2 already passed). Carries the xgo-dev#2035 shared-GOCACHE commit temporarily (same patch-id, auto-dedups when the chain rebases after xgo-dev#2035 merges). Supersedes xgo-dev#1906.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 8, 2026
…upport Re-expresses the surviving value of xgo-dev#1892 on the xgo-dev#2023 base (its other ~10k lines were an earlier draft of the funcinfo/pclntab machinery, since superseded by xgo-dev#2012/xgo-dev#2016/xgo-dev#2019): - //go:nointerface methods no longer satisfy interfaces: the pragma is recorded at import (cl/import.go -> Program.SetNoInterfaceMethod) and filtered out of abi uncommon method tables; GlobalDCE metadata takes the filtered selection list. Retires the typeparam/mdempsky/15 goroot xfails (validated go1.26 darwin, ci directive mode). - Type-assertion failure between same-named types from different scopes appends '(types from different scopes)' (gc wording). - MatchesClosure unwraps closure types on both sides, fixing assertions between closure and plain function types. - reflect.(*rtype).Method builds the method func value with the closure layout allocation (fixes reflect method-value identity). - xfail: retire fixedbugs/issue16130, fixedbugs/issue29735 (validated go1.24 + go1.26 darwin), and reword typeparam/mdempsky/16 - the panic value now implements runtime.Error; the message still lacks the source interface type and prints the command-line-arguments package path.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 8, 2026
Re-expresses xgo-dev#1918 on the xgo-dev#2023 base (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded by the stage-5 chain): - recover() only succeeds when called directly by a deferred function (gc semantics): the panic node records the owning Defer frame at rethrow (panicKey/panicNode + GoDeferData), and Recover checks the caller is that frame's direct deferred call. Closure wraps carry StartRecoverFrameAlias/EndRecoverFrame so method-value and closure adapters stay transparent to the ownership check. - Rethrow keeps the xgo-dev#2023 PanicTraceback hook on the unrecovered path. - xfail: retire fixedbugs/issue4066 (2m-timeout entries; now runs in ~2.7s), fixedbugs/issue73916 and issue73916b (go1.26 recover semantics), validated on darwin/arm64 go1.26. Supersedes xgo-dev#1918.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 8, 2026
Re-expresses xgo-dev#1906 on the xgo-dev#2023 base (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded by the stage-5 chain): - cl gains a liveness analysis for stack-allocated objects: allocas whose last use has passed are cleared so bdwgc's conservative stack scan stops keeping dead stack objects (and what they point to) alive; pointer registers are clobbered around the trigger points (llgo_clobber_pointer_regs) and dead stack slots holding the target are zeroed (llgo_clear_stack_ptr, pthread stack-bounds walk). - runtime.SetFinalizer paths (mfinal, runtime_gc, bdwgc binding) hook the cleared-slot machinery so finalizers for dead stack objects run. - xfail: retire deferfin.go, stackobj.go, stackobj3.go, validated on darwin/arm64 go1.24 + go1.26 (stackobj2 already passed). Carries the xgo-dev#2035 shared-GOCACHE commit temporarily (same patch-id, auto-dedups when the chain rebases after xgo-dev#2035 merges). Supersedes xgo-dev#1906.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 8, 2026
…s; recover conformance Re-expresses the surviving value of xgo-dev#1882 on top of xgo-dev#2033 (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded): - Failed (non-comma-ok) type assertions panic with a real *runtime.TypeAssertionError built at runtime (TypeAssertError + missing-method lookup from abi tables) instead of a plain errorString; the recovered value implements runtime.Error, matching gc. The source-interface abi type is deliberately not materialized at the assert site: doing so can reference another package's private local-generic symbols (undefined at link); the message's interface name is the documented mdempsky/16 residual. - SIGBUS joins SIGSEGV in the fault-to-panic signal path (per-OS signal constants; darwin/linux). - goroot xfails retired, validated darwin go1.26 + go1.24: recover2.go, recover4.go, zerodivide.go, fixedbugs/issue73917.go, issue73920.go. - recover1.go stays xfailed with an updated reason (recursive-panic sub-call recover masking - Defer-node model follow-up); three ported tests covering the same class are t.Skip'ed with that pointer. - Golden CHECK updates: assert-failure sites now emit TypeAssertError+Panic; constants renumbered from actual IR. Supersedes xgo-dev#1882.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 9, 2026
…upport Re-expresses the surviving value of xgo-dev#1892 on the xgo-dev#2023 base (its other ~10k lines were an earlier draft of the funcinfo/pclntab machinery, since superseded by xgo-dev#2012/xgo-dev#2016/xgo-dev#2019): - //go:nointerface methods no longer satisfy interfaces: the pragma is recorded at import (cl/import.go -> Program.SetNoInterfaceMethod) and filtered out of abi uncommon method tables; GlobalDCE metadata takes the filtered selection list. Retires the typeparam/mdempsky/15 goroot xfails (validated go1.26 darwin, ci directive mode). - Type-assertion failure between same-named types from different scopes appends '(types from different scopes)' (gc wording). - MatchesClosure unwraps closure types on both sides, fixing assertions between closure and plain function types. - reflect.(*rtype).Method builds the method func value with the closure layout allocation (fixes reflect method-value identity). - xfail: retire fixedbugs/issue16130, fixedbugs/issue29735 (validated go1.24 + go1.26 darwin), and reword typeparam/mdempsky/16 - the panic value now implements runtime.Error; the message still lacks the source interface type and prints the command-line-arguments package path.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 9, 2026
Re-expresses xgo-dev#1918 on the xgo-dev#2023 base (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded by the stage-5 chain): - recover() only succeeds when called directly by a deferred function (gc semantics): the panic node records the owning Defer frame at rethrow (panicKey/panicNode + GoDeferData), and Recover checks the caller is that frame's direct deferred call. Closure wraps carry StartRecoverFrameAlias/EndRecoverFrame so method-value and closure adapters stay transparent to the ownership check. - Rethrow keeps the xgo-dev#2023 PanicTraceback hook on the unrecovered path. - xfail: retire fixedbugs/issue4066 (2m-timeout entries; now runs in ~2.7s), fixedbugs/issue73916 and issue73916b (go1.26 recover semantics), validated on darwin/arm64 go1.26. Supersedes xgo-dev#1918.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 9, 2026
…s; recover conformance Re-expresses the surviving value of xgo-dev#1882 on top of xgo-dev#2033 (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded): - Failed (non-comma-ok) type assertions panic with a real *runtime.TypeAssertionError built at runtime (TypeAssertError + missing-method lookup from abi tables) instead of a plain errorString; the recovered value implements runtime.Error, matching gc. The source-interface abi type is deliberately not materialized at the assert site: doing so can reference another package's private local-generic symbols (undefined at link); the message's interface name is the documented mdempsky/16 residual. - SIGBUS joins SIGSEGV in the fault-to-panic signal path (per-OS signal constants; darwin/linux). - goroot xfails retired, validated darwin go1.26 + go1.24: recover2.go, recover4.go, zerodivide.go, fixedbugs/issue73917.go, issue73920.go. - recover1.go stays xfailed with an updated reason (recursive-panic sub-call recover masking - Defer-node model follow-up); three ported tests covering the same class are t.Skip'ed with that pointer. - Golden CHECK updates: assert-failure sites now emit TypeAssertError+Panic; constants renumbered from actual IR. Supersedes xgo-dev#1882.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 9, 2026
Re-expresses xgo-dev#1906 on the xgo-dev#2023 base (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded by the stage-5 chain): - cl gains a liveness analysis for stack-allocated objects: allocas whose last use has passed are cleared so bdwgc's conservative stack scan stops keeping dead stack objects (and what they point to) alive; pointer registers are clobbered around the trigger points (llgo_clobber_pointer_regs) and dead stack slots holding the target are zeroed (llgo_clear_stack_ptr, pthread stack-bounds walk). - runtime.SetFinalizer paths (mfinal, runtime_gc, bdwgc binding) hook the cleared-slot machinery so finalizers for dead stack objects run. - xfail: retire deferfin.go, stackobj.go, stackobj3.go, validated on darwin/arm64 go1.24 + go1.26 (stackobj2 already passed). Carries the xgo-dev#2035 shared-GOCACHE commit temporarily (same patch-id, auto-dedups when the chain rebases after xgo-dev#2035 merges). Supersedes xgo-dev#1906.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 16, 2026
Re-expresses xgo-dev#1918 on the xgo-dev#2023 base (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded by the stage-5 chain): - recover() only succeeds when called directly by a deferred function (gc semantics): the panic node records the owning Defer frame at rethrow (panicKey/panicNode + GoDeferData), and Recover checks the caller is that frame's direct deferred call. Closure wraps carry StartRecoverFrameAlias/EndRecoverFrame so method-value and closure adapters stay transparent to the ownership check. - Rethrow keeps the xgo-dev#2023 PanicTraceback hook on the unrecovered path. - xfail: retire fixedbugs/issue4066 (2m-timeout entries; now runs in ~2.7s), fixedbugs/issue73916 and issue73916b (go1.26 recover semantics), validated on darwin/arm64 go1.26. Supersedes xgo-dev#1918.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 16, 2026
…s; recover conformance Re-expresses the surviving value of xgo-dev#1882 on top of xgo-dev#2033 (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded): - Failed (non-comma-ok) type assertions panic with a real *runtime.TypeAssertionError built at runtime (TypeAssertError + missing-method lookup from abi tables) instead of a plain errorString; the recovered value implements runtime.Error, matching gc. The source-interface abi type is deliberately not materialized at the assert site: doing so can reference another package's private local-generic symbols (undefined at link); the message's interface name is the documented mdempsky/16 residual. - SIGBUS joins SIGSEGV in the fault-to-panic signal path (per-OS signal constants; darwin/linux). - goroot xfails retired, validated darwin go1.26 + go1.24: recover2.go, recover4.go, zerodivide.go, fixedbugs/issue73917.go, issue73920.go. - recover1.go stays xfailed with an updated reason (recursive-panic sub-call recover masking - Defer-node model follow-up); three ported tests covering the same class are t.Skip'ed with that pointer. - Golden CHECK updates: assert-failure sites now emit TypeAssertError+Panic; constants renumbered from actual IR. Supersedes xgo-dev#1882.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 17, 2026
Re-expresses xgo-dev#1918 on the xgo-dev#2023 base (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded by the stage-5 chain): - recover() only succeeds when called directly by a deferred function (gc semantics): the panic node records the owning Defer frame at rethrow (panicKey/panicNode + GoDeferData), and Recover checks the caller is that frame's direct deferred call. Closure wraps carry StartRecoverFrameAlias/EndRecoverFrame so method-value and closure adapters stay transparent to the ownership check. - Rethrow keeps the xgo-dev#2023 PanicTraceback hook on the unrecovered path. - xfail: retire fixedbugs/issue4066 (2m-timeout entries; now runs in ~2.7s), fixedbugs/issue73916 and issue73916b (go1.26 recover semantics), validated on darwin/arm64 go1.26. Supersedes xgo-dev#1918.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 17, 2026
…s; recover conformance Re-expresses the surviving value of xgo-dev#1882 on top of xgo-dev#2033 (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded): - Failed (non-comma-ok) type assertions panic with a real *runtime.TypeAssertionError built at runtime (TypeAssertError + missing-method lookup from abi tables) instead of a plain errorString; the recovered value implements runtime.Error, matching gc. The source-interface abi type is deliberately not materialized at the assert site: doing so can reference another package's private local-generic symbols (undefined at link); the message's interface name is the documented mdempsky/16 residual. - SIGBUS joins SIGSEGV in the fault-to-panic signal path (per-OS signal constants; darwin/linux). - goroot xfails retired, validated darwin go1.26 + go1.24: recover2.go, recover4.go, zerodivide.go, fixedbugs/issue73917.go, issue73920.go. - recover1.go stays xfailed with an updated reason (recursive-panic sub-call recover masking - Defer-node model follow-up); three ported tests covering the same class are t.Skip'ed with that pointer. - Golden CHECK updates: assert-failure sites now emit TypeAssertError+Panic; constants renumbered from actual IR. Supersedes xgo-dev#1882.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 17, 2026
…upport Re-expresses the surviving value of xgo-dev#1892 on the xgo-dev#2023 base (its other ~10k lines were an earlier draft of the funcinfo/pclntab machinery, since superseded by xgo-dev#2012/xgo-dev#2016/xgo-dev#2019): - //go:nointerface methods no longer satisfy interfaces: the pragma is recorded at import (cl/import.go -> Program.SetNoInterfaceMethod) and filtered out of abi uncommon method tables; GlobalDCE metadata takes the filtered selection list. Retires the typeparam/mdempsky/15 goroot xfails (validated go1.26 darwin, ci directive mode). - Type-assertion failure between same-named types from different scopes appends '(types from different scopes)' (gc wording). - MatchesClosure unwraps closure types on both sides, fixing assertions between closure and plain function types. - reflect.(*rtype).Method builds the method func value with the closure layout allocation (fixes reflect method-value identity). - xfail: retire fixedbugs/issue16130, fixedbugs/issue29735 (validated go1.24 + go1.26 darwin), and reword typeparam/mdempsky/16 - the panic value now implements runtime.Error; the message still lacks the source interface type and prints the command-line-arguments package path.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 17, 2026
Re-expresses xgo-dev#1906 on the xgo-dev#2023 base (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded by the stage-5 chain): - cl gains a liveness analysis for stack-allocated objects: allocas whose last use has passed are cleared so bdwgc's conservative stack scan stops keeping dead stack objects (and what they point to) alive; pointer registers are clobbered around the trigger points (llgo_clobber_pointer_regs) and dead stack slots holding the target are zeroed (llgo_clear_stack_ptr, pthread stack-bounds walk). - runtime.SetFinalizer paths (mfinal, runtime_gc, bdwgc binding) hook the cleared-slot machinery so finalizers for dead stack objects run. - xfail: retire deferfin.go, stackobj.go, stackobj3.go, validated on darwin/arm64 go1.24 + go1.26 (stackobj2 already passed). Carries the xgo-dev#2035 shared-GOCACHE commit temporarily (same patch-id, auto-dedups when the chain rebases after xgo-dev#2035 merges). Supersedes xgo-dev#1906.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 18, 2026
Re-expresses xgo-dev#1918 on the xgo-dev#2023 base (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded by the stage-5 chain): - recover() only succeeds when called directly by a deferred function (gc semantics): the panic node records the owning Defer frame at rethrow (panicKey/panicNode + GoDeferData), and Recover checks the caller is that frame's direct deferred call. Closure wraps carry StartRecoverFrameAlias/EndRecoverFrame so method-value and closure adapters stay transparent to the ownership check. - Rethrow keeps the xgo-dev#2023 PanicTraceback hook on the unrecovered path. - xfail: retire fixedbugs/issue4066 (2m-timeout entries; now runs in ~2.7s), fixedbugs/issue73916 and issue73916b (go1.26 recover semantics), validated on darwin/arm64 go1.26. Supersedes xgo-dev#1918.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 18, 2026
Re-expresses xgo-dev#1918 on the xgo-dev#2023 base (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded by the stage-5 chain): - recover() only succeeds when called directly by a deferred function (gc semantics): the panic node records the owning Defer frame at rethrow (panicKey/panicNode + GoDeferData), and Recover checks the caller is that frame's direct deferred call. Closure wraps carry StartRecoverFrameAlias/EndRecoverFrame so method-value and closure adapters stay transparent to the ownership check. - Rethrow keeps the xgo-dev#2023 PanicTraceback hook on the unrecovered path. - xfail: retire fixedbugs/issue4066 (2m-timeout entries; now runs in ~2.7s), fixedbugs/issue73916 and issue73916b (go1.26 recover semantics), validated on darwin/arm64 go1.26. Supersedes xgo-dev#1918.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 18, 2026
…s; recover conformance Re-expresses the surviving value of xgo-dev#1882 on top of xgo-dev#2033 (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded): - Failed (non-comma-ok) type assertions panic with a real *runtime.TypeAssertionError built at runtime (TypeAssertError + missing-method lookup from abi tables) instead of a plain errorString; the recovered value implements runtime.Error, matching gc. The source-interface abi type is deliberately not materialized at the assert site: doing so can reference another package's private local-generic symbols (undefined at link); the message's interface name is the documented mdempsky/16 residual. - SIGBUS joins SIGSEGV in the fault-to-panic signal path (per-OS signal constants; darwin/linux). - goroot xfails retired, validated darwin go1.26 + go1.24: recover2.go, recover4.go, zerodivide.go, fixedbugs/issue73917.go, issue73920.go. - recover1.go stays xfailed with an updated reason (recursive-panic sub-call recover masking - Defer-node model follow-up); three ported tests covering the same class are t.Skip'ed with that pointer. - Golden CHECK updates: assert-failure sites now emit TypeAssertError+Panic; constants renumbered from actual IR. Supersedes xgo-dev#1882.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 19, 2026
Re-expresses xgo-dev#1918 on the xgo-dev#2023 base (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded by the stage-5 chain): - recover() only succeeds when called directly by a deferred function (gc semantics): the panic node records the owning Defer frame at rethrow (panicKey/panicNode + GoDeferData), and Recover checks the caller is that frame's direct deferred call. Closure wraps carry StartRecoverFrameAlias/EndRecoverFrame so method-value and closure adapters stay transparent to the ownership check. - Rethrow keeps the xgo-dev#2023 PanicTraceback hook on the unrecovered path. - xfail: retire fixedbugs/issue4066 (2m-timeout entries; now runs in ~2.7s), fixedbugs/issue73916 and issue73916b (go1.26 recover semantics), validated on darwin/arm64 go1.26. Supersedes xgo-dev#1918.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 19, 2026
…s; recover conformance Re-expresses the surviving value of xgo-dev#1882 on top of xgo-dev#2033 (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded): - Failed (non-comma-ok) type assertions panic with a real *runtime.TypeAssertionError built at runtime (TypeAssertError + missing-method lookup from abi tables) instead of a plain errorString; the recovered value implements runtime.Error, matching gc. The source-interface abi type is deliberately not materialized at the assert site: doing so can reference another package's private local-generic symbols (undefined at link); the message's interface name is the documented mdempsky/16 residual. - SIGBUS joins SIGSEGV in the fault-to-panic signal path (per-OS signal constants; darwin/linux). - goroot xfails retired, validated darwin go1.26 + go1.24: recover2.go, recover4.go, zerodivide.go, fixedbugs/issue73917.go, issue73920.go. - recover1.go stays xfailed with an updated reason (recursive-panic sub-call recover masking - Defer-node model follow-up); three ported tests covering the same class are t.Skip'ed with that pointer. - Golden CHECK updates: assert-failure sites now emit TypeAssertError+Panic; constants renumbered from actual IR. Supersedes xgo-dev#1882.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 20, 2026
Re-expresses xgo-dev#1918 on the xgo-dev#2023 base (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded by the stage-5 chain): - recover() only succeeds when called directly by a deferred function (gc semantics): the panic node records the owning Defer frame at rethrow (panicKey/panicNode + GoDeferData), and Recover checks the caller is that frame's direct deferred call. Closure wraps carry StartRecoverFrameAlias/EndRecoverFrame so method-value and closure adapters stay transparent to the ownership check. - Rethrow keeps the xgo-dev#2023 PanicTraceback hook on the unrecovered path. - xfail: retire fixedbugs/issue4066 (2m-timeout entries; now runs in ~2.7s), fixedbugs/issue73916 and issue73916b (go1.26 recover semantics), validated on darwin/arm64 go1.26. Supersedes xgo-dev#1918.
cpunion
added a commit
to cpunion/llgo
that referenced
this pull request
Jul 20, 2026
…s; recover conformance Re-expresses the surviving value of xgo-dev#1882 on top of xgo-dev#2033 (its remaining ~11k diff lines were the pre-xgo-dev#2012 funcinfo draft, superseded): - Failed (non-comma-ok) type assertions panic with a real *runtime.TypeAssertionError built at runtime (TypeAssertError + missing-method lookup from abi tables) instead of a plain errorString; the recovered value implements runtime.Error, matching gc. The source-interface abi type is deliberately not materialized at the assert site: doing so can reference another package's private local-generic symbols (undefined at link); the message's interface name is the documented mdempsky/16 residual. - SIGBUS joins SIGSEGV in the fault-to-panic signal path (per-OS signal constants; darwin/linux). - goroot xfails retired, validated darwin go1.26 + go1.24: recover2.go, recover4.go, zerodivide.go, fixedbugs/issue73917.go, issue73920.go. - recover1.go stays xfailed with an updated reason (recursive-panic sub-call recover masking - Defer-node model follow-up); three ported tests covering the same class are t.Skip'ed with that pointer. - Golden CHECK updates: assert-failure sites now emit TypeAssertError+Panic; constants renumbered from actual IR. Supersedes xgo-dev#1882.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stage 1 of #2004. Successors build on this branch: #2016 (link-phase prebuilt table), #2019 (FP unwinder), #2023 (acceptance & conformance) — each contains its predecessors until merged.
Implements the runtime funcinfo path on top of current
xgo-dev/main, moving LLGo toward Go'spclntab/findfunctabmodel while keeping the metadata DCE-safe, plus the optimization round that followed review: Mach-O site sections, cold-path elimination, uint16 find index, Caller/Callers memoization, Frames.Next allocation removal, and debug-build gating.Changes
runtime.Caller,runtime.CallersFrames,runtime.FuncForPC,Func.FileLine.internal/pclntab: LLVM-independent faithful port of Go'sfindfunctabalgorithm (uint8 deltas, overflow error, forward scan, sentinel), kept as the reference for link-phase work.__DATA,__llgo_fie/__llgo_stub/__llgo_pcl,live_support, one linker-private atom symbol per record,section$start$boundaries with the\x01verbatim-name prefix): under ld64/lld-dead_stripa record survives exactly when its function is live — same semantics ELF gets fromSHF_LINK_ORDERwith--gc-sections. macOS previously had no sites at all and fell back to one dlsym per function+stub on first use (13ms cold), and had no statement-level line info.Caller/Callersmemoize interned synthetic PCs in shadow-stack slots (invalidated on line change);Frames.Nextreuses the FuncForPC 4-way cache instead of allocating a*Funcper frame.LLGO_DEBUG/LLGO_DEBUG_SYMBOLS) keep the funcinfo tables but drop the body-embedded site records — the in-body asm anchors shift instruction/scope layout enough to confuse debuggers (LLDB suite now 194/194).runtime.Calleris unaffected (instrumentation is independent);FuncForPC(entry)/FileLine(entry)work via the dlsym fallback; statement/call-site line granularity is disabled in debug builds.LLGO_FUNCINFO_DEBUG=1prints per-tableframes/buckets/index=built|fallback/entries=sites|dlsymso benchmarks can prove which path they measured.LLGO_FUNCINFO_SITES=0keeps tables but drops all site asm (see Known limitations).Benchmarks (final HEAD, 5–7 runs, best/trimmed avg)
macOS arm64 (host) and Linux arm64 (container);
main= merge base; 576 target functions (24 pkgs × 24 methods). Index proof:LLGO_FUNCINFO_DEBUG=1reportsindex=builtfor func and pcline tables in all measured scenarios.¹ One-time per process; shows up in whichever
cold.First*window exhausts the cold-lookup budget (platform-dependent). Go needs none because its linker ships the sorted table — this is the link-phase follow-up.² Shadow-stack instrumentation tax; the
mainbaseline is equally behind Go (18–20µs), not introduced by this PR — unwinder follow-up.Scope of the comparison:
FileLineManycompares LLGo's statement/call-site granularity against Go's dense per-instruction pcvalue tables; "faster than Go" holds for this granularity, not for full pcvalue semantics.Scaling: per-target batch cost is flat from 144 → 576 targets (6.5 → 6.8ns per FuncForPC target, LTO ~1.9ns), consistent with the bucket index.
Binary size and build time (
main→ this PR)Composition (stdlib, +660KB): strings ~270KB (content-deduped, comparable density to Go's funcnametab), stub sites 115KB, entry sites 70KB, records+symbol-index+hash ~156KB, pcline <5KB. Anchor: the same program's Go
__gopclntabis 1.41MB — this PR's total metadata is ~47% of Go's equivalent structure. Build time +2–5% (non-LTO), +8–17% (LTO).Impact on ordinary code (no runtime introspection)
Pure-compute benchmark (json/sort/map/fib), interleaved runs. Narrow A/B via
LLGO_FUNCINFO_SITES=0(tables kept, only in-body site asm removed):sites-off ≈ mainwithin noise on every metric: the metadata tables have zero runtime impact; all perturbation comes from the body-embedded volatile asm, in both directions. Go does not have this problem — its pclntab is generated by the linker and never enters the optimizer. Against Go, ordinary-code performance is dominated by the LLGo baseline (json 2.3×, sort 4.9×, map 3.1× slower on bothmainand this PR; fib 39% faster) — funcinfo's ±5% is second-order there.Known limitations / follow-ups
ftab/findfunctabgeneration — design doc indoc/design/pclntab-linkphase.md,internal/pclntabis the ready algorithm base.frames 5726 → 15106at 576 targets; ELF section 4.1×), registering host-function PCs under the inlinee's symbol ID; runtime only consults the table when native symbolization fails, which bounds the impact. IR-level fixes were tried and ruled out (!associatedis linker-GC-only and GlobalDCE deletes the records;llvm.compiler.usedpins dead functions;noduplicateblocks inlining) — dedup is link-phase work;!pcsectionsmetadata is the candidate replacement for the asm mechanism (also removes the codegen perturbation above).main+LTO binaries fail at runtime on macOS in this harness; this PR's LTO passes all scenarios (root cause of the baseline failure not investigated here).Local validation
macOS arm64 + Linux arm64 container:
go test ./cl(full),go test ./internal/build ./internal/pclntab ./ssa,LLGO_ROOT=... go test ./test/go -run TestRuntime...,bash _lldb/runtest.sh(194/194),go fmt/go vetclean. Benchmark harness included underbenchmark/runtime_funcinfo(reproduces all numbers above).