runtime: add statement line caller frames#2002
Closed
cpunion wants to merge 18 commits into
Closed
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
831894f to
506555b
Compare
506555b to
a7f0383
Compare
This was referenced Jun 30, 2026
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.
Changes:
runtime.Caller,CallersFrames,FuncForPC,Func.FileLine, and stack paths.Local validation:
go test ./test/go -run 'TestRuntime(LineInfoAndStack|StatementLineInfo|FuncInfoConcurrentFirstUse)' -count=1llgo test -c github.com/goplus/llgo/test/go, then full compiledtest/gobinary:PASSgo test ./internal/build -run 'TestLinkedModuleGlobals|TestFuncInfoTable|TestPrepareFuncInfo|TestIsFuncInfoEnabled' -count=1go test ./cl -run TestFuncInfoMetadataEmission -count=1;go test ./internal/build/funcinfo -count=1;go test ./ssa -run 'TestClosureFuncDeclValue|TestClosureFuncPtrValue|TestDevLTOGlobalDCEFuncInfo' -count=1cl, andssatarget tests passed in the low-memory container.Benchmark methodology:
best / trimmed avg, usingnsorus; trimmed avg drops the min and max run from 11 process runs.currentis this PR.current+ltois this PR built with full LTO for comparison only; this PR does not change LTO defaults.maindoes not provide valid funcinfo for entry-PC or synthetic-PCFuncForPC/Func.FileLine, so those cells aren/a.MiB.Local macOS arm64 performance:
FuncForPConly4/4ns6/7ns4/4.2nsFunc.Nameonly10/10ns6/7ns4/4nsFuncForPC+Func.Name13/13.7ns7/7.1ns5/5nsFunc.FileLine9/9.9ns8/8ns5/5nsruntime.Caller(0)9.3/9.4us153/156.4ns44/45.9ns36/38.3nsruntime.Caller(1)5.9/5.9us171/173.6ns74/76.4ns61/62.7nsruntime.Callersonly13.6/13.7us123/126.9ns141/152.9ns134/140.3nsCallersFrames.Nextfirst frame21.3/21.5us267/270.6ns351/364.1ns306/313.2nsFuncForPC+Name13/13.3ns43/43.4ns33/34.4nsFunc.FileLine13/14.4ns45/46.2ns35/35.8nsLocal Linux arm64 performance:
FuncForPConly4/4ns7/7.8ns5/6.1nsFunc.Nameonly10/10ns6/6.9ns5/6nsFuncForPC+Func.Name13/13.6ns8/8ns6/6nsFunc.FileLine9/10.1ns8/8.8ns6/7nsruntime.Caller(0)1.3/1.3us164/168.4ns50/54.4ns40/47.8nsruntime.Caller(1)4.4/4.5us178/182.4ns90/100ns80/86.7nsruntime.Callersonly8.4/8.5us123/127.1ns160/182.2ns160/175.6nsCallersFrames.Nextfirst frame8.8/8.9us272/280.4ns440/446.7ns380/400nsFuncForPC+Name15/15ns52/54.7ns46/47.1nsFunc.FileLine14/14.9ns54/57.3ns48/48.9nsLocal macOS arm64 binary size:
1.83 MiB2.42 MiB2.24 MiB2.04 MiB1.59 MiB1.83 MiB2.42 MiB2.26 MiB2.04 MiB1.60 MiBLocal Linux arm64 binary size:
1.78 MiB4.26 MiB2.15 MiB2.07 MiB1.85 MiB1.78 MiB4.27 MiB2.15 MiB2.07 MiB1.86 MiBNotes:
CallersFrames/synthetic-PC fast path.