]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/compile/internal/inline/inlheur/callsite.go
cmd/compile/internal/inline: rework call scoring for non-inlinable funcs
[gostls13.git] / src / cmd / compile / internal / inline / inlheur / callsite.go
index 0ec7c521836ac8103f8c7088a9b33b1b43911683..d62215cb37cf7cbb9fd04a61e7bd249430d6c5b6 100644 (file)
@@ -41,9 +41,6 @@ type CallSite struct {
 // with many calls that share the same auto-generated pos.
 type CallSiteTab map[*ir.CallExpr]*CallSite
 
-// Package-level table of callsites.
-var cstab = CallSiteTab{}
-
 type CSPropBits uint32
 
 const (
@@ -90,7 +87,7 @@ func fmtFullPos(p src.XPos) string {
        return sb.String()
 }
 
-func encodeCallSiteKey(cs *CallSite) string {
+func EncodeCallSiteKey(cs *CallSite) string {
        var sb strings.Builder
        // FIXME: maybe rewrite line offsets relative to function start?
        sb.WriteString(fmtFullPos(cs.Call.Pos()))
@@ -101,7 +98,7 @@ func encodeCallSiteKey(cs *CallSite) string {
 func buildEncodedCallSiteTab(tab CallSiteTab) encodedCallSiteTab {
        r := make(encodedCallSiteTab)
        for _, cs := range tab {
-               k := encodeCallSiteKey(cs)
+               k := EncodeCallSiteKey(cs)
                r[k] = propsAndScore{
                        props: cs.Flags,
                        score: cs.Score,