Go 1.24
Swiss-table maps. Spinbit mutex. HashTrieMap-backed sync.Map. weak and AddCleanup. synctest experiment. Generic type aliases. prove’s limit table. mallocgc specialization. vDSO getrandom. Closure-favoring inliner.
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 Runtime: memory allocator and garbage collector (Go 1.18–1.28)
- Heap bitmap rewrite and allocation headers — Done: GC programs removed from types (
45869f5931) and stack objects (5a0f2a7a7c). Small-object bitmap writes were sped up: skippingspan.heapBits(−8%,56fb8350c8) and pre-writing the single possible 8-byte pattern (−6%,721c04ae4e). Left open: nothing noted. - mallocgc decomposition and size-specialized malloc — Done: micro-optimizations (
31437f25f2,6686edc0e7,d8997c8c1f,8df6413e11,e750a0cdb3,60ee99cf5d), path split (8730fcf885; −11.6% geomean), and specializedheapSetType(a1c4fb4361; −20.6% geomean). ASAN poisoning was fixed after the split (fb2a7f8ce1,4bf98186b5). Left open: “We can probably also do more with the size class lookups” (8730fcf885). The split dropped the fresh-span zeroing skip for large pointerful objects (fixed in 1.25,df9888ea4e1.25). - Finalizers, runtime.AddCleanup and the cleanup queue — Done: user-visible
AddCleanup(0531768b30) andStop(6a2fb15475). Fixes: thestopsearch could loop or corrupt non-cleanup specials (7f049eac1b); the closure was kept alive while the special became visible (d69e6f63c3); thearg == ptrcheck (9d21ef3bd4).SetFinalizervalidates arguments before the GC-mode check (252e9def65). Docs (8c3e391573) and race-detector tips in zombie reports (09f9b5e361). Left open:SetFinalizeris to be deprecated (0531768b30). - Weak pointers and the unique package — Done: user-visible the public
weakpackage withStrongrenamed toValue(a65f1a467f) and docs (c46ba1f9ef,adfd81d8cd,07398d2e57,87dbfb9fa7,772f024c61). Correctness: shading on conversion (79fd633632), blocking during mark termination (80d306da50, test3bd08b9792), keeping the handle alive while the special is published (88cfad0c89),uintptrspecial offsets for interior weak pointers >64 KiB (d87878c62b), and a zeroPointer.Valuereturning nil (d62154db83). unique: stored keys are the clone, not the input (21ac23a96f); zero-size types (2927aa10ab);TypeFor(755c18ecdf); tests and docs (23c9efa244,1596a6c8ec,b7e4d2067c,a785d11ac4).HashTrieMapmoved tointernal/syncwith a usable zero value (4804d0daca,e8c5e6d635). Left open: the special offset could later be packed with the kind to recover memory (d87878c62b). - Mark worker scheduling and GC work queues — Done: futile worker acquisition avoided (
e50913cefc). Left open: nothing noted. - Allocation publication, zeroing and preemptibility — Done: a publication barrier for delayed-zeroed noscan large objects, for user code on weak memory (
acd072a078). Left open: nothing noted. - Address-space layout, tagged pointers and the mem.go layer — Done: iOS address-bit docs (
cdca671855). Left open: nothing noted. - Linear-memory heaps (Wasm and sbrk platforms) — Done: Wasm uses unused linear memory at the break, including linker-reserved initial memory (
4510586f93); aligned reservations round the break instead of over-reserving, and sbrk systems drop arena hints (22664f33b7). Left open: nothing noted.
Scheduler and concurrency
From Runtime: scheduler, timers, channels, locks and synchronization (Go 1.18–1.28)
- Timer rewrite: per-P timer heap, timer.lock, and GC-able synchronous timer channels — Done: Stop/Reset racing with a running timer now returns true when the run is cancelled (
2ebaff4890);isSendingbit cleared before locking the channel (ce60f70374), not used for tickers (48849e0866), then turned into anatomic.Int32counter so more than 8 concurrent firings can be tracked (6a49f81edc; timer struct grows 96→104 bytes within its size class); avoid panic reading an expired synctest timer channel (4ce116a884). Left open: nothing noted. - Runtime mutex: tri-state futex/sema locks → “spinbit” mutex — Done: groundwork: futex OSes can use the sema-based mutex via new
spinbitmutexGOEXPERIMENT value, off by default (18c2461af3); then the spinbit algorithm itself, gated by that experiment and enabled by default whereXchg8exists (fd050b3c6d); control-flow cleanup (adc9c45587, -2.9% MutexCapture geomean). Left open: platforms needing emulatedXchg8still on the old tri-state code; two implementations to maintain. - testing/synctest bubbles — Done: internal
synctest.Run/Waitwith fake clock hooks in chan, coro, mgc, lockrank (d90ce588ea); user-visible experimentaltesting/synctestunderGOEXPERIMENT=synctest(76e4efdc77); deadlock avoidance when copying stacks (1d28fa8c43); bubble membership propagated through syscall/js callbacks (a8eddaf758);Runreturn happens-after goroutine exits (3924fe92b61.25, 1.25). Left open: experiment only. - Coroutines (
iter.Pullruntime support) — Done: goroutine profile invariants upheld incoroswitch(2a98a1849f). Left open: nothing noted. - Asynchronous preemption: extended register state — Done: VZEROUPPER dropped from darwin/amd64 asyncPreempt (
fe87b586c0). Left open: nothing noted. - sync package API evolution — Done:
sync.Muteximplementation moved tointernal/syncsosynccan later depend oninternal/concurrent(frame skip for mutex profiling adjusted) (6c66005285); explicitnoCopyfields (53b2b64b64); HashTrieMap added to Map tests/benchmarks (50f1888814); RWMutex upgrade/downgrade doc (bc0406333f). Left open: Map not yet replaced by HashTrieMap in this log. - sync/atomic and runtime atomics — Done: intrinsics marked noescape (
e30ce3c498); loong64 acquire loads (geomean -74%/-45%) (3214129a83); arm native And8/Or8 (c5d424bfca). Left open: nothing noted. - Netpoller — Done: kqueue EVFILT_USER one-shot events save about one syscall per wakeup (
21b5f2637a). Left open: nothing noted.
Other changes
- cgo callbacks and Goexit on C threads internal — stack bounds saved/restored at
cgocallbackso repeated C->Go calls on the main thread avoid slowpthread_getattr_np(76a8409eb8);syscallbpasunsafe.Pointer(54fe0fd43f); clearer Goexit-on-C-thread error (3da4281df1,820329508a). - Weak-to-strong blocking at mark termination internal —
80d306da50. - Misc internal —
injectglistholds trace acquire acrosscasgstatus(f025d19e7b); synctest idle defer (953a1bec48); js notes without maps (2caf638e2f); wasmimport pointer types (73ac82f990); getcallerpc noescape (a02516a379); linkname for wireguard (846fc6345d); arm And8/Or8 fix (5dbb0a5c6b); fips service indicator (f0b51a2099).
Data structures and type metadata
From Runtime: maps, built-in data structures, hashing, randomness and type metadata (Go 1.18–1.28)
- Swiss-table maps (GOEXPERIMENT=swissmap → only implementation) — Done: user-visible
GOEXPERIMENT=swissmapcreated with forked files (057b703407), ABI/compiler integration split into old and swiss variants (4f7dc282c4), fast variants initially disabled (1985c0ccf9), initial table without incremental growth (0733682e5f), wired into the runtime enough to pass all.bash (c39bc22c14; missing: race/concurrent-write detection, stack-allocated maps, fast variants, indirect key/elem, all added later in the cycle:2220fd3636,b5fec2cf54,f782e16162). Extendible hashing (d94b7a1876), small-map direct group (77e3d8cf13),mapaccess1/mapassignmoved fromruntimetointernal/runtime/maps(0564fa6820), capacity hints (3b424cfa9d), shift/modulo optimisations (bb46b754be,cd54b9bae9), deleted-slot reuse (efa43c57b1), big-endian support (3352db152b), no re-copy of indirect key/elem on grow (d4b0bd28ee), single hash on delete (4c8ab993cd), int-key small-map lookups (d51f92e737), simpler small-group lookup that stops once no filled slots remain (a867e5e5a6, -11% geomean), constant elem offset for int64/string keys (c14fc500c7,253a9933d1), one fewer hot-path load (63f762bcde), hash a copy of the key rather than the key (d13e6d0b08). Iteration: Iter stores the group acrossNextcalls (aefb173b0a,7b3ac0ca5d) and uses a hybrid single-slot-then-group-match strategy (7c40544441: low-load maps had regressed +60% vs old maps; testing a full group match on every call regressed mostly-full maps, hence the hybrid). Small-map lookups with long string keys do a quick equality prefilter over all slots and only hash if more than one passes (04807d3acf);returnafterfatalkeeps the key in a register in the probe loop (43725ba283).reflectgot swissGroupSizesupport (02df9bbdbd) and droppedmapiterkey/mapiterelem(7ba074fe43). Compatibility:mapiterinit/mapiternextare linknamed by third parties with the oldhiterlayout, so newmapIterStart/mapIterNextwere introduced for the toolchain and the old names became a compat layer (78e6f2a1c8,8071f2a169). Left open: default on but GOEXPERIMENT still exists; nothing in the 1.24 messages noting concrete unfinished items besides the “single table without directory” idea in77e3d8cf13(“left for later”). - Compiler-generated equality/hash functions and type descriptor emission (reflectdata) — Done: GC programs removed from type descriptors; the runtime builds the pointer bitmap on demand (
45869f5931, -110 net lines: reflectdata, linkerdata.go/decodesym.go,abi.Type,reflect.type); abi.NoEscape treated as cheap call (b6efbd4efc). Left open:MaxPtrmaskBytesstayed at 2048 (revisited in 1.27). - internal/abi type layout unification and type metadata (rtype → abi.Type) — Done: GC programs removed from
abi.Typehandling (45869f5931). Left open: nothing noted. - reflect implementation: performance, allocation and escape behaviour — Done:
structType.Fieldavoids allocation (493517bb5c), swissGroupSize(02df9bbdbd),MapIterwithoutmapiterkey/elem(7ba074fe43),MapOfflag tests (7dac9898c3). Left open: nothing noted. - memmove / memclr / memequal / internal/bytealg assembly optimisation — Done: loong64 memmove/memclr/Compare (
547baafa37,501b389efc,50e536daa1), arm64Equal(b915399e7e), arm64 memclr block alignment (b4712ab055), riscv64 IndexByte (606a0bd9c8). Left open: nothing noted. - Concurrent hash-trie map (internal/sync.HashTrieMap) — Done: all above. Left open: reverted optimisation of CompareAndSwap/Swap.
- Classic map maintenance and maps package helpers (pre-swiss) — Done:
1b4cf43e42,1f8fa4941f, linkname allowlists for map functions (8391579ece). Left open: swiss replacement.
Other changes
- swissmap code cleanups internal — iterator index merge (
7de87ebd59), group-index as uintptr (0b652e3ef6), match helpers (378c48e6c7,490f6a7933), removed dead code (900578d09c,01e1e5c204,ed035af7b7,775837f51f).
Diagnostics and knobs
From Runtime: tracing, profiling, metrics and diagnostics (Go 1.18–1.28)
- The new execution tracer (trace v2): generations, per-M buffers, new parser — Done: tracer made reentrant via
nosplitcore (e76353d5a9); experimental batches reusable (2a3e2e9b29); deterministic reader output (1c4acea03d);Stack.Framesasiter.Seq(89a5a60da6,6eb40d158a); trace tools merged intocmd/trace(5f073d361f); event size reduced by packing G statuses (705f9848ef). Left open: none noted. - Frame-pointer unwinding in tracing and profiling; profile stack depth — Done: fix lost root frames (
runtime.goexit,_LostContendedRuntimeLock) andexpandFrameout-of-bounds (c64ca8c6ef); null termination ofGoroutineProfilestacks (49e542aa85). Left open: nothing noted. - Mutex and block profiles, including runtime-internal lock contention — Done: all sampled events recorded (
1416cebdd5), zero-delay events stored (433c1d3b4a), root frame fix (c64ca8c6ef). Left open: attribution (done in 1.25). - CPU profiling, goroutine profiling, pprof labels and the protobuf writer — Done: user-visible cheaper pprof labels (
ca63101df4, benchmark411ba0ae86); heap profiles hideinternal/runtime/mapsframes (d0c9142ce3). Left open: nothing noted. - Coverage redesign: runtime/coverage, internal/coverage, covdata — Done: 128-bit FNV-1a replaces MD5 for file identity (
092d18b318); text-format output with multiple packages fixed (50455385b0,40b3c0e58a); stringslite added to the hard-coded runtime package list (966688a43a). Left open: nothing noted. - Race detector, ASan, MSan and Valgrind integration — Done:
internal/racecontents linknamed into runtime (e25b913127); race enabled forinternal/runtime/maps(3a6795554d); concurrent map access fatal error treated as a race hit in tests (fc5e8f2f6b). Left open: nothing noted. - Crash output, runtime/debug, BuildInfo and debuglog — Done: debuglog type-toggled (
548158c4a5,eb6743d9d7), tests always run (3e1bda08fb,13b3af0391,c7227bc72cforces >=10 shards),ParseBuildInfo/Stringdocs (0c460ad014). Left open: nothing noted.
Other changes
- Test hygiene internal —
checkPtraceScope(87a89fa451), gdb 15 fix (ff695ca2e3), pprof label hall-of-shame cleanup (6705ac6885).
OS layer, stacks and panics
From Runtime: OS and platform layer, stacks, panics and tracebacks (Go 1.18–1.28)
- Symbol tables,
runtime.CallerandCallersFrames— Done: user-visible documented thatCaller/Frame.Filealways use forward slashes (0addb2a4ea), thatCallersnever returns an entry PC (312f7c1bd3), andFramesexample fixed (eb1e505f3f). Left open: nothing noted. - Frame pointers: explicit NOFRAME, FP maintenance and FP unwinding — Done:
bpstored asunsafe.Pointeron cgocallback (54fe0fd43f). Left open: nothing noted. - Stack growth, stack bounds and the crash stack — Done: windows/386 system stack reserve (
7eeb0a188e); OpenBSD nosplit limit (4da905bcf0). Left open: nothing noted. - C-to-Go callbacks: extra-M reuse, system-stack bounds, init gating — Done: C pthreads created detached (
18fc547b21); Goexit from a C-created thread gets an informative error (820329508a, after reverta9bd84e037); cgo index into pointer-to-array (76f3208367); Androidpthread_getattr_np(bccd686f9d); Cygwin error (3f0b293e70). Left open: nothing noted. - Library entry points and runtime initialization — Done: wasip1 library mode (
0b1494f5d2); AIX_cgo_sys_thread_createfix in lib entry (d49d0e0d3a). Left open: nothing noted. - Security hardening: AT_SECURE, std fds, AT_RANDOM, gated debug features — Done:
arc4random_bufon BSDs (311372c53c); AT_RANDOM overwritten (9a44b8e15a);crypto/randcrashes on error (c050d42e1a,644628536f). Left open: nothing noted. runtime/secretand data-independent timing (DIT) — Done: DIT feature detect andcrypto/subtleclosure (0826b90172,bc1da38c3d). Left open: goroutine locked to OS thread, no inheritance.- vDSO,
vgetrandomand fast clocks — Done: user-visible vDSO getrandom (eb6f2c24cd) and tuning (86781963cc,8c269479ed,ba10a38ed0,ba42120723). Left open: only amd64 etc. shipped first; riscv64 later. - Signals and async-preemption machinery — Done: loong64 debug calls and sigcontext padding (
3a55b92ccf,36e5c84ffa); darwin VZEROUPPER removed (fe87b586c0);ignore SIGSYS in checkPidfd(a3a05ed04c). Left open: nothing noted. - Syscall layer:
AllThreadsSyscall,internal/runtime/syscall, libc and WindowsSyscallN— Done: reduced stack usage insyscall.SyscallX(fa7343aca3), wasmimport pointer types (73ac82f990). Left open: nothing noted. - Windows runtime port — Done: windows/arm
nanotime1fix (c7faf7f514), 386 system stack (7eeb0a188e), stack-memory test relax. Left open: nothing noted. - New, ported and removed platforms — Done: wasip1 library mode (
0b1494f5d2), Wasm memory (4510586f93);internal/goos/cmdknown-OS table package (9f0491c524). Left open: nothing noted. - CPU feature detection, GOAMD64 checks and cpu GODEBUG options — Done: DIT on arm64 (
0826b90172), loong64 HWCAP/LAMCAS (0f003f9d15,065c1359e1). Left open: nothing noted.
Other changes
- Misc internal — fatal messages printed without interleaving (
6cb107452a), Goexit-on-C-thread message (3da4281df1),adjustSignalStackindirect call to avoid nosplit overflow (944df9a751), riscv64asm_riscv64.hand regabicputicks(26aa8d6eb8,2707d42966), loong64 regabicputicks(8efb5ebfd0), wasm epipe check disabled (d39b366841). - ERMS memmove internal —
REP MOVSBfor >2KB on modern Intel (4096B copy −26%) (601ea46a53). - Anonymous mapping names user-visible —
prctl(PR_SET_VMA_ANON_NAME)labels like[anon: Go: page summary](Linux 5.17) (52eaed66331.25, early settings300d9d27141.26 in 1.26). - loong64 CALLFN internal — word-wise arg copy (CallArgCopy 4096B −82%) (
992f63583a); ARM64 LSE check at init (4e70258601, reverted475e08349d, relanded81c66e71d41.25 in 1.25). - internal/runtime/sys internal —
getcallerspmoved (4f881115d4), package moved (fc5073bc15).
Compiler frontend · types2
From Compiler frontend: the types2 type checker (Go 1.18–1.28)
- Type sets, union terms, interfaces and constraint satisfaction — Done: typeset iterators replace
is/underIs(1e5a72e980,681751a1fe). - Instantiation, Named types, Context deduplication and lazy expansion — Done:
818515fd3eNamed.cleanuphandles aliases;91af7119cdforbids new methods on generic alias and instantiated types;2ad53d5a19forbids methods on cgo-generated types. - Type inference and unification — Done:
726d898c92always infer over methods when the type argument is fully known (fix for #66751);0253c0f4acerror message change;7703db647ctracing. - Generic type aliases and
Aliastype nodes — Done:9b4b4ae585fixes a named type instantiated with a generic alias (#68580),5a1de4ed34checks that alias type arguments satisfy constraints,e3cbda934cprints alias type parameters,91af7119cdforbids methods on generic aliases. - Type declaration cycles, valid-type detection and the object path — Done:
bdc6dbbc64,bfc8c5b85acycle error reporting;87023bb27fdeterministic init-cycle output. - Per-file language versions and version gating — Done:
0b4ab20d2c(only use fileVersion if >= 1.21), reverted by2693f77b35, replaced byaeac0b6cbf(usemax(fileVersion, go1.21)if a file version is present),9b1f8f32b8(go/types: compute effective Go version independent oftoken.Pos). - Language features as seen by the type checker (by release) — Done:
c9afcbade7requires iterator yield to return bool (work-around);8a4b439ee6adds a README.md. - Method receiver checking — Done:
e0ca2e04b8,1b7285d1ab,ea82219d1c,86bec1ec19,385e963e70,b631b8e674error positions. Left open: the parser can optionally keep parentheses in type expressions (disabled by default, per86bec1ec19). - Error reporting: codes, messages, and sub-errors — Done:
7d9802ac5equalify named types by kind (compositeKind),3dc146da7f,bfc8c5b85a,76f3e0ac8d,bcb934ad11. - Sharing code between go/types and types2 — Done:
0fb35efe5b,a17356cd23,0fc3b127a0;7ad9a2c65f; Scope methods5fe3b31cf8/80316510d3/6ad3933e28removing dependency onScope.LookupParent.
Other changes
- Recording/scopes internal —
e7b7f44ff8implicit type-switch case scopes start at “:” ,5bd442aba3,c6531fae58data race through dot imports,9593684438always record a type for inner composite literals,1d20bce981doc forInfo.Types,8a4b439ee6README. - Small fixes, unifier/assignment refactors, message and tracing tweaks internal — 18 commits:
88bd985239,0509936823,1d542efe23,38c766ee0f,1a90dcdaaf,73fa90e290,aca0e2bb27,829d1b346f,ec67622d04,f6c89abf89,c208b91395,b17a55d095,de46eaadb5,676d427f77,f328f3ff06,6f59c11155,66b6b174b6,17ed215958
Compiler frontend · syntax, IR, generics
From Compiler frontend: syntax, IR, unified IR and the generics implementation (Go 1.18–1.28)
- Unified IR: one serialization for noding, stenciling, inlining and export — Done:
830621bc09addspkgbits.Version;9e8ea567c8writes V2 bitstream withaliastypeparams; has-init / derived-func-instance / derived-info-needed fields deprecated (24fd1a043d,c586dbb8b7,5de9811f37); old indexed-format import dropped (b0bbfb1e0f); export data handling merged into newinternal/exportdata(cd35323be9,0edea47f26). - Old typechecker and IR node-model cleanup — Done:
IsHiddenClosure/IsDeadcodeClosureretired (2e8b3425a2),typecheckgetcallerpc/sp builtin sigs andOGETCALLERPCdropped (5b2f71a2c3,72739bbfa6),types.Type.rparamsremoved (5d06d165ff), tcSlice/IndexConst/checkmake simplified (d7521704ce,2d9255b0ea,e6138185db). - Static initialization and package init — Done: no static init of strings in FIPS mode (
5ec1457941,dea12628e6removes debugging). - Compile-time performance, concurrency and the self-PGO’d compiler — Done: PGO profile refresh (
3ae00f5d29); function wrappers cheaper to compile. - Compiler debugging infrastructure: bisect/hash debugging, flags, dumps — Done: script-test facility for the compiler (
aa97a012b4,b60f88d810toolchain script conditions,8246171baeREADME generation). - Frontend support for new language features and spec changes — Done: user-visible
//go:wasmexport(1cf6e31f0d, docs32e19fc439), aliases enabled in importer (209ed1a9c7), alias type parameters written (3b36d92c96), tail-call wrapper emission (af0c40311e), dead locals pass (cc258e6785). - The syntax package (parser, scanner, tree) — Done: parentheses around constraints stripped consistently (
1e2114349d), keyword hints in errors (2eac154b1c), missing parameter type message (bae2e968e2). - Types package internals: size, algorithm kind, TFlag, SIMD flags — Done: GC programs removed from stack frame objects (
5a0f2a7a7c), map bucket special cases removed fromtypes.Compare(cf5ec0720f), stack-allocated swiss maps (63ba2b9d84, small maps andmakemap_small, #54766). - Method wrappers and promoted-method sharing — Done: tail-call wrappers (
af0c40311e) in the frontend;7e2487cf65avoids dynamic type when possible.
Other changes
- Avo ports of amd64 crypto assembly internal — sha256/sha1/sha512/md5/aes/p256 (7 commits, e.g.
dbd50a16dc,f9eb06c302,3b78ca0626,1e0cba8ee1,6ee8c07c3c,d61b73c1d1,004686b6e5); touch compile tests only. - Optimizations internal —
fe69121bc5[]byte(s1+s2),7e2487cf65avoid dynamic type,b2aa18b96cstop md5/sha1 for hashes,5ca785d48d16-byte hashes. - Unified IR: noder/writer/reader refinements and pkgbits (1.24) internal — RType/implicit-conversion wiring,
*Athelpers, optional expression handling, UIR documentation and grammar,pkgbits.Index/SectionKindrenames, synthetic closure positions, unsafe.Sizeof handling and related reader/writer fixes (7fcd4a7007,7dc1ee81f9,e67c0f0c8f) - Generics: dictionary/shape fixes in the stenciler (1.24) internal — fixes in dictionary passes for type assertions, comparisons, switches, nested instantiation packages, and recursive generic interface instantiation (
660e7d60f2) - Housekeeping (1.24) internal — dead-code removal, ioutil/seek/slices/atomic-type replacements, README edits, debug-flag removal, assorted small bug fixes and doc comments (
3f9360345c,88833c9045,ac51262592,d32133af77,9cfe3a86d3,d6d5d8c8fb,f15095f543,cc912bd8eb,d288776d91,ab5c22e7ed,324f41b748,ea38fa5345,1e740c7669,0ff1d42507,bb2a5f0556)
Middle end and SSA optimizer
From Compiler: middle end and SSA optimization (Go 1.18–1.28)
- Inliner: budget, closures, and the interleaved inline/devirtualize driver — Done:
- Calls to
PPARAMfunctions are favored (a464ffda3e), and calls to closure variables are discounted (ad7f736d8f). - user-visible Closure inlining is strongly favored: double budget (
170436c045), and a very high budget for closures called once (d524c954b1). - Interleaving was refactored into a fixpoint loop (
4aa1c02dae). abi.NoEscapecounts as a cheap call (b6efbd4efc). “Cheap” runtime calls are detected bygo.runtime(c2b580a474).- A robust “contains closure” test was added (
889abb17e1).
- Calls to
- Escape analysis: call modelling, closures, func-variable callees, and solver speed — Done: fixed escape analysis for rangefunc bodies, which the “-range
” closure naming had broken ( db40d1a4c4).hash/maphash.Comparable[string]no longer escapes its argument (50a8b3a30e). Left open: nothing noted. - Prove pass and bounds-check elimination: from poset relations to a dense limit table, topo-sorted walk, and division-aware proofs — Done: the limit-table rewrite.
- Dense limit table (
553443d41f) and the constant rewrite (3b96eebcbd), fixing #66826, #66692 and #48213. Its TODO said “remove constant logic from poset code”; that was done inb97971ea2e. - Constant ranges propagate through multiplies and shifts (
a4a130f6d0). Boolean and pointer relations (5925cd3d15). - The domain relation table was reorganized and the jump-table case simplified (
f32ec41df5,aba16d17c5). - Simplification: HelloSize −0.83%, CmdGoSize −1.53% text (
9b4268c3df). checkbceruns afterfuseLate(864aa86448).- Jorropo’s limit derivations:
bits.Len*(0c7523ff59) and its constant folding (090f03fd2f);bits.TrailingZeros*(f49fe2955d).- XOR (
49621cc311), OR (57df33814a). - Modu, Divu, and Div/Mod with positive arguments (
194fa2eb6c,e23ebec90d,68c431e89f). - Trunc, Complement, Negation (
4f2c0e5d08,2f3165973f,820f58a27f).
- Fixes: off-by-one (
f259e4c916), unsat checked before local facts (3de175f383), cleanups (b538e953ee,9a4fe7e14a). - min/max phis (
4dcbb00be2). Limits for newly created values (cb163ff60b,5123f38e05).
flowLimitworkarounds for #68857 (min/max, ModU, And) remained until the 1.26 topo-sort. - Dense limit table (
- Memory-op optimization: memcombine, dead stores, store-to-load forwarding, alias analysis, mem2reg — Done:
- An
InlMarkis not a read for DSE, which avoids double zeroing (b0f7be3cfa). - Zeroing right after
newobjectis removed even when builtin decomposition runs late (b2cdaf7346). - CSE removes redundant
OpLocalAddrs so DSE and memcombine see more (c4e6ab9750, #70300).
- An
- Lowering of builtins to memory ops: memmove/memclr/memequal inlining and generated equality — Done: constant-size memclr is inlined on loong64 (
91d07ac71c). Race instrumentation is added whenwalkCompareemitsmemequal(09eefb3a4d). Left open: nothing noted. - Switch lowering: jump tables, type-switch caches, and switch lookup tables — Done: a type switch with a single runtime-known type and a case variable is optimized (
711552e98a). Left open: nothing noted. - testing.B.Loop support in the compiler (bloop) — Done: user-visible variables are kept alive in
b.Looploops by disabling inlining and devirtualization there (fe2da30cb5). A one-time ramp-up was added, andb.Loopitself is inlined (558f5372fc). Left open: the approach was revisited under #73137, and the 1.26 pass replaced it. - Range-loop and range-over-func lowering in walk — Done: the “bad iterator” panic status was changed (
d311cc95dc). The saved.closureptris omitted in optimized code (a9ad0ff6ba). Left open: nothing noted.
Other changes
- Misc internal — wasmexport result checking and unwinding (
eb975601a0,2ebe15c67e),OGETCALLERPCremoved (72739bbfa6), assertI2I LSyms removed (ab5c22e7ed), atomic logical op typing (dbfa3cacc7), map length type (500675a7c8). - Intrinsics code split internal — factored out of ssagen with
intrinsicBuilders, arch handling and duplicate check (c6c9634515,b6f05cc333,dff15aa610,7c54e024e8);atomic.Xchg8on amd64 (dc8902f4eb). - Misc optimizations internal — shift arithmetic (
32f4864216), redundant nil checks (7d2e3da243), pull adds out ofunsafe.Pointer<->uintptr(f0b0109242), generalized struct load/store (6d856a804c), tail-call expansion in call block (5428570af7), write-barrier coalescing fix (44a6f817ea), no static string init in FIPS mode (5ec1457941),IsHiddenClosure/IsDeadcodeClosureretired (2e8b3425a2). - Modernization of compiler code internal — min/max, slices, maps use (~8 commits, e.g.
f90f7e90b3,0a2cc74f5a).
Backends and assemblers · architectures, ABI
From Compiler backend: architectures, register allocation, ABI and assemblers (Go 1.18–1.28)
- Register allocator, scheduler and block-level backend passes — Done: regalloc drops values that are not used until after a call
36b45bca66; premature deallocation inloopreschedchecksfixeda8be834912. - amd64 code generation and GOAMD64 microarchitecture levels — Done: sync/atomic And/Or intrinsics on amd64
c18ff29295,Xchg8dc8902f4eb; swissmapmatchH2/matchEmptyintrinsified with SSE ops (0–3% faster map ops; moved to free functions because methods cannot be intrinsified)dce30a1920; floats stored as integer constantsf66db49976. - arm64 code generation and assembler — Done: bitfield rule additions
7273509466,b92f3f29c1; MADD/MSUB combination more often98e719f677/fix0a0a7a5642; STP/LDP around morestack74163c895a; prologue/epilogue pattern-matched again for small frames (MOVD.W/LDPmismatch noted in the commit)6d39245514; MSR DITb5c2b1ec13;UDFfor undefined Progs3e3ce20df8;Xchg83aa71c12ea; span7 helpers557211c150. - riscv64 compiler and assembler (RVA profiles, vector, compressed) — Done: integer min/max instructions
3d9a89b057; vector instruction encodings and registers77c53c16e9,4646556ba4; encoding information reworkeddc8ceb63a8; shift+add combine for rva22u64e126129d76; ANDN/ORN/XNOR always provided0ee5d20b1f; prologue_end DWARF stmtb45c7f1661. - loong64 backend and assembler — Done: atomics intrinsics based on AM* instructions (xchg
72a92ab5b7, xadd4f7af5d192, load/store barriers3214129a83,ac345fb7e7, Cas5432cd96fd, And/Or4b0da6b13f, Xchg8fe7d97d032) — Xchg8 via LAM_BH because LL/SC needs too many temps for an intrinsic; publicationBarriere534989d18; intrinsics: Abs/Copysigne705a2d16e, Max/Minff14e08cd3, OnesCount via VPCNTfb9b946adc, TrailingZeros/Len/Bswap/Reverse (ab55465098,d98c51809d,d6fb0ab2c7,583d750fa1), FMAe6cc9d228a, prefetch (1.25)da9c5b142c1.25; stacksplit branch inverted for static prediction (SP <= stackguard→ morestack)5923a97f43; assembler cleanup series (~12 obj/loong64 commits e.g.bd85a3b153,ee3da50617,0214749fef); LSX/LASX loads/stores/compares/PCNT751a817ccc,4ce8c0604e,2751443e92; register-indexed load/store rulesef3e1dae2f; loong64-specific memmove inlining5f88755f43;NOSPLITsmall stacks0a8dea10ce; many FP/CRC32/FMA/bit-field instructions. - PPC64 / Power10 backend (GOPPC64, prefixed instructions, PC-relative code) — Done: decimal floating point
b03b1acfb0,7403a6a122; MulUintptr intrinsic2b0a157d68; Xchg815618840f6; carry addition rules745ec75719; shift regression fix1846dd5a31. - Prologue, frame pointer, stack split and function alignment (cmd/internal/obj) — Done: arm64 small-frame consistency
6d39245514; drop NOFRAME TODOa4eba85fad. - Multi-word arithmetic, intrinsics and carry-chain support — Done: PPC64 MulUintptr
2b0a157d68; 386 Ctz64 (relevant to swissmap)0140aae6d0. - Atomics and memory-ordering code generation — Done: amd64 And/Or
c18ff29295and Xchg8dc8902f4eb; PPC6415618840f6, arm643aa71c12ea, loong64 (above). - WebAssembly backend — Done: wasmexport frameless return PC fix
4ffa2aecc1, parameter types5a9aeef9d5, detection before runtime init0b632d26b9.
Other changes
- FIPS 140 plumbing in obj internal — verification enabled
6c841e4640; static assembly symbols, static temps, external tests (91d7ab2cef,fd0294b99c,61790207f5,f99f5da18f); builtin linkname disallowed14e5093ee5. - Use of slices/min/clear in cmd internal — (
d91a2e5b11,f90f7e90b3,0c16278124,b2a856e82c);cmd/internal/hash16/20-byte hashes replacing notsha256 (4fd73e5d4c,f033bc1819,5ca785d48d). - prove learns min/max phis internal
4dcbb00be2. - Obj tool for Cnames
84e58c84fd;AddRelmethod5b20eec8a0. - 38 small obj/loong64 and loong64 asm commits internal — e.g. obj/loong64: add CPUCFG instructions support; obj/loong64: switch Lookup function call to ABIInternal mode; obj/loong64: fixed operand assignment error for BFPT/BFPF in. (
0a9321ad7f,4b89120b12,ff0c2d9634,5881c41e7f,8b51146c69,5ca7d4645f,33b247437f,44663f333b,b53809d75d,a9ad410801,864513dda9,01ab9a016a,950fcf129e,11dbbaffe1,f95ae3d689,e761921688,f428c7b729,b874005a84,4087624473,3ae819ad1c,9b88f58099,38f8596787,4bfc81a727,9177e12ccc,ea08952aa2,2c5b707b3b,f243cf6016,e45c125a3c,db07c8607a,b895dd5630,aef81a7551,0753396628,252fbaf30f,3f694f73d0,7240c6cb97,3ae5ff2a27,65ba6f94b3,2b33434287) - 9 small ssa/regalloc/liveness/obj generic commits internal — e.g. cc: give function position on function-too-big error; cc: fix typing of atomic logical operations; cc/internal: optimize condition branch implementation. (
afe0e60054,dbfa3cacc7,0f58a7be8a,cd9a300afc,e7047bd14d,32bd777a37,8c52cd3da5,81c92352a7,be86f09e01) - 3 small obj/riscv and riscv64 rules commits internal — e.g. cc: drop TODO in NilCheck for riscv64; obj/riscv: update references to RISC-V specification; obj/riscv: update RISC-V instruction table. (
0fe775e9f3,e5e552b816,89d7f03172) - 3 small cmd/asm commits internal — e.g. cmd/asm/internal: use slices.Contains; cmd/asm: add position to PCALIGN directives; cmd/asm: add support for LDREXB/STREXB. (
e6ae2d83ac,4d35dcfa21,3cb0c039e9) - 1 small mips/s390x/arm/wasm commits internal — e.g. obj/s390x: fix m6 field encoding for VSTRC instruction on s3. (
889178d5b6) - 1 small obj/arm64 and arm64 rules commits internal — e.g. crypto/internal/fips/check: enable windows/arm64. (
f61c2603e9)
Linker and object files
From Linker, object files and debug info (Go 1.18–1.28)
- Type, itab and typelink layout (.go.type section, relro rework) — Done: data/bss pointer masks built from the types the linker knows rather than constituent GC programs; when linking against shared libraries it loads the extra relocations needed to break arrays/structs apart
7588cc9b00. Left open: the message says it is part of removing GC programs from the runtime. - //go:linkname restrictions and the blocklist — Done: user-visible new std linknames blocked
fb764cdad0; runtime mapiter compatibility layer for legacy linknames8071f2a169; FIPS frozen-tree linkname fix4f48ad5c6b. Left open: nothing noted. - DWARF quality for debuggers (types, variables, trampolines) — Done:
variable_parameteron functype outparamsae33b66c19; DWARF/gdb support for Swiss maps067c091564; name slice index made self-describing08770a5b94. Left open: nothing noted. - Reproducible build IDs, buildinfo and symbol tables — Done: user-visible Mach-O UUID with
-B20ed603118, by default6a4feb5644, applied to external linkingc15e589733; ELF GNU build ID by default427d1a23ef; not passed if C linker lacks support15c5580160;cmd/internal/machopackagef2d9f5ffca. Left open: nothing noted. - FIPS 140 support in the linker — Done: symbol kinds
43f889b9e5,4582f239c3; verification support (disabled)239dbd7dba; enabled6c841e4640; large-program fixes00709919d0; delta applied to RODATA to DATA relocationsb9955f0ad9. Left open: nothing noted. - Per-platform object formats and internal linking (Mach-O, PE, XCOFF, wasm, ppc64, riscv64, loong64) — Done: loong64 trampolines
1d925fcc7e; wasmexport on js/wasmf38d42f2c4; Wasm memory 16 MB to 1 MB extra24bc473173; PE export cap 6553578c0ea5df7; riscv64R_GOT_PCREL_ITYPE_RELOC371ee1469c1.25. Left open: nothing noted.
Other changes
- Misc linker internal — new internal-linking relocations (
abc3d2c119), isPLTCall arch (c6117e8f05), 20-byte hashes (f033bc1819), asan covctrs alignment (6dc99aa7eb), OpenBSD nosplit limit (4da905bcf0), runtime dependency list (1218566fe5),-simplies-wdocumented (ba1deb1cee), flag probe ordering (87c03bdf62), assorted cleanups (aec5cc52ad,a1c3e24b54,4aa5aa63c9,cc912bd8eb,f3c89e21a5,72801623cb,daa6c9310e,c37d9a0f93). - Linker script tests internal (
f021221a58,8246171bae). - cgo noescape/nocallback user-visible (
ff271cd391).