Go 1.17
Register-based ABI on amd64. The dev.regabi split of the compiler into packages. dev.typeparams: types2, -G, irgen and first stenciling, all off by default. Pacer extracted into gcControllerState. unsafe.Add/unsafe.Slice. Slice-to-array-pointer conversion. windows/arm64. go/defer wrapped into closures.
Each area lists the stage every thread reached in this release (with what was left open afterwards), then changes that are not part of a thread. Thread names link to the full thread on its topic page.
Memory management
From Memory management: GC and allocator (Go 1.0–1.17)
Pacer extracted into mgcpacer.go as gcControllerState, sweep completion unified, incremental arena preparation, stack-object GC data only.
- Concurrent sweep and proportional sweep — Done: sweep completion unified:
runtime.GCnow blocks on all sweep paths (a25a77aed2,1b736b3c19). Left open: nothing noted. - GC pacer: trigger controller, assists and background utilisation — Done: pacer extracted into
mgcpacer.gowithgcControllerStatemethods (f5f7647107,f2d5bd1ad3,728e3dc6f9,2d4ba2601b,9bce7b70fd,e7ab1a5ba8,7ec7a3cf33,e9cc31e736), minimum scavenge fraction constant fixed (14ade57ab8). Left open: the trigger-ratio model itself; this refactor is the preparation for the 1.18 pacer redesign. - Stack scanning: conservative, precise by frames, stack barriers, hybrid barrier, async safe points — Done: stack-object metadata emits only GC data instead of the full type descriptor, avoiding keeping the descriptor and everything it references alive (
02ab8d1a1d); GC testing helpers for moving stacks (4e1bf8ed38,97b3ce430b,41e8a9f1cf). Left open: nothing noted. - Precise heap scanning: type information, the heap bitmap and GC programs — Done:
scanobjecthbits advance folded into the loop (72483de87a). Left open: nothing noted. - Size classes, tiny allocator and mcache/mcentral — Done: simplified divmagic (
4662029264), alignment doc fix (a8a85281ca), tiny allocs top-aligned in race mode (2c05ba4ae0), large clears broken into chunks so preemption can occur (0bbfc5c31e). Left open: “huge” clears remain non-preemptible while a single clear runs (explicit in the commit message: zeroed by chunks “so that preemption can occur”). - The bitmap page allocator — Done: arenas prepared incrementally via
sysMapingrowfor strict-overcommit systems (bd6aeca968),pageAllochandlessysAllocfailures (0e8a72b62e). Left open: nothing noted. - Scavenger: returning memory to the OS — Done:
scavengePercentmin fraction constant fix (14ade57ab8). Left open: the 1.18 redesign (controller-paced) follows. - Heap address space: contiguous arena to sparse arenas — Done: incremental arena preparation, 4 MiB arenas on iOS (
bd6aeca968,e03cca6407). Left open: nothing noted. - Finalizers and span specials — Done: register-ABI finalizers (
f009b5b226), abstracted specials list iteration (1ef114d12c). Left open: nothing noted. - Mark work distribution: parfor, work buffers, gcWork and root jobs — Done: root bases computed in
gcMarkRootPrepare(82e4a6310b),nFlushCacheRootsremoved (94817890c2). Left open: nothing noted. - Memory statistics and accounting — Done: internal pacing stats moved into
gcController(f2d5bd1ad3). Left open: nothing noted. - Allocation-site profiling and GC debugging modes — Done:
clobberdeadcheck in GC (0ccdcb2102), GC testing helpers (4e1bf8ed38). Left open: nothing noted.
Other changes
- Misc internal — regabi finalizers,
clobberdead,KeepAlivedoc warning that it is not anunsafe.Pointerworkaround (fd45e267c2), formatting (e224787fef,d434c2338b,8a4b7294af). - Alignment info in sizeclasses comments internal — Added alignment information to the sizeclasses.go comments. (
735647d92e)
Scheduler and concurrency
From Scheduler and concurrency runtime (Go 1.0–1.17)
Value.Swap/CompareAndSwap, findrunnable refactors and spinning documentation ahead of 1.18, runqdrain, Pool random stealing; threads: scheduler core, atomics, Pool.
- The G-M-P scheduler: from global-lock M:N to per-P run queues, spinning Ms and work stealing — Done: findrunnable refactoring in preparation for the 1.18 spinning rework: work stealing in its own function
60ab197bc2, spinning coordination documented13368ab56a, timer and spinning rechecks reorderedf6e7fe2711,dbade774c3,4d56576ec0,tryWakePremoved800fb11efb;runqdrainfor GC workersfbb600b283/3b304ce7fe; gFree lists moved in batches between P and global1f7a01459b; pidleget/pidleput under sched.lock2520e72d3b;exitsyscall0racee0d029f758;pstruct padding55d7dcc3cd. Left open: the findrunnable commit messages cite #43997 and #44313 (spinning M races) as unresolved. - Preemption: cooperative stack-check preemption (1.2) to signal-based asynchronous preemption (1.14) — Done:
R15saved before checking AVX statec49c7a675a; SPWRITE functions in traceback accounted for (not async-preempted since assembly functions never are)03886707f9; preemption disabled inaddtimeraa26687e45. - Network poller: from the netFD select loop to the runtime-integrated epoll/kqueue/IOCP poller — Done: netpollopen error handled in
poll_runtime_pollOpenebb92dfed9, netpollclose documented437d229e2a, pollDesc lock partial edgese8e425cb23,0e0a872a761.16. - Timers: timerproc goroutine → per-bucket heaps → timers on Ps — Done: findrunnable timer computation moved
f6e7fe2711;adjustTimerscounter removedbfbb288574,798ec73519; addtimer without preemptionaa26687e45;time.nowin assembly on linux/amd64d09947522dwith walltime removed42953bc9f5,b15372f39b,c96fec9036. - sync.Pool — Done: random victim selection when stealing
d5d24dbe41. - sync.Map, atomic.Value and sync/atomic — Done: user-visible
Value.SwapandCompareAndSwap2422c5eae5. - Runtime lock ranking (static lock order checking) — Done: partial order self-check
c41bf9ee81; pollDesc edgese8e425cb23; forceGC to traceStackTab edged75fbac54d. - Goroutine and M lifecycle: caches, ids, LockOSThread, Goexit, cgo extra Ms, deadlock detection — Done: zero-sized frame check moved to newproc1
352d329c44;ncgocallmade a global counterd01bc571f7. - Stop-the-world, safe points and GC–scheduler interaction — Done:
runqdrainfor GC mark workersfbb600b283/3b304ce7fe.
Other changes
- Misc internal —
f009b5b226(register ABI for finalizers),9c54f878d2,b110a43628,095ba22597,31d2556273,b36596b14f,d09947522d. - reflectcall signature and idle M recheck internal — Updated the reflectcall function signatures and skipped the work recheck for non-spinning Ms. (
bc489dd6d5,ecfce58965)
Data structures and type metadata
From Runtime data structures and type metadata (Go 1.0–1.17)
Register ABI support in reflect and runtime assembly (internal/abi, makeFuncStub/methodValueCall), wyhash 32-bit fallback, varint type names, VisibleFields, slice-to-array-pointer conversion, CanConvert.
- Hash map core: from the first hashmap.c to the 8-entry bucket design — Done: bucket type descriptor loosened (
15085f8974),mapassign_faststroverwrites existing keys (23ffb5b9ae), pointer arithmetic syntax simplified in mapaccess (0da9eff503). Left open: nothing noted; the 8-slot bucket stays until Swiss tables. - Map fast paths and compiler/runtime specialization — Done:
mapassign_faststrfixed to overwrite existing keys (23ffb5b9ae). - Hash functions and algorithm tables: memhash, AES hash, fallback hash — Done: wyhash fallback for 32-bit (
78f9015236). Left open: nothing noted. - Compiler-generated equality and hash functions — Done: hash loop reorganized, unaligned-load guard (
617383377f,873401df5b),memequal_varlenreferenced as ABIInternal (411860251e). - Runtime type descriptors: layout, shrinking and name encoding — Done: varint name lengths (
287025925f), GC prog symbols content-addressable (e99dfb0e5c), no reflect data for method types (1d9a1f67d5),typesByStringuses all methods (2169deb352),unsafe.Pointerpackage path fix (40254ec0db),reflectdata.WriteTypeunexported andLinksymOffsetExprforTypePtr/ItabAddr(03a875137f,4c835f9169), bucket type tweak (15085f8974),internal/abicreated (baa6c75dce). - Interface values, itabs and type assertions — Done: register-ABI-aware paths (
849dba07a5). Left open: type switches and assertions had no per-site cache yet (appears in 1.19+). - reflect dynamic types: ArrayOf, ChanOf, MapOf, SliceOf, FuncOf, StructOf — Done: user-visible
ArrayOfpanics on negative length (d7cc2f1d7c),ArrayOf/StructOfregressions7473a6a0eb(stack overflow inhaveIdenticalUnderlyingType). - reflect.Call, MakeFunc, method values and argument-frame GC precision — Done: register-ABI reflect.Call (see next thread).
- Register ABI support in reflect and runtime assembly (Go 1.17) — Done:
internal/abi(baa6c75dce), reflect register algorithm (28c5fed557,a2f7067233,34b87b4a1a,cda8ee095e,c5a1c2276e,51cd074c59,ef36e4fd0e,9d46ee5ac4,4fb74e0555,41cf18eda7,d446cb7cff), regabiargs assumption (27d306281c,8cfbf34dd9), wrapper avoidance (849dba07a5,8f4c5068e0,411860251e,45e87cd3ec). Left open: register ABI stays an experiment; reflect register count variables must be flipped when it becomes default (message ofc5a1c2276e). - reflect performance, caches and API additions — Done: user-visible
VisibleFields(009bfeae86),IsExported(b83d073e9e), slice→array pointer conversion (760d3b2a16),CanConvert(48c88f1b1b),IsVariadiccache (6cadfe2fee),Newof ago:notinheaptype panics (554d2c4f06); shared conversion panic (0fd20ed5b6), documentation of convertibility (cf4e3e3d3b). Left open:Valuestill escapes in many paths (addressed in 1.18+ per the later threads). - memmove, memclr, duff routines and pointer-write atomicity — Done: ABIInternal ports (
849dba07a5). - internal/bytealg and string/byte comparison primitives — Done: ppc64x
Index(8009a81f7a,54af9fd9e6), ABIInternal ports (8f4c5068e0). - Slices and append: growslice, makeslice and string/slice conversions — Done: slice→array pointer conversion in reflect (
760d3b2a16). - Strings: concatenation, conversion and printing helpers — Done: consistent
concatstringentry points (35a8bbc9ea). - internal/reflectlite and checkptr — Done: nil pointers in checkptrAlignment (
b39e0f461c).
Other changes
- Misc internal — types constructors preferred over typecheck (
addade2cce), duplicate go:build line (abc56fd1a0),InterfaceDatadocumented as low-entropy (c309c89db5), faster binary-search midpoint (7af821a661, 20.3→16.6 ns), hex prefixes in traceback debug (a1e9148e3d),fa3a121a791.14 version parser (Go 1.14). - Outdated comment update internal — Updated an outdated comment. (
ce76298ee7)
Diagnostics and knobs
From Diagnostics and knobs (Go 1.0–1.17)
More metrics (scheduling latency, allocs/frees); block profile bias fix; mem profiling disabled when unreachable; race on openbsd/amd64 and register ABI for race calls; GOEXPERIMENT refactor with regabi sub-experiments on by default and experiments in runtime.Version().
- Race detector integration — Done: user-visible openbsd/amd64 (
b3b65f2176); register ABI:racecallbackthunkABIInternal, X15 zeroed inracecall,BXinstead of R15, andraceread/racewrite/racewriterangeuse the actual internal ABI (e79c2fd428,946351d5a2,a4dac8bd22,0a510478b0);racefuncenterfpremoved (87d29939c8). Left open: nothing noted. - CPU profiler and runtime/pprof writers (legacy format to compressed protobuf) — Done: user-visible block profile bias corrected by aggregating short events as longer, less frequent events (
0ae9c3b98b, 1.17); memory profiling is disabled whenruntime.MemProfileis unreachable in the linked binary (18510ae88f, 1.17);cpuprofhandles nil gp (c80da0a33a);writeProfileInternalcommon code (79d03ad739). Left open: nothing noted. - Heap profile accounting and MemStats — Done:
next_gc/last_next_gcmoved togcControllerStateasheapGoal/lastHeapGoal(3eaf75c13a). Left open: nothing noted. - runtime/metrics — Done: user-visible scheduling latency distribution (
bedfeed54a, approximation by sampling); additional allocation metrics/gc/heap/allocs:bytes|objectsand frees, fillingTotalAlloc(897baae953); tiny allocs metric (0b9ca4d907). Left open: nothing noted. - GODEBUG, runtime/debug, debug log and traceback knobs — Done:
GODEBUG=scavengemode removed (9c54f878d2);mcall,morestack,asmcgocallno longer treated as top of stack (5ecd9e34df,776ee4079a,a54f7fc0fd), SPWRITE ignored in syscall functions (02e5a8fdfc). Left open: nothing noted. - GOEXPERIMENT handling (objabi, buildcfg, goexperiment) — Done: user-visible constants consolidated (
b675e52e95); baseline moved to objabi (cf2396c70e); regabi sub-experiments enabled by default in turn:regabiwrappers(fd3612e433),regabig(bbb510ccc9),regabireflect(88655480f3),regabidefer(af8a176e91),regabiargs(9dd71ba913);regabian alias (14dbd6e776) and enablingregabiargs(43466399cb); Android baseline included (9c12f1b433); bad GOEXPERIMENT setsErrorinstead of panicking (e15d1f4e64);ParseGOEXPERIMENThelper forgo envvalidation (c95464f0ea); experiments reflected inruntime.Version()(5159c83641). Left open:go envGOEXPERIMENT support was the next step (c95464f0ea). - Traceback correctness and inlining (diagnostic output) — Done: arg maps for unstarted goroutines (
38c129b4f01.13), multiple frames per PC for tsan (a14efb1be31.14), faulting-line fix (9ee6ba089d1.14), top-of-stack handling (5ecd9e34df,776ee4079a,a54f7fc0fd). Left open: nothing noted.
Other changes
- allgs encapsulated internal —
d85083911d.
OS layer, stacks and panics
From OS interface, stacks and panics (Go 1.5–1.17)
register-ABI preparations in assembly, windows/arm64 port, cgo.Handle, openbsd/386 and arm on libc, SPWRITE/TOPFRAME-driven traceback, regabidefer prerequisites.
- New and ported OS/arch targets, 1.5–1.17 — Done: windows/arm64 (
3527caa7d6,427bd7599d,c7c6c113be,16330817aa,a25d1d45d9,78afca22c9), cgo for openbsd/mips64 (f68878f0fc), GOARCH=loong64 reserved (2b00a54baf). Left open: windows/arm64 is “intended to land in the Go 1.17 cycle” as a stack of CLs (3527caa7d6). - Goroutine stack growth, shrinking, GC stack barriers and stack objects — Done: stack growth loop fix (
287c5e8066);49add6ad90fixes spurious stack overflow detection,fbed561f8aresets an accidentally set stack poison flag,97b3ce430bstopsgcTestMoveStackOnNextCallfrom doubling. Left open: nothing noted. - Tracebacks, symbol tables and
runtime.Callers/CallersFrames— Done:SPWRITEandTOPFRAMEdriven traceback (fbe74dbf42,54da3ab385,5ecd9e34df), unifiedasmcgocall/systemstacktraceback setup (01f05d8ff1), non-strictInlTreeIndexlookup inFrames.NextandexpandFinalInlineFrame(e4a4161f1f,aad13cbb74),funcID-based abort detection (298975c634,ff614b13d9). Left open: the unwinder was still the monolithicgentraceback; the iterator-based replacement came later (see status link). - Defer, panic, recover and Goexit (runtime side) — Done: regabidefer prerequisites (
c847932804,e0ce0af6ef,585b52261c),deferreturnframes checks,reflectcallABI0 on amd64 (d8306ee1f9),gosavedeleted (8fa84772ba,b110a43628),jmpdeferhandled bySPWRITE(fbe74dbf42), directunlockOSThreadinstead of a defer in Windows syscalls to avoid nosplit overflow (4dbad79510). - Signals: masks, forwarding, sigaltstack and the unified Unix signal layer — Done:
sigpanic0on all OSes (2698be4905), ppc64 signals with cgo andcallCgoSigaction(d9e068d289), CPU profiling disabled before removing SIGPROF handler (57aaa19aae), Windows non-Go thread signal aborts (cd28ca3a4e), Windows SEH on arm64 illegal instruction (70546f6404), macOSsigNoteSleepEINTR loop (77aa209b38). - Asynchronous preemption: signal plumbing, injected calls and per-arch support — Done: save R15 before checking AVX state (
c49c7a675a),gp==nilcheck before preemption state (98dd205fa4), SIGPROF handler ordering (57aaa19aae), avoid preemption when returning from Go to C (70fd4e47d7). - cgo runtime support: pointer checks, callbacks, extra Ms, C-to-Go call path — Done:
runtime/cgo.Handlefor managing Go values across C (972e883925), unified C→Go ABI transitions (7ad496b6f5),cgocallbackgcalled indirectly (d3853fb4e6),setg_gccincrosscall_amd64(63de211014), msan unpoisoning ofcgoCallers(7aeaad5c86), ppc64xcrosscall2(bade680867),needmbypasses ABI wrapper on Windows (fef5a15396). Left open: nothing noted. - Shared-library and buildmode entry points (c-archive, c-shared, plugin, shared) — Done: Windows amd64 lib entry stack alignment and refactor (
e0fae78e1d,3e0b1cdb5d), arm64 Windows lib entry in16330817aa. - vDSO, time sources and process-wide randomness — Done: PPC vDSO g clobbering (
16e82be454), Windows time constants and files consolidated (e51246c881,b36596b14f), removal of linux-amd64 walltime function (b15372f39b),nanotimeQPCcalled normally (6639bb894d,4deaa6a178), Plan 9 hashkey init (a95454b6f3). - Darwin and OpenBSD move to libc; Solaris and AIX libcall; syscall wrapper layer — Done: openbsd/386 and arm libc (listed above), Darwin
entersyscall(700b73975e), ABIInternal marking (bfc7418e6d,c430313992),osyieldnosplit on OpenBSD (02699f810a),raisenosplit ( is 1.15). - Windows runtime — Done: windows/arm64 (
3527caa7d6,427bd7599d,c7c6c113be,16330817aa,76ab626bfc), long paths without fixup on Windows 10 1607+ (b8371d495b), Windows callback improvements for the register ABI (44dd06670f,4356e7e85f,836dbdb15b,639cb1b629,ab02cbd29f), windows/arm fixes (75e273fc2c,91cc484ea9,5421c37a1d,c4b771348c,080119799b,fbe74dbf42), profiler finds g by SP (ece954d8b8),abortcrashes earlier (38672d3dcf),setlasterrorremoved (678568a5cf), non-Go-thread signal abort (cd28ca3a4e). - CPU feature detection (
internal/cpu), auxv parsing andGODEBUG=cpu.*— Done: LSE atomics on arm64 (07ff596404),internal/atomicextended to matchsync/atomic(af1789a61c). - Assembly-level runtime entry points: memequal/cmp/IndexByte, hashing, atomics and ABI wrappers — Done: the ABI list above,
runtime.mcallregabi (f8892147bd), atomics extended (af1789a61c),07ff596404,4c9791299d,aa0388f2ed,7764ee5614(mips64x nil-g check fix),f0be3cc547riscv64 unbreak,ab331c0254,07ef313525,d4b2638234(gofmt).
Other changes
- other runtime/OS plumbing internal — cmd/compile: process //go:linknames after declarations (
2d6ff998ed); cmd/compile: allow conversion from slice to array ptr (faa4fa1a6e) - BSD, Solaris, AIX, Plan 9, NaCl internal — user-visible runtime: use pipe2 for nonblockingPipe on dragonfly (
ee2a45e5fb) - Linux, vDSO, time and auxv internal — user-visible runtime: fix formatting (
cae68700cc) - Document internal/sys internal — Documented and cleaned up internal/sys. (
8ac23a1f15) - Debug call protocol for register ABI internal — Updated the debug call protocol for the register ABI. (
a89ace106f)
Compiler frontend
From Compiler frontend (Go 1.10–1.17)
The largest frontend restructure: dev.regabi (Node interface, base/ir/typecheck/noder/inline/staticdata/reflectdata/pkginit split, go/constant), dev.typeparams (syntax type parameters, types2, -G, irgen, first stenciling), unsafe.Add/Slice, and typecheck info in export data.
- dev.regabi: from
*Nodestruct to their.Nodeinterface and concrete node types — Done: the entire dev.regabi sequence above, Nov 2020 to Jan 2021: getters/settersd166ef6876→acb4d1cef1; interface41f3af9d04; concrete node types862f638a89,c4bd0b7474,ffa68716a0,9a5a11adfa; visitors and generated methods0d1b44c645,2cec6c4a8c; removal ofLeft/Right14d667341f,f9d373720e;Nodesas slice114af2a044;ir.Ident/BasicLit/ConstExpr(63bc23b545,c8610e4700,a2058bac21);Name.Optmoved toName(289da2b33e);OSTMTEXPRadded (45f3b646d4) then removed in April (7735ec96c1);OSELRECVremoved (aeedc9f804);OBLOCK/OEMPTYmerged (ec5f349b22,ecc8d15bc5);ONEWOBJremoved (ab3b67abfd);TailCallStmtadded (87845d14f9);ir.StaticValue/OuterValuemade safer (e09783cbc0,9aa950c407). Left open: IR still carries both syntax-derived nodes and typechecker-created nodes;ir.CurFuncand theNtypemechanism survive (33801cdc62,3512cde10aonly reduce their use); the old typechecker still runs after noding. - dev.regabi: breaking up package gc into base, ir, types, typecheck, noder, inline, staticdata, reflectdata, pkginit — Done: all of the above (see hashes), plus linksym helpers so
ir/staticdata/reflectdatado not need*ir.Namefor symbols (25c613c02d,ec59b197d5,0ffa1ead6e,4a4212c0e5,82b9cae700),ir.Pkgstrimmed (7e0fa38aad),go.map/go.tracksymbols created directly (a2f825c542),NewNamedandsetUnderlyingmoved intotypes(f37aa5e4e2,63a6f08b39). Left open: noder was still the legacy syntax-to-IR walker alongside the new types2irgen(see generics thread);gcstill hostsMain, ssagen glue and many leftovers. - Indexed export format and the export-data lifecycle — Done: type information on exported bodies (
1129a60f1c), described as an enabling change for generics: “the current typechecker can mostly go away in favor of the types2 typechecker”; closures exportable (1760d736f6,5f3dabbb79), inlining of closure-containing functions disabled for now (8027343b63); ABI export (67d565d281); struct-field note info and separate param/field encoding (c7d708e42e,e12b0afa54); nil exported simply (c6de5d8d1f),iexportavoidsmap[ir.Node](e885df2731), export debug mode (b60a3a8cfb),OSLICE2ARRPTRexportable (5f1df260a9), method-expression import (6d8ba77896), duplicate-import detection (b6df58bd1f), width fix for imported types (fee3cd4250), re-export of parameters (d89705e087),exportWriter.qualifiedIdenttightened (cb34026a95). Left open: the format still serializes the oldirnode tree; generic bodies and shapes need a different carrier. - Generics bring-up in the compiler (dev.typeparams): parser,
-G, types2, irgen, first stenciling — Done: parser/syntax/-G617b633917,b627988b0c,48755e06aa,73f529845c; types2 + importerca36ba83ab, type-check generic code87eab74628; scaffolding6b4da14dd3,5aff757efc;irgenef5285fbd0; types2Sizesmatching the compiler’s struct padding (2e8f29b79d);OLISTfor multiple type args (3d5c715bf2), generic type arg in call parse (13a7412983); first stencilsdcb5e0392eonwards; type info threaded intotypesandir(2440dd457a,0aafd69124);allMethodsreplacestypes.Interface.Fields(a4b8241d97);RParamsoverhead reduced (519f223aa2);comparablein constraint (832a01aad4);types2.Instantiatefor imports, “experimental … not executed unless we enable generics” (9e0facd26e). Left open: generic code not accepted without-G; type lists vs.~unions only reached the parser late (4bbe046aad); “inlining functions with closures disabled for now” (8027343b63); generic export/import and dictionary-based sharing do not exist yet — every instantiation is a separate full stencil. - types2 port of go/types: reviews, error-message parity and language-version support — Done: initial check-in
ca36ba83ab; review series above; compiler-message mode87bc85a846; language-version support1ff2fdaaf1;-langpassed in721488498a; sorted-methods criteria shared with the compiler (6923019a71,5347241b5e); constant overflow8fbdacf64c,0123c9b321;types2.Instantiate9e0facd26e; fixes from all.bash, e.g. tag-less fields copying the last tag and switch case-scope end (44d1a8523a); decl-cycle resolution aligned with go/types (6521c7b378); delayed recording of untyped operands against type parameters (51e4bb236c,8f19394b62); type-switch with type parameter case (2c25cd5ba7); removal of pointer designation / implicit type arguments / disabled type-list code (fbc4c6a3ae,c4f0da5750,9546596d77). Left open:CompilerErrorMessagesexplicitly “needs to be removed” later by adjusting either typechecker or tests (87bc85a846); types2 is not used outside-G. - The syntax package: parser, scanner, source reader, positions and error recovery — Done: generics parsing and tree changes (
617b633917,b627988b0c,73f529845c), printing of channel types and of type parameters/lists (e9e58a4d49,a99ff24a26),Posmethods and testing helpers (5e46c6a10f,6ff16fe3ee),syntax.Walkvisitor moved from types2 (d017a1b649),ShortStringremoval (822aeacd9e), exportedNewName(3a912f279f),~operator and union elements (4bbe046aad,4638545d85),...-without-type message (a63ff398d5). Left open: generics still gated byAllowGenerics(set when-G). - Constants: Go 2 number literals, evconst, untyped conversion and go/constant — Done: the
go/constantswitch (742c05e3bc,7d72951229,259fd8adbb,6a4739ccc5); types2 limits integer precision to 512 bits then 2048-bit overflow error (370e9f5843,a59cb5109d) and compiler refuses excessively long constants (c910fd7b77). Left open: old typechecker still folds viair.ConstExprnodes. - Language version gating (
-lang) and language changes implemented in the frontend — Done: user-visibleunsafe.Add/Slicefadad851a3,14056d0d00,962d5c997a,4bb0847b08; array-pointer slice conversion5f1df260a9,a9705e157b; types2 language-version support1ff2fdaaf1,721488498a,f37b0c6c12,ddec18cf82. Left open: version checks are per compilation, not per file (the go:build-based per-file model arrives in 1.21). - Package initialization order, static initialisation and init functions — Done: initorder state off Nodes (
7fde0d2b50),68e6fa4f68,pkginitpackage (3d8a3cb06b), blank var ICE (983ac4b086),ONAMEOFFSETfor static addresses (c76be2a24e),LinksymOffsetExpruse (99a5db11ac,4c835f9169), dynamic export of writable static temps (7a1e963058), lookup of redeclared dot-import symbol (c1cc9f9c3d). Left open: nothing noted. - Concurrent compilation and frontend performance — Done:
cc90e7a51e,c274a7c03b,b003a8b1ae. Left open: nothing noted. - Directives and pragmas in the frontend (
//go:handling) — Done:861707a8c8,083a26c7d2. Left open:registerparamsis limited to development. - Inlining-related frontend work: export of bodies, type switches, closures, devirtualization — Done:
06b86e9803,8027343b63,6d2a557a4d,5b0ec1a6ac1.16. Left open: inlining functions with closures disabled “for now” (8027343b63). - The legacy typechecker: error quality, alias/recursive-type handling and type checking order — Done:
12a405b96a,4b8b2c5864,51d8d351c1,c082f9fee0,0c1a899a6c,785a8f677f,fd4b587da3,dadfc80bc1. Left open: checker remains legacy for non-generic code. - Lowering in order/walk and the shape of runtime calls emitted by the frontend — Done:
4048491234,e52149822b,cf148f3d46,49e933fc57,3249b645c9,326ea438bb. Left open: nothing noted. - checkptr instrumentation and compiler debugging flags — Done:
87a3ac5f53,e617b2b0dd,8628bf9a97,feb844f1ea,b60a3a8cfb. Left open:clobberdeadTODO. - Types package internals and type printing — Done:
dac0de3748(size calculation into types),a4b8241d97,519f223aa2,7e17b46c58,5cd8a34495. Left open: nothing noted. - Register-ABI plumbing in the frontend — Done:
cabffc199d,89f38323fa,77973863c3,67d565d281,1e8fff0f7b,33b4ffc357,0d1423583b,861707a8c8. Left open: nothing noted.
Other changes
- dev.regabi tree-traversal simplification internal —
fbc4458c06simplified some IR tree-traversal code during the dev.regabi node refactor. - Diagnostic text internal —
2d4c95565a(nowritebarrierrec keyed by*ir.Func),f24e40c14a(Name.Class_ accessors removed); —7b47f9a5f2(-m can be repeated),9423d50d53,a22bd3dc73. - Noder refactors for types2 reuse internal —
3e1a87ac2a(posMap),9e746e4255(varEmbed),106aa941df(DWARF scope marking),099599662d(import logic),6877ee1e07(findpkg),bb53a5ad43(importer matches compiler’s constant export),b7f4307761,868a110c56. - IR representation cleanups inside dev.regabi internal — addrtaken computed by a separate pass instead of the typechecker (
fea898a4b0,0523d525ae,0620c674dd,b3e1ec97fd);Name.Canonical/Byval(77365c5ed7,81f4f0e912);DeepCopymoved toir(d40869fced,989a3f5041,5dbd2e8e44,4da41fb3f8,ecff7628ea); removal ofODCLFIELD/ODDD,Orig(ae1a337809,171787efcd,84cb51d7d7),Walkdef,Vargen,Typegen,Rargs,Name.orig,Name.IsDDD,Sym.Importdef(bb1b6c95c2,12ee55ba7b,95acd8121b,fd9a391cdd,8fe1197654,fda7ec3a3f,e563715b30);types.Fieldcached on selector nodes (351bc2f38c);ir.NewDeclNameAt, singleNametyp (c769d393de,5a3b6796cd); names for keep-alive and*ir.Namein Order/CaseClause.Var/Decl.X(77fd81a3e6,46b6e70e3b,850aa7c60c,82ab3d1448);NameSet/NameQueue(6c5967e528,1b5eed8982);ir.Dump/fmt untangling (158c9dd131,8ce2605c5b,3b25f3c150,724374f859,4dfc7333f4,a79742f39a,9958b7ed3e,f0d99def5b,c28ca67a96,4be7af23f9,bb31c75343—ir.Nodeis no longer anssa.Aux); closure setup (eb626409d1,c9c26d7ffb,b4d2a0445b,098a6490b9); and typecheck prep (ef5964dd6b,e34c44a7c4,31267f82e1,451693af71,57c426c9a5,305d93ef84,cb4898a77d,2755361e6a,9ab3d854ad). Misc:6ca23a45fe,0f9f27287b,2b76429eb0,9f16620f46,76136be027,88e33f6ecb(break/continue export),c22bc745c3,d90b199e9c,e6c973198d/0de8eafd98(ODOTMETH keeps original Sel),082cc8b7d9(IsAssignable→IsAddressable),69cf39089f,7b144ed4f7,228b732ad9,5fd949e4bd,6dae48fb0b,79a3d5ce15,0c65a2f317,b09dbc6913,420809ab08,65ae15ac5d,1b84aabb01,9262909764,6e583d65ab,41ab6689ed,9e0e43d84d,837b35cc55,9c5241e520,578fbbe3aa,e2d278bfeb,eae8fd519b,ed9772e130,6acbae4fcc,6f30c95048,9ea272e5ec,f9b67f76a5,b241938e04,37babc97bb,f5816624cd,477b049060,fd22df9905,3a4474cdfd,1544a03198,2f2d4b4e68,f2538033c0,a30fd52884,4a9d9adea4,5a5ab24689,cd5b74d2df,4476300425,88956fc4b1,280e7fd1ee,06915ac14d,c45313bf45,5f3bd59a0d,137f0d2e06,6c67677541,3bdafb0d82,40818038bf,e24d2f3d05,82ad3083f8,41ad4dec99,b30c7a8044,d5928847de,beb5e05404,b9df26d7a8,f6d2834f8f,f6efa3d4a4,063c72f06d(backport from dev.typeparams),b29b123e07,f93b951f33,094048b938. - types2 error-checking fidelity and review CLs internal —
ab18125567,cd15a48036,c32566c336(endless recursion in Comparable),dbce27d29c,a20021227e(subst.go from go/types),df58f3368e,f8930a2413,8fe8e29c9f,8ec9e89000,14e4267c34,6b18081d01,41e7901ca4,0aede1205b(use syntax printer for expressions),82c3f0a358,502198c8dc,d8796b5670,455c29af83,f8654579cd,f7d1c5990b,c0bf904ddf,a360eeb528,a324aebb7d(string(int) conversion regression in go/types and types2),2140049172,ff6ab114c9,c32ac6c15f,9392b82919,f1777cf84c,20746b2f37,b20f9e2da1,3aee461d5c,0abd7b768b,8960ce7735,6a40dd05d8,a2e150c7cd,6db80d7420,96a96a9058,2abf280a28,3a30381b21,d6a90d06d2,36c5f902f9,48b368b01f,b8a359d984,be28caf0aa,ea65a12f89,40d5e6d4e2. - irgen / stenciling bug fixes internal —
90bfc73071(cache mapped types),89ec17be9a(qualified idents),2427f6e6c0,18bd7aa625,e4ef30a667,2b95c28b18,493eb6e6ec,08a598f8c1,c97af0036b(force untyped constants to expected kind),9a555fc24c,1811aeae66,71a6c13164,e87c4bb3ef,032ef4bbfc,96aecdcb36,f47fab938e,1a7d921aa5,f2717b31b5,281d168e2d,bf634c76b2,55c517a8b3. - dev.regabi cleanups internal — Finished Flag and Debug initialization cleanup, added NewBasic, cleaned up Linksym, removed unused code and fixed comments after renames. (
756661c82a,eb3086e5a8,a17c5e2fce,a5ec920160,e40cb4d4ae,a956a0e909) - Report unused variables in typecheck user-visible — Unused variable errors are now reported during typecheck. (
b8fd3440cd) - Typecheck and types2 cleanups internal — Decluttered generated builtin.go, simplified types2 error reporting, combined two loops and updated ir.Node op comments. (
507e641963,16ad1ea841,b3064b66d0,acf1b46de5) - Export implicit operations internal — Removed skipping of implicit operations during export. (
48895d021b)
Middle end and SSA optimizer
From Middle end and SSA optimizer (Go 1.10–1.17)
dev.regabi refactors reshaped the middle end into escape, walk and devirtualize packages over ir, capture analysis moved into escape analysis, go/defer were wrapped into argument-less closures, expand_calls grew to handle register arguments, and stack-slot alignment/branch-known-from-predecessor/phiopt improvements landed (threads: walk/order IR refactor, Escape, Late call expansion and regabi, Defers, CFG passes).
- Prove pass: unsatisfiability, partial-order facts, loop bounds-check elimination — Done: transitive slice len/cap relations in poset (
5e804ba17d); strengthened branch-known-from-predecessor handling lives in the CFG thread (92d1afe989). Left open: poset remains the only relation store; the later per-value limit table is the 1.18+ redesign. - Escape analysis: the esc.go fixes, the escape.go rewrite, and the move to package escape — Done: package
escapesplit out (de454eef5f), escape state split (67ad695416), reorganized to walk closures in place (b1747756e3), capture analysis reimplemented (fd43831f44,ab523fc510), decoupled fromName.Vargen(f57f484053), stopped analysingNameOffsetExpr.Name_(88956fc4b1), heap-allocated results fix (a429926159), closure escape insidetooHairyscan (51e1819a8d,48badc5fa8),gowrapper closures always escape (1b0a031680). Left open: closures with captures are not yet inlinable by default (see inlining thread). - Inlining: budget, mid-stack inlining, closures, and what became inlinable — Done: closure inlining simplified (
fad9a8b528), inline results declared early for empty returns (6c3bcda866), OCONVOP cost reduced (adb467ffd2),tooHairyscans closure bodies (51e1819a8d), do not substitute OGOTO in closures (95dde3f029), no inltree for closure inside inlined body (6d2ef2ef2a), imported closure types fix (eb433ed5a2), workarounds for closures with type switches (9f601690da), functions with closures not inlined by default (8027343b63). Left open: bug #44370 behind the disabled default. - Early devirtualization and static value tracing — Done: new
devirtualizationpackage (4b1d0fe66f). Left open: nothing noted. - Open-coded defers and defer lowering — Done: argument-less wrapping for go/defer (
769d4b68ef) and its follow-up fixes above, debug flag (e617b2b0dd), register results on return path (f5efa5a313). Left open: thegowrapper must not escape in the runtime (1b0a031680). - Late call expansion and the SSA side of the register ABI — Done: register-ABI plumbing listed in the Design paragraph, plus
GOEXPERIMENT=regabiargsincoming/outgoing fixes (3304b2235a,1f29e69bad), expandCalls name preservation and deduplication (33d99905da,0921211403,daee726a0b,e5bc4f2a77),OpArgdedup (5d6581d747,64ca7e2cb3). Left open: regabi not default for all arches (experiment-gated); fast map functions for aggregates (TODO in6c98ecda10). - Statement boundaries (is_stmt) and source positions through the optimizer — Done: register-ABI ops (
4df3d0e4df), prologue (00d42ffc89),-Nentry block (5e4f9b077f). Left open: nothing noted. - DWARF location lists from SSA — Done: debug analysis block/function end sentinels (
afa58ddf5a), regabi name mapping for small in-params (f62739b861,0921211403). Left open: only single-register params mapped. - Rewrite-rule generator, typed Aux/AuxInt, and rule syntax — Done: no-op rewrite funcs smaller (
bd8b3fe5be). Left open: nothing noted. - Write-barrier elision and the writebarrier pass — Done: newobject in register ABI (
2fa7163b06), ABI-specific barriers (89b141c06e), pointer store types preserved in expandCalls (ca3aefc4a9,5579ee169f). Left open: nothing noted. - Arithmetic strength reduction, divisibility and intrinsics — Done: intrinsic fixes (
402f177efc,42c25e65f3),FuncPCABIxxx. Left open: nothing noted. - CFG and control-flow passes: branchelim, fuse, shortcircuit, phiopt — Done:
051bf37833,92d1afe989,ba6bd967d2, shortcircuit guards (771c57e68e,04903476fe). Left open: nothing noted. - Compiler front of walk/order: ordering fixes and the dev.regabi IR refactor (package walk) — Done: package split and refactors above. Left open: nothing noted.
- Diagnostics for the optimizer: ssa.html, GOSSAFUNC and optimizer logging — Done: package-suffix match (
70deaa33eb). Left open: nothing noted.
Other changes
- dev.regabi IR migration inside the optimizer internal — evconst made non-mutating (
6826287c6b),Node.HasOptdropped (0c65a2f317), explicit block statements for init (64bc656aed), OCONVNOP in SSA (59b8916d48), inlining helpers on new IR (7fcf5b994c,99ecfcae31,d855b30fe4,9f036844db,7958a23ea3,970d8b6cb2),*ir.Nameconversions (133b03e1c3,82ab3d1448,77fd81a3e6,dfbcff80c6,fd22df9905,1544a03198), node printing and header modes (a79742f39a,3b25f3c150),FwdRefAux(1c8943a6ad,8ce37e4110), NameSet in SSA (5248f59a22,d05d6fab32), field splits ofSliceHeaderExpr/SliceExpr/RangeStmt/TypeAssertExpr/CallExpr.Rargs(d19018e8f1,d1d64e4cea,e24d2f3d05,c9b1445ac8,fd9a391cdd),IsAddressablerename (082cc8b7d9),OCALLMETHdesugaring (e4f293d853),ONEWOBJremoved (ab3b67abfd),Initmethods removed (2f2d4b4e68,f2538033c0),Class_accessors (f24e40c14a), toolstash scaffolding removed (cb05a0aa6a),OFUNCINST/OTYPEINSTfor dev.typeparams (e633f343ba),OSELRECV2unified (0328c3b660),OPANICargument converted in typecheck (6113db0bb4), noopt/regabi builder fixes (d6d4673728,e3027c6828,7f9febd4a1),ir.OSLICE2ARRPTRsupport (67b1b6a2e3,cce621431a), other refactors (00e5727790,0c49440664,578fbbe3aa,a997543292,c45313bf45,c40934b33d,d1d1099c91,6acbae4fcc,432f9ffb11,9b636feafe,5834ce1dd7,4bd4dfe96a,b9dfaf77f5,c4c68fb57f,32dbaac572,9abedf4827,cca23a7373). - Closure capture and walk fixes internal — closure vars bound during SSA construction (
950cf4d46c), double-walk guards via walked flags (9734fd482d,213c3905e9,5a5ab24689),tempAssigns(68a4664475), non-nil init for mkcall (19a6db6b63),LinksymOffsetExprin convI (99a5db11ac), SSA’d values’ addresses disallowed (7eaaf28cae), ODOTPTR now always uses a real Field andSelectorExpr.Offsetis gone (a4f335f420,0de8eafd98),refersToCommonNameremoved (676d794b81),ascompateeimprovements and fixes (a317067d65,907a4bfdc7,8c66669764,691e1b84c1), large uint64 constants (290b4154b7),CloneNameremoval (8fc44cf0fa),Defnfor inlined vars (d310b2a6b8), defer wrapping fix (cfac62a1cc), nongeneric closures in generic functions (f432d3fc41),mapKeyTempzeroing and pointerness (8c2a8b1771,3ff6ff7f84), no VarDef for initialised results (abbb82957d), leftover late-call code (f7dad5eae4,aca22bddf2),funcsymtracking and ABIInternal assertion (33b4ffc357,1e8fff0f7b), ABI wrapper type (f448cb8ba8), recover adjustment for ABI wrappers (0723f062ff), traceback argument info (8327d2150f,404127c30f),WriteFuncMapfor new ABI (196c33e92d), regabi test names (b4ca1cec69). - expandCalls bug fixes and ABI plumbing internal — scratch mem removed (
2a18e37c4e), argument stack alignment and slot sizes (593f5bbad7,84ca4949a7,85f62b0941,c4e3f6c4c7,618b66e16d,68f3344fe9,90ec257735,eb437ba92c), SelectN confusion/sanitization (9f5298ca6e,283b02063b,998fe70b68), unused OpArg invalidation (254948a50e,b56177a303,a9e475a15a), IData-of-Arg case (ee40bb666b), register arg decomposer (5eb9912084,98dfdc82c8,04a4dca2ac,d6504b8097,3e524ee65a,d6f6ef6358,052da5717e,4b00eb7af4), argument area size for typedmemmove (b55d900529), 0-sized fields in conversion selection (ec367e5b05), unspilled results (865d2bc78e),a93849b9e2,4357f71ca7,1824667259,9d3718e834,b38b1b2f9a,77860ad280,109d7580a5,c8fb0ec5a0(ppc64 ANDI/SRWI),4f5aec4603,8e725f8452,d553c0144d,7beb988a3b(runtime wyhash; cross-area). - Walk and ssagen cleanups internal — Cleaned up shortcircuitBlock, walkExpr, stray comments and AuxCall.results. (
0f732f8c91,d9691ffa37,9b78c68a15) - Default ABI for calls internal — Updated default ABI choices for calls and bodyless function stack maps. (
33945869c1)
Backends and assemblers
From Backends and assemblers (Go 1.12–1.17)
Register-based ABI on amd64 (X15, R14, wrappers, expand_calls, spills) delivered with dev.regabi package split; depth-first block layout; arm64 conditional-select rules; memmove inlining; large clean-up of ppc64 assembler optab.
- Register-based ABI (ABIInternal) and ABI wrappers — Done: [dev.regabi] ABI wrappers as IR (
cb28c96be8), morestack spill support (c1370e918f), AMD64 parameter register defs and Arg ops (74cac8d479), abiutils refactor and plumbing (c41b999ad4,5a76c3d548,7a2f3273c5,d0d21b7c4c), X15/R14 reservations (401d7e5a24,5d7dc53888,397a46a10a,2e60c00f56), register args retrieved from registers (f2df1e3c34), passed to callees (4532467c18), simple register results for ints and strings (9d88a9e2bf), aggregate OpArg in registers (9f33dc3ca1), morestack handling (a2d92b5143,3778f8e07d,b6e1c33603), results loaded into registers on the open-defer return path (f5efa5a313), output parameters passed in registers spilled as autos (8ed438c077, fixed0ec2c4abba), partially-live argument spilling reworked to occur after liveness (23f8c203f0) and spills placed after OpArg{Int,Float}Reg (56af34f875,a690a5d75f), frame offsets checked against the ABI (5ff7ec98b7,97b32a6724), redundant register moves reduced in call setup by allocating inputs in a better order (6b8e3e2d06), reflect.callReflect/callMethod wrappers not clobbering arguments (3711ea0b5d), struct field padding in register-passed structs (d19eece91f), several offset/trailing-empty-field fixes (998fe70b68,98dfdc82c8,5f646f0a98,45ca9ef5c1,052da5717e,382851c1fd,14ef2d8c01,d6f6ef6358), the five-way experiment split (eaa1ddee84). Cross-checked with git log: the five sub-experiments (andregabiargs) were switched on by default for amd64 in April 2021 (9dd71ba913,fd3612e433,bbb510ccc9,88655480f3,af8a176e91; Android9c12f1b433). Left open: only amd64 (regabiSupported); ABI0 vs ABIInternal still gated by experiment machinery; all non-amd64 ports remain stack-based. - Late call expansion, AuxCall and the expand_calls pass — Done: Results-returning
StaticCall(e25040d162), late return expansion (92cb157cf3), integration with abi info (d0d21b7c4c),AuxCall.argsmade redundant and removed (a93849b9e2), type-preserving stores (ca3aefc4a9), recursive invalidation (a9e475a15a), OpArg scheduling (cb42e3e979),Auxmarker interfacessa.Aux(1a98ab0e2d) withir.Nodeconversions rewritten to*ir.Name(6db970e20a,dcec658f6c). Left open: nothing noted beyond the architecture ports. - dev.regabi package decomposition (ssagen, liveness, objw, types, abi) — Done: all of the above hashes. Left open: nothing noted.
- Rewrite-rule generator (rulegen): ellipses, commutativity loops, typed aux — Done: reserved-name check (
5437b5a24b), resultInArg0 check automation (4ebb6f5110), ValAndOff int32 (b70a2bc9c6), explicit Aux match in store-combining rule (a829114b21, which notes a TODO to require Aux/AuxInt to be always specified on the LHS), smaller no-op rewrite funcs (bd8b3fe5be). Left open: thea829114b21message flags the “unspecified aux is ignored in matching” behaviour as error-prone. - amd64 lowering: read-modify-write, load-op, addressing modes pass, intrinsic-friendly rules — Done: memmove inlining (
3b321a9d12), multi-register shifts (43d5f213e2), BT-modify removal (b211fe0058), RMW fix (359f44910f), store coalescing (bf48163e8f). Left open:b211fe0058leaves “which fallback strategy is better” as TBD. - arm64 backend and assembler — Done: conditional-select rules (
f5e6d3e879), REV16 (b182ba7fab), float slices (3ee32439b5), inlined memmove (3b321a9d12), 128-bit FP pair loads (79beddc773), extended register ops with RSP (a607408403,355c3a037e), shift-amount range checks (0636d88f6d,9726c78539), R16/R17 and R12 clobber marks for special calls (11b4aee05b,4a7effa418), encoding fixes (48b7432e3f,5daefc5363,f439a76253,c925e1546e,e2e05af6e1,a6a853f94c,27dbc4551a), small-stack NOSPLIT (d8394bfc7f), huge-frame prologue (4702dd67a7). Left open: nothing noted. - riscv64 port: assembler and compiler — Done: constant materialization (
6517844129,c2d625168f,8fd0f83552), IsNonNil (125eca0f72), Eq32/Neq32 zero-extend before subtraction (c584f42dcf), huge-frame prologue (042f4cbb6f), atomics And/Or (497feff168). Left open: nothing noted. - PPC64 / POWER backend and assembler — Done: optab consolidation and DS-form handling (hash list above), 5-operand RLWNM (
48ddf70128). Left open: nothing noted. - s390x backend: compare-and-branch, intrinsics, assembler — Done: shift-count type fix (
a58be734ea1.16). Left open: nothing noted. - 386, ARM (32-bit), MIPS/MIPS64 and the 387 removal — Done: ARM:
4826abb6c21.16,c4190fc34d; MIPS:afe517590c,e31e84010e; scratch mem removal (2a18e37c4e). Left open: nothing noted. - math/bits, atomic and runtime intrinsics (cross-architecture) — Done: riscv64 And/Or. Left open: nothing noted.
- SSA infrastructure passes: layout, regalloc, scheduling, flagalloc, block shape — Done: depth-first layout (
600259b099),6ae3b70ef2,5b328c4a2f,90ec257735,b38b1b2f9a,4357f71ca7. Left open:600259b099accepts that some functions get larger or slower. - Debug info generated by the backend: statements, location lists, line tables — Done: register param location work (listed above). Left open: nothing noted.
- Assembler directives and tooling: PCALIGN/ALIGN, FuncInfo flags, prologue handling — Done: FuncInfo (
4dd77bdc91), prologue simplification. Left open: nothing noted.
Other changes
- dev.regabi leftovers internal — InvertFlags ordering stability (
9a19481acb), arm64 addpool class check (775f11cda1), leftover late call lowering code (f7dad5eae4), atomic Attribute access (52d5cb2822), OpArgXXXX Aux passes ssa/check (3e524ee65a). - Misc internal —
bf48163e8f,975ba6e2b2,289d34a465,95ed5c3800(build configuration moves out of objabi),d4aa72002e,5437b5a24b,6ae3b70ef2,a61524d103,c870e86329,873401df5b(equal functions must not do unaligned loads),b4881d930a,196c33e92d,6bbb0a9d4a(windows/arm64 c-shared),b345a306a0,cef3a442ea. - Backend cleanups internal — Code cleanup and ppc64 MOV optab reorganization with unused classes removed. (
939b561a6e)
Linker and object files
From Linker and object files (Go 1.10–1.17)
Register ABI plumbing (ABI-mangled shared/PE/Mach-O names, cgo export ABIs, argument-printing metadata, DWARF location expressions), weak itab references, two-pass trampolines, windows/arm64, centralised GOEXPERIMENT.
- New object file format and the loader (dev.link) — Done:
f901ea701dstores relocation type as uint16,414fa8c35euses a separate bit to mark weak relocations,e8700f1ce6uses a weak reference in itabs;89ca1ce9a8/cef3a442eaabstract and use the full objabi header string;3651eff74edeletesCompilationUnit.Pkg. Left open: nothing noted. - Linker performance and memory engineering — Done: two-pass trampoline insertion makes small programs skip trampoline work (
18852e8372);9f7079c44esorts pclntab relocations,199575a119counts relocations better,48531da9e7builds dynexp list directly,e03383a2e2checks mmap errors. Left open: nothing noted. - pclntab, funcdata and pc tables — Done:
9f7079c44esorts pclntab relocations;537cde0b4badds argument-layout metadata funcdata so tracebacks print register-ABI arguments in syntax order (binary size +1.5%);bdb8044665keeps arginfo symbols out of the symbol table. Left open: hot-spill liveness for arg printing not implemented in that CL (“just assumes all the slots are live”). - Dead-code elimination and method pruning — Done: weak itab references (
e8700f1ce6),92c189f211/b4833f7c06resolve and always markruntime.unreachableMethod,a1222b7535adds a debug print,a655208c9ehandles types converted to interface under dynlink,18510ae88fand runtime disable memory profiling whenruntime.MemProfileRatedata are unreachable,a22e317220/aa5540cd82/49402bee36change map type andmap.zerohandling for linking. Left open: nothing noted. - DWARF generation in the linker — Done:
c819907754relocates global-variable DWARF generation,537cde0b4b/162d4f9c92/b83610699aregabi support (producer records regabi status),fd4631e24f/169155d61e/41afd3af42parameter DIE ordering and abbrevs,fce2a94d84/e78e04ce39panics in inlined/obfuscated code, dwarfgen package split in the compiler (01fd2d05c8),6d98301114correct PE DWARF alignment. Left open: nothing noted. - Symbol ABIs: stable ABI0 vs ABIInternal in the linker and object files — Done: the commits above plus
d28aae26b0recognising internal/abi as a runtime package for trampoline ordering,bfc7418e6dmarking Darwin syscall wrappers ABIInternal,1f7ddf57d2usingabi.FuncPCABI0for libc wrappers. Left open: “for functions without ABI wrapper generated, only one ABI exists but we don’t know what it is, so we still use alias” (a21de9ec73). - Mach-O and Darwin support — Done:
d5b2d809b0LC_BUILD_VERSION,b6ff3c69d5more load commands,dcf85b30baABI name mangling,f39997b2besplits large text sections on Darwin/ARM64 for external linking. Left open: nothing noted. - PE / Windows — Done: windows/arm64 (
985d087782,f41460145e,c0e1301b8c,8e368708c5external linking,e5a6c5243cforce external for cgo),a51daac840/91cfbf39e4/811167e2c9COFF section fixes,a0248a99a8,c432917061links libgcc after mingw,fd5e0bd385. Left open: windows/arm64 cgo requires external linking (e5a6c5243c). - Build modes: PIE, plugin, c-shared, c-archive, shared libraries — Done:
983dea90c1disables plugin support when cgo is disabled,723f199eddcorrect flags in.dynamicfor PIE. Left open: nothing noted. - Host object loading and external linking — Done:
7252e1e5b6converts-Ito-Wl,--dynamic-linkerfor external linking,24ea547a21not with-static,3bf645a633force external for DragonFly cgo,24e9707cbfsupport-fltoin CFLAGS,bd0fc0b9c3preserve ELF phdr flags from external objects,e4253cd023/975b097307reloc-variant plumbing,6208b10d1e/007e247af1setCgoAttr refactor. Left open: nothing noted. - Architecture ports and trampoline insertion — Done: two-pass trampolines and per-arch support (above),
f68878f0fcopenbsd/mips64 cgo,31df4e3fcdmips64x relocs,ff5cf4ced3mips32.gnu.attributes/.MIPS.abiflags,3e5bba0a4432-bit TLS_LE offsets on PPC64 (for thread sanitizer),0a655598e1ppc64le glink resolver,82a1e0f9d3,9ed736ac2a. Left open: nothing noted. - GOEXPERIMENT plumbing and tool configuration — Done: the commits above. Left open: nothing noted.
- Build identity, buildinfo and reproducibility — Done:
a78879ac67movessys.DefaultGoroottoruntime.defaultGOROOT,b05903a9f6fixes the linker’s setter. Left open: nothing noted.
Other changes
- GOEXPERIMENT initialization clarity internal —
8752454ece. - runtime/cgo.Handle user-visible —
972e883925. - Runtime framepointer internal —
09e059afb1on all arm64. - Default GOROOT internal —
a78879ac67. - StackPreempt internal —
9e3328e740. - Debug output internal —
6c3f8a2f47usesctxt.Logf,f82ce7fb23better nonexistent-package error,db4adb1a9bsymbol versions in stack-bound check,053fe2f485better duplicate definition error,59ceb985c7,41e5ae4883,af0f8c149e. - Elf checks internal —
31e12b953aerror if ELF header overruns,60abe01321XCOFF file-local checks,be1da9cdeeunifies text segment write. - Misc dev.regabi/dev.typeparams internal —
35b9c66601,d7e71c01ad,7d55669847,106aa941df,d6d4673728.