Go 1.14
Asynchronous (signal-based) preemption. Timers on Ps. Open-coded defers. Bitmap page allocator. riscv64 port. First pieces of the new object file format. Overlapping interfaces. checkptr.
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)
New bitmap page allocator, self-paced scavenger, async-preemption support for GC (conservative scanning), trigger ratio floor.
- Decentralized GC state machine and mark termination simplification — Done: STW GC releases worldsema before Gosched (
05511a5c0a);g.gcscanvalidremoved (8c5861576a). Left open: nothing noted. - GC pacer: trigger controller, assists and background utilisation — Done: trigger-ratio floor 0.6 (
74af7fc603), hard goal fallback (aae0b5b0b2). Left open: the trigger ratio design needed rethinking (1.18). - Stack scanning: conservative, precise by frames, stack barriers, hybrid barrier, async safe points — Done:
gcscanvalidremoved (8c5861576a); shrink only at synchronous safe points (6058603471); conservative scan at async safe points (d16ec13756); markroot overflow fixed (66e562cc52). Left open: async preemption’s own injection is in the scheduler area. - The bitmap page allocator — Done: page allocator (
14849f0fa5,39e8cb0faa,73317080e1,cec01395c5,689f6f77f0,e6135c2768,33dfd3529b),allocSpan(a762221bea), incremental growth (f18109d7e3), zeroing (a120cc8b36,4208dbef16), sparse bitmap and inUse ranges (acf3ff2e8a,9d78e75a0a,1b1fbb3192,1475b97090,e7f9e17b79), counting scavenged bits in allocation (e1ddf0507c), memstat atomics (ae4534e659), packaging (7f574e476a), walks (814c5058bb). Left open: address-space-specific work (AIX5042317d69,a3a630b0d2, darwin/arm64198f0452b0). - Scavenger: returning memory to the OS — Done: page-allocator scavenger, goal in terms of
heap_inuse, self-paced,scavtrace(73317080e1,9b30811280,21445b091e,08a72c851c,8ac98e7b3f,71154e061f,2491c5fd241.15,eb96f8a574,e5ce13c178,62e4156552,2c87be436b,8a5af7910a,4e3d58009a,d183253572,dcd3b2c173,f511467532) [user-visible:GODEBUG=scavtrace]. Left open: rescans previously-scavenged memory each cycle (fixed 1.15). - Heap address space: contiguous arena to sparse arenas — Done: platform address-space definitions (
198f0452b0,5042317d69,a3a630b0d2,947f8504d9,763d3ac75c,61ef6a39dd,8054b13536,ffb5646fe0). Left open: nothing noted. - Memory statistics and accounting — Done: atomic heap memstat updates (
ae4534e659), uselessheap_objectsaccounting removed (814c5058bb). Left open: nothing noted.
Other changes
- Misc internal — wasm DataView reuse (
07f0460737), tracing deadlock (f266cce676), Plan 9sysReserve(8054b13536),findObjectbad-pointer checks (80315322f3,813d8e8862,66f78e9d88), full span init in alloc (a9b37ae026),gcSweepBuf.blockguarantee (a5a6f61043), math/bits copies in runtime (11da2b227a), page-size limits (ffb5646fe0), makesearchAddrrefer to inUse memory (e7f9e17b79), off-by-one in ranges (1475b97090).
Scheduler and concurrency
From Scheduler and concurrency runtime (Go 1.0–1.17)
Timers on Ps and asynchronous (signal) preemption, suspendG, starvation handoff; threads: timers, preemption.
- The G-M-P scheduler: from global-lock M:N to per-P run queues, spinning Ms and work stealing — Done:
_GrunningGs always haveg.m/g.m.pfc8eb264bb; timers on Ps integrated in the scheduler (see Timers thread)06ac26279c; preempt stolen/unlockingd80ab3e85a. - Preemption: cooperative stack-check preemption (1.2) to signal-based asynchronous preemption (1.14) — Done: user-visible asynchronous preemption: abstract M preemption check
d1969015b4, signal-based preemption inpreemptone177a36a5dc(also makesfreezetheworldmore robust), x86asyncPreempta3ffb0d9eb,GODEBUG=asyncpreemptoff=140b7455877,NO_LOCAL_POINTERSassembly functions excluded3873e5497d, Windows supportb89b4623eb, register map for unsafe pointsc3f149250e, innermost-frame function name for the safe-point checkdcdee153cd, upper Y-register bits zeroed on darwin/amd64123f7dd3e1. Left open: stubs only; other architectures not yet filled in as of the first commits (a3ffb0d9eb“stubs out the other arches”). - Network poller: from the netFD select loop to the runtime-integrated epoll/kqueue/IOCP poller — Done:
netpolltakes a delay for blocking831e3cfaa5(needed by timers on Ps); netpollBreak for AIX301bc66a47; wake netpoller when dropping a P with timersd80ab3e85a;port_getnETIME971ec8728e; init made complete before return04e80fb2c9,9e094ea01e. - Timers: timerproc goroutine → per-bucket heaps → timers on Ps — Done: user-visible timers on Ps
06ac26279c(scheduler),6b3bb4ba3b(procresize/destroy),a7ce2ca52f(resettimer),0050c079d5, the add/del/mod functions above,7d84245a9c(Sleep),c824420d47(timeSleepUntil),ab3f1a23b6(race),10e7bc994f(wasm), switch6becb03334, removal580337e268; fix-upse96fd13264,dc39be8b85,c3cef0bfe5(timerMoving),b50fcc88e9,e762378c42,2d8c1995b9(release timersLock while running a timer; deadlock with the scavenger lock),94f4686a77,641e61db57(remove deleted timers when >1/4 of a P’s heap),cfe3cd903f(atomic first-timer field). Left open: timers on running Ps cannot be stolen;GOMAXPROCSshrink hazards. - Channels and select — Done: receive on empty closed channel fast path
e1446d9cee(backported as02e492f1a31.15 in 1.15); scasetype400d021233. - Semaphores, runtime locks and Notes — Done: direct handoff yields to starving waiter
a8f57f4ada/7148478f1b; trace event in semaphore handoffa4c579e8f7. - sync.Mutex, RWMutex, WaitGroup, Cond, Once — Done: yield to waiter on starving unlock
a8f57f4ada. - Goroutine and M lifecycle: caches, ids, LockOSThread, Goexit, cgo extra Ms, deadlock detection — Done:
_Grunninginvariantsfc8eb264bb. - Stop-the-world, safe points and GC–scheduler interaction — Done:
suspendG/resumeGand_Gpreempted3f834114ab; old stack scan code removed1b79afe460;gcscanvalidremoved8c5861576a; worldsema not held across mark7b294cdd8d; per-P page and span cachesa2cd2bd55d,4517c02f28. - GOMAXPROCS, thread and resource limits — Done: GOMAXPROCS may not run during mark (worldsema)
7b294cdd8d.
Other changes
- Misc internal —
400d021233,b3a1205a11,c1df5187d0,5ff38e4761(platform-independent faketime),26ff21d44d,1f3339f441,cf6e6abc68,15ea61c50c,47efbf0a4e,4ff45821ae,91bb1d734e,60d437f994,c2e2296dd7,9fc41cd697. - Timer fixes for new timers internal — Updated timejump for the new timer implementation and stopped skipping checkTimers when deleted timers would be cleared. (
5f92939c90,895b7c85ad)
Data structures and type metadata
From Runtime data structures and type metadata (Go 1.0–1.17)
Hash functions generated only for map-key types with run-time interface hashing, -d=checkptr support, riscv64 bytealg/reflect, atomic memmove on arm64.
- Hash map core: from the first hashmap.c to the 8-entry bucket design — Done: hash functions generated only for key types, moved into the map type (
36f30ba289, see hashing thread); NaCl overflow padding removed (ba97d0d84d). - Hash functions and algorithm tables: memhash, AES hash, fallback hash — Done: hash only for map keys, runtime interface hashing (
36f30ba289). - Compiler-generated equality and hash functions — Done: generate hashes only for map keys (
36f30ba289), zero-value size constant (8e4399ff77). - Runtime type descriptors: layout, shrinking and name encoding — Done:
fieldalignnaming (9c0e56bf9d), textOff for multiple sections (0ae9389609). - Interface values, itabs and type assertions — Done:
efaceOfused (64e598f783),itab.hashof dynamic entries documented unused (61089984a8). - reflect dynamic types: ArrayOf, ChanOf, MapOf, SliceOf, FuncOf, StructOf — Done: unexported fields, PkgPath (
2d1c033259,ba66797392). - reflect performance, caches and API additions — Done:
directlyAssignablespeedup (8057c0887f), type hints in error messages (09824ccfe5), DeepEqual cycle panic fix (4dc11ae26b). - memmove, memclr, duff routines and pointer-write atomicity — Done: arm64 pointer atomicity (
ffbc02761a), requirements documented and tested (9b5bd30716), wasm zero/move (d0f10a6e68). - internal/bytealg and string/byte comparison primitives — Done: mips64x Compare (
78baea836d,a1b1ba7daf), s390x SIMD Count (b6245cef3c), riscv64 (0c703b37df), wasm tweaks (d0f10a6e68). - internal/reflectlite and checkptr — Done: checkptr conversions (
dc72a2f95f,5eec0a91ea,5a5854c2d1,9989221ac1,daeb5efb20,56d6b87972).
Other changes
- riscv64 and reflect internal — reflect riscv64 support and assembly fix (
91d75f4e4c,02816a2cad,e3f2e9ac4e), channel assignability factored out (4e8d27068d). - Sync reflectlite with runtime types internal — Updated reflectlite to match runtime rtype and mapType. (
ee3f768d38)
Diagnostics and knobs
From Diagnostics and knobs (Go 1.0–1.17)
Inlined function encoding in profiles, asyncpreemptoff GODEBUG, race support for new timers.
- Race detector integration — Done: race support for new timers (
ab3f1a23b6); several runtime frames per TSan PC for mid-stack inlining (a14efb1be3, still needs a rebuilt tsan library); arm64 g register saved across callbacks (ab81efa3dc); ppc64le fix (44e752c38a). - CPU profiler and runtime/pprof writers (legacy format to compressed protobuf) — Done: inlined functions encoded as one Location with several Lines for CPU and non-CPU profiles (
e038c7e418,e25de44ef2,71c59ee6fc,45b4ed7577); fewer allocations buildingLabelSet(5fb74fc138); crash on truncated stacks avoided (ea18a1c212). Left open: nothing noted. - Profile labels — Done: fewer allocations building
LabelSet(5fb74fc138). - GODEBUG, runtime/debug, debug log and traceback knobs — Done: user-visible
GODEBUG=asyncpreemptoff=1added before it does anything (40b7455877). Left open: “doesn’t do anything yet” in that commit. - MSan and sanitizer integration — Done: nil g checked in arm64
msancall(827584e2f3). Left open: nothing noted.
Other changes
- Misc internal — noinline directives (
07ad840098), ppc64le race fix (44e752c38a).
OS layer, stacks and panics
From OS interface, stacks and panics (Go 1.5–1.17)
signal-based asynchronous preemption on all main archs, open-coded defers' runtime support, freebsd/arm64 and linux/riscv64, NaCl removed, signal-stack mlock workaround.
- New and ported OS/arch targets, 1.5–1.17 — Done: freebsd/arm64 (
6b6e67f9b9, cgo33e3983db8,5e35845a4a,316fb95f4f,4b1b18d106), linux/riscv64 (8e0be05ec7,82a2f825b7), NaCl removed (a38a917aee,03ef105dae). - Goroutine stack growth, shrinking, GC stack barriers and stack objects — Done: prints SP and old bounds on stack overflow (
0f25102858), stack-growth during VDSO/signal fixes (758eb020f7). - Tracebacks, symbol tables and
runtime.Callers/CallersFrames— Done: multiple frames per PC for the race detector (a14efb1be3),dumpgoroutinecopes with open-coded defers (1f3339f441), injected-call frames understood by traceback on ARM/ARM64/MIPS/PPC64/S390X (2ff746d7dc,1b0b980904,a930fede73,374c2847f9,933bf75eda),expandFinalInlineFrameempty stack ( is 1.15). - Defer, panic, recover and Goexit (runtime side) — Done: open-coded defers’ runtime parts as described (see
1f3339f441), the nil-defer fault indeferreturn(22d28a24c8). Left open: repeated panic/recover with open-coded defers could leave stale entries (fixed in 1.15). - Signals: masks, forwarding, sigaltstack and the unified Unix signal layer — Done:
SIGURGnot a bad signal (f770366f6d), no forward of SIGPIPE on macOS (d56a86e01f,2afe9d4dec),sighandlermoved tosignal_unix.go(426bfbe9a3), ignoring SIGPROF when disabling (fd33b2c974), Go signal stack always used without cgo (73d20f8186), the mlock workaround (8174f7fb2b,69614c0d0e,9d4717d5f1,1c8d1f45ba),setgaftersigFetchG(fb05264fe1,f07cbc7f88), crash with bad G (03c58c9dcc), Windows lastcontinuehandler in DLLs (e5e5fb024a) and CTRL_CLOSE/LOGOFF/SHUTDOWN as SIGTERM (5d1a95175e). - Asynchronous preemption: signal plumbing, injected calls and per-arch support — Done: signal-based suspend (
62e53b7922), x86 call injection (2d031dc559), M-targeted signals (334291d1f6,8714e39497,42aab4b0af), ARM/ARM64/MIPS/PPC64/S390X (2ff746d7dc,1b0b980904,a930fede73,374c2847f9,933bf75eda), Windows preemption via SuspendThread (b89b4623eb,17e97322fbin 1.15) with a CAS protocol protecting external code fromExitProcess(957259b7e2), g register saved on the gsignal stack during VDSO calls on ARM/ARM64 (758eb020f7,75c839af22), darwin/arm64 enabled with cgo only (52d5e76b39,995ade86e3,67f0f83216), AVX upper-half cleaned on darwin/amd64 entry (123f7dd3e1), VZEROUPPER guarded in 1.15. Left open: darwin/arm64 without cgo not supported until 1.16. - cgo runtime support: pointer checks, callbacks, extra Ms, C-to-Go call path — Done: cgoCheckPointer optimized (
e85ffec784),-Wno-nullability-completeness(fb37821014),unsetenvwrapper fix in 1.15. - vDSO, time sources and process-wide randomness — Done: Wine hacks removed (
b4ad49f9f7), nanotime/walltime wrapped (4af3c17f8c), mips64x vDSO (210e3677f9), Solaris monotonic (2df5cdbadf),fastrandseeding unified (97d0505334), VDSO arm fix (904f046e2b),nanotime1BP/R11/offsets (21713f41d1,2ee2c6232c,3eab754cd0), PPC offsets (71239b4f49),ppc64xanddarwinsyscall perf (c1635ad8f0). - Darwin and OpenBSD move to libc; Solaris and AIX libcall; syscall wrapper layer — Done:
c1635ad8f0,d56a86e01f,3b0aa546d2,b653c878b1,47efbf0a4e(fcntl consistency),904e1136c2(Solaris pipe). - Windows runtime — Done: ExitProcess/preemption protocol (
957259b7e2), DLL lastcontinuehandler (e5e5fb024a), control events (5d1a95175e), Wine hacks removed (b4ad49f9f7), profile thread validity (6fd467ee29),m.threadinmOS(91bb1d734e). - Assembly-level runtime entry points: memequal/cmp/IndexByte, hashing, atomics and ABI wrappers — Done: hash default order (
fbfb41e638), arm64 hash seed (f484e9699d),Store8(d2101e5490), wasm helpers (d0f10a6e68,e9c994954f,07f0460737), comparison tracing for libFuzzer (ea0b4e7c7d),bitscopies insys(11da2b227a), span-state publication barrier (7de15e362b), fcntl consistency (47efbf0a4e),x86hash fallback fix (e237df5b53),efaceOf(64e598f783). - Thread lifecycle, physical page size and scheduler-facing OS hooks — Done: ms iterated via
allm(6b85fa8051),NumCPUon illumos zones (91f3997ec0),mprotectfor aixsysMap(a3a630b0d2). - Plan 9 and NaCl ports — Done: NaCl removed (
a38a917aee,03ef105dae).
Other changes
- signals and crashes internal — user-visible runtime: make m.libcallsp check in shrinkstack panic (
f82956b85b); user-visible runtime: save/restore callee-save registers in arm’s sigtramp (65a1e24209) - Linux, vDSO, time and auxv internal — user-visible runtime: one lock per order (
3c56143442); user-visible runtime: remove unnecessary variable decls in asm.s (cd03fd05b5); user-visible runtime: fix regression on ppc64x from CL 192937 (f4ca3c1e0a); user-visible runtime: use correct pipe call for mips/mips64 GNU/Linux (e01e917687); user-visible runtime: correctly negate errno value for *BSD ARM (4f364be08d); user-visible runtime: correct setNonblock on linux/arm64 (edf3ec987f) - other runtime/OS plumbing internal — cmd/link: do not put static symbols into name lookup table (
c480d32fad) - cgo and C interop internal — user-visible runtime: add go:nosplit to cgo_mmap.go:mmap() and sys_darwin.go:mmap() (
9940c77682) - BSD, Solaris, AIX, Plan 9, NaCl internal — user-visible runtime: syscall_forkx on Solaris can return error on success (
a1a67e6312); user-visible runtime: correct assembly for openbsd/arm64 (bc91947527) - Skip holes in func table internal — The linker and runtime skip holes in the func table. (
a9ea91d571)
Compiler frontend
From Compiler frontend (Go 1.10–1.17)
Untyped constant conversion rewrite, -d=checkptr, overlapping interfaces gated by -lang, columns in export data, scanner error limiting.
- dev.regabi: from
*Nodestruct to their.Nodeinterface and concrete node types — Done: some ONAME-specific state moved toName;AddableandPDISCARDremoved (see above);-d-controlled “line number printing for nodes” (c1b7f508b0);%vused for Node formatting (2c47caa900);DDDarray types removed (616c39f6a6). Left open: nothing noted. - Indexed export format and the export-data lifecycle — Done: columns in export data (
95b8cbfee9), no export-mark for send-only channels (48e482ef0c), OPTRLIT no longer exported (fd5ba54f7c); [dev.link] symbol indices propagated through export data (53b7c18284,286d744246). Left open: importers outside the compiler ignore columns. - The syntax package: parser, scanner, source reader, positions and error recovery — Done:
Badliterals and lexical-error limiting (117400ec09,5411953df5,cdd2c265cc); missing-expression recovery (dca0d03b9c). Left open: nothing noted. - Constants: Go 2 number literals, evconst, untyped conversion and go/constant — Done: untyped conversion rewrite
581526ce96, precise untyped kindse710a1fb2e,2da9c3e0f9improved errors for const conversions,ORUNESTRfolding (ac1d440ea6),iotain function ConstSpec (55c0ad4b62). Left open: nothing noted. - Language version gating (
-lang) and language changes implemented in the frontend — Done: user-visible overlapping interfaces8d4b685ab5,7f907b9cee;-langnot applied to importsb7d097a4cf. Left open: nothing noted. - Package initialization order, static initialisation and init functions — Done: static temporaries not used for small slice literals (
77f5adba55) or string vars (c33d45a898). Left open: nothing noted. - Concurrent compilation and frontend performance — Done: type-printing perf (
2248fc63ab,5d8a61a43e,f77e7ed7e3),33fac9bad8,3ad350820dsize diagnostic in benchmark format. Left open: “addresses some, but not all, of the CPU time regression” (f77e7ed7e3). - The legacy typechecker: error quality, alias/recursive-type handling and type checking order — Done:
a71967e4c5,97bc039c9c,047141797c,c302785df9,efd395f9fb. Left open: nothing noted. - Lowering in order/walk and the shape of runtime calls emitted by the frontend — Done:
ac1d440ea6,c33d45a898. Left open: nothing noted. - checkptr instrumentation and compiler debugging flags — Done: user-visible
80a6fedea0,dded58760d,7b58581a23,8c6876e9a4,9979366e07;3e428363c4. Left open: nothing noted. - Types package internals and type printing — Done:
2248fc63ab,5d8a61a43e,f77e7ed7e3. Left open: partial CPU regression.
Other changes
- Remove -newescape flag internal —
991b0fd46c. - dev.link plumbing in compiler internal —
dc8453964a,a09cd8ccb3. - ARM64 ZeroRange REGTMP fix internal —
0f992b9948. - Frontend refactors toward
OPTRLIT/array-literal simplification internal —efb9739203,00b773a4a9,f672e221fc,130f3c0617,63661b7251(checkdupfields),770a13546e,ad1f2c9618(CTNIL for pointer literals),dab199c9c1,75da700d0a,9da99049ba,24c6dd9823(complex comparison ICE),2197321db1,01e7a152e3,c51909e3a5,d55cf5b80c,b649bdc7f3,bf3ee57d27. - Node op cleanups and empty init internal — Removed OCASE and renamed OXCASE to OCASE, used Node.Right for OAS2* nodes, and skipped empty init functions in fninit. (
2fc6366fb5,c729116332,584ef455ac)
Middle end and SSA optimizer
From Middle end and SSA optimizer (Go 1.10–1.17)
Open-coded defers and their follow-up fixes, escape analysis performance and the new leak encoding, switch walking refactor and string-switch optimization, poset rework, statement-mark preservation across passes, checkptr, and optimizer logging for IDEs (threads: Defers, Escape, Switch, Prove, Statement boundaries, Diagnostics, Rulegen).
- Prove pass: unsatisfiability, partial-order facts, loop bounds-check elimination — Done: sign/zero extensions (
69ff0ba798), poset naming/consts/aliases/path collapsing (b16463c912,490646e476,c70e5475e6),OpSliceMakefacts (87e2b34f7b), indvars bound by other indvars (1658263bbf), poset sufficient-condition fix (3c56eb4083), prove attempts to preserve statement marks when it removes code (9a926911fe). Left open: nothing noted. - Escape analysis: the esc.go fixes, the escape.go rewrite, and the move to package escape — Done:
-newescapeflag removed (991b0fd46c); work-queue walking and graph optimizations (867ea9c17f,262046716c);EscLeaksand new leak encoding (05a805a6de,a0894ea5b5); parameter tagging integration (b9704872d1); loop depth preserved when evaluating blocks (1406ece446);-m=2restored (063d0f11e5,4cde749f63,07513d208a); JSON escape logging for the optimizer log (298be61f3c); checkptr escapes (b6b984fcff,46aa8354fa);n.Noescape()split into separate uses (2197321db1). Left open: nothing noted. - Inlining: budget, mid-stack inlining, closures, and what became inlinable — Done: inline-related optimizer logging (
4d0ed149ff). Left open: nothing noted. - Open-coded defers and defer lowering — Done: open-coded defer fixes (
cc47b0d2cd,1b3a1db19f), riscv64 workaround (a858d15f11,2e4f490b31), nil deferred function panics at invocation on Wasm/AIX (c4817f5d4f). Left open: riscv64 was broken for a time. - Statement boundaries (is_stmt) and source positions through the optimizer — Done: preservation in nilcheck, branchelim, fuse and prove (see Design), bogus line for empty infinite loops (
9bba63bbbe,0e02cfb369), empty block marked preemptible (a037582eff). Left open: nothing noted. - Switch lowering, select, and type switches in walk — Done: major refactoring (
8f3d9855a1), string switch optimization (85fc765341),binarySearchOIF construction (1b2c794896), implicit break position (6139019efa), no statement marks inside the switch tree (01ff213a51), block-indirection removed in type switches (ab00f89c27). Left open: jump tables not yet present. - Rewrite-rule generator, typed Aux/AuxInt, and rule syntax — Done: rulegen rewrite (
1a53915c6b), multiple control values (9c2e7e8bed), go/types removal (1581bb9843), parallelization. Left open: nothing noted. - Write-barrier elision and the writebarrier pass — Done: improved removal (
30da79d958). Left open: nothing noted. - Arithmetic strength reduction, divisibility and intrinsics — Done: AND over shifts (
9ec7074a94), Neg/Com rules (9675f81928),b8cbcacabepointer comparisons,bb7890b85aNot absorbed into Neq/Eq. Left open: nothing noted. - CFG and control-flow passes: branchelim, fuse, shortcircuit, phiopt — Done: shortcircuit infinite loops (
2393d16147),7673884a7f(do not fuse branches with side effects). Left open: nothing noted. - Compiler front of walk/order: ordering fixes and the dev.regabi IR refactor (package walk) — Done: OAS2 in order (
ba6aeb6ce8,e79c23822c), walkcompare cleanups (ecc2d61798,e76b9e8908). Left open: nothing noted. - Diagnostics for the optimizer: ssa.html, GOSSAFUNC and optimizer logging — Done: LSP/JSON logging (
cd53fddabb,298be61f3c,4d0ed149ff,46c9fd03a5), checkptr. Left open: nothing noted.
Other changes
- checkptr and unsafe user-visible —
-d=checkptrinstrumentation support in walk, includingunsafe.Pointerconversions escaping only atcheckptr=2andreflect.{Slice,String}Headerrecognition (dc72a2f95f,f9226454b9,b282efa022,25f5044e46,316fd8cc4a);go:uintptrescapesfor method calls (b3bd7ab3d7). - SSA refactors internal —
postorder(75198b9a9c), redundant rules (abda0a6a92), zero value size constant (8e4399ff77), global Fatalf removed (1a432f27d5),auxSymInt32removed (b91b3d9c31), IData typing (70331a31ed), 1-element array/1-field struct SSA (d2f958d8d1), blockAuxIntType(ac8966aa58),tempnameusages (d535501a8e),SetLikely(false)(e0dde990de), strlit/CTxxx consistency (75da700d0a,dab199c9c1), loopbce cleanup (9740b60e14), rulegen simplifications (bdf0fe5448), runtime/internal/sys intrinsics (a0262b201f), FMA not on plan9 (03fb1f607b), interface-to-concrete comparison panic (25ebf015f6),scasetypefield (400d021233), esc diagnostics silenced for direct-iface conversions (9f89edcd96), error message wording (449b6abbac). - Rulegen removes unused decls internal — The rule generator now removes unused declarations. (
79dee788ec)
Backends and assemblers
From Backends and assemblers (Go 1.12–1.17)
riscv64 assembler and compiler arrive; multi-control blocks and s390x compare-and-branch; FMA intrinsics; unsafe-point marking for async preemption; compiler-generated debug_lines; dev.link object format begins.
- Rewrite-rule generator (rulegen): ellipses, commutativity loops, typed aux — Done: output reduced by 200 KiB (
870080752d), block-rewrite code reduced (c7d81bc086), minor simplifications (bdf0fe5448). Left open: commutative expansion still permutation-per-rule. - amd64 lowering: read-modify-write, load-op, addressing modes pass, intrinsic-friendly rules — Done: FMA intrinsic via VFMADD231SD guarded by
cpu.X86.HasFMA(7a6da218b1), AND-over-shifts (4e2b84ffc5,f41451e7eb),amd64p32rules removed (b12703e052,ce49f9506a). Left open: nothing noted. - arm64 backend and assembler — Done: vector LD/ST (
8403d4ea90), system registers (9c67516ed6,9ce5cad0aa), unsafe-point marking (4736088463), NOOP (3876bd67ef,01f15b62b3), no REGTMP in ZeroRange (0f992b9948). Left open: nothing noted. - riscv64 port: assembler and compiler — Done: the assembler layers and compiler as above (
a3ceb57fb4through98d2717499), linker reloc (1046a9cb1b), DWARF register map (fb8cdb7e4b). Left open: cgo unsupported (g in TP clash, later6f45b39e4d1.16); PIE not enabled. - PPC64 / POWER backend and assembler — Done: DQ-form (
6b67f7d65d), VSX moves (816ff44479), LR for indirect calls (24e549a717), unsafe points (ceca99bdeb), vmrg (8f79ca1d1a), AIX Duff (09c9bced82), ANDCC register masks (55924135ee). Left open: nothing noted. - s390x backend: compare-and-branch, intrinsics, assembler — Done: control values, numeric masks, compare-and-branch (above), Mul64 (
98aa97806b,ac2ceba01a), And8/Or8 (b3885dbc93), sign extension removal (5c5f217b63). Left open: nothing noted. - 386, ARM (32-bit), MIPS/MIPS64 and the 387 removal — Done: ARM FMA/Abs/rotate, MIPS64 Duff, NaCl removals (
11d7775c9f,f6c624a22a). Left open: nothing noted. - WebAssembly backend — Done: shift/rotate/bounded work and extension elimination (listed above). Left open: nothing noted.
- math/bits, atomic and runtime intrinsics (cross-architecture) — Done: FMA (
33425ab8db,7a6da218b1,58b031949b),97592b3c14, Mul64 on s390x/mips64x,ac2ceba01a, signed divisibility (6b1d5471b9), s390x And8/Or8,ec10e6f364(atomic {Load,Store}8 lowering). Left open: nothing noted. - SSA infrastructure passes: layout, regalloc, scheduling, flagalloc, block shape — Done: multiple control values (
9c2e7e8bed), postorder simplification (75198b9a9c),72dc9ab191. Left open: nothing noted. - Safepoints, unsafe points and stack maps for asynchronous preemption — Done: unsafe-point marking across ports;
c3f149250e,b2482e4817,61fa79885b. Left open: nothing noted. - Debug info generated by the backend: statements, location lists, line tables — Done: compiler-generated debug_lines (
ee3dded36d,9e6a84f2b1,46b7557836). Left open: nothing noted. - New object file format and content-addressable symbols (dev.link, assembler side) — Done:
2c484c0356,53b7c18284,cd75cf4bc0,d56c8149ac,97e497b253,9cf6c65ca3,ffca64dcf3. Left open: “currently nothing will consume the new object file” (2c484c0356). - Assembler directives and tooling: PCALIGN/ALIGN, FuncInfo flags, prologue handling — Done:
9d032026d6,b2482e4817. Left open: nothing noted.
Other changes
- riscv64 assembler follow-ups internal — instruction groupings (
85c60bd0f3), memory targets required for loads/stores (08165932f7), FEQ/FNEG/SEQZ/SNEZ (24f08103d2), AGETCALLERPC (48ed1e6113), CALL reloc symbol (3a6cd4c72d), ternary-expansion list (fa610c776e), jalrToSym ADDI (9f07cdd99e). - Other internal — Neg/Com rules (
9675f81928), type-switch line numbering (b8fe9f7970), MIPS FCR encoding (ba0bab7b4f). - Misc internal —
24494440e0,75198b9a9c,515bb0129d,5322776215,3f0437e175,d535501a8e,0b486d2a87,cdd59205c4,503bccb5d9,a09cd8ccb3,90fe9c7c5c,c9f633487b,9f3c2b6d16,ff86ce13b6,ba0e6511301.15,9a0a824456,40ebcfaa17,86235ec2bf,e7ce8627b0,b91b3d9c31,8f14f33f96,ac8966aa58, and nacl rule removals (11d7775c9f).
Linker and object files
From Linker and object files (Go 1.10–1.17)
Compiler-generated DWARF line tables with multi-CU packages, open-coded defer funcdata, libFuzzer counters, and the first shipped pieces of the new object file format/loader (default via -newobj) plus initial riscv64 and PIE work.
- New object file format and the loader (dev.link) — Done: the branch work lands on master piecemeal. Compiler finishes all data generation before writing the object file (
dc8453964a); linker/goobj can parse the new magic (d79380026c); the linker loads it behind-newobj(6051fd0ad9), initially still creatingsym.Symbols right after loading. Deadcode is rewritten on indices and symbol contents are loaded after it (8a9be4921a,2495095275,48151b3f0f,cab29ebd84), the object file is mmapped (0d7404c852), and DWARF compilation-unit logic is ported to the format (65a649c565). The format records InlTree (6ba3ae9ca5), uses aux symbols to tie DWARF symbols to their text symbol (27111e5fec), splits Autolib from Pkglist (928623ca95), has flag accessors and object-level flags for shared/gotype symbols (4a9b30cfc9,15634a0230,8011051361), implements symbol overwrite logic (dab05a0484), rewrites"".to the package prefix (0108b54a3d), and moves the loader to its own package (c9470b0483). Host-object loaders are ported (Mach-Occ21e4d130, ELF0e76e2f4e5, XCOFFe961b26c27, PE496e4273e4), basic shared-library support appears (2bbf2e0233). Name lookup moves to a string map, static symbols are kept out of it, and builtins get preassigned indices (df01b7968b,c480d32fad,fb06609817).5caac2f73emakes the new format the default. Left open: that commit disables internal-linking cgo and shared libraries (“does not work yet in newobj mode”), and the tests known broken; the old format and thesym.Symbolconversion still exist. - Linker performance and memory engineering — Done:
c3e8a20a65removesCputime; loader tuning on the dev.link side that shipped with 1.14: PkgNone resolver cache (2e2ef666b4, LinkCompiler -15%), bulk allocation (5aea597905), aux-sym slice interface (851b1f40b4), 1-element object cache intoLocal(e90e6e75f8), min-heap work queue for locality (36dbdbe9bd: -7.8%/-9%), ABI-alias postprocessing (17722c21e71.15: Hyperkube relink -2.4%). Left open: heap algorithm via container/heap allocates. - pclntab, funcdata and pc tables — Done:
dad616375f/be64a19d99addFUNCDATA_OpenCodedDeferInfofor open-coded defers and the linker’s deferreturn detector (fixed later by9eb403159d1.13,2b70ffe9301.15);8f816259eeexportsPCIterto the compiler and the line table moves into the compiler (376fc48338,ee3dded36d,8506b7d42f; see DWARF thread). Left open: nothing noted. - Dead-code elimination and method pruning — Done: the new index-based deadcode (commits above), special-casing for runtime.gcbits removed (
fcfbe25dca), dupok symbols resolved to other packages added to Textp (5fec788239),5a210b5858keeps DWARF constant DIEs alive. Left open:8a9be4921aitself says “method tracking logic hasn’t been implemented” (done by7d6f79e617, whose message still lists reflect.Type.Method as a TODO, done byd6535415fb). - DWARF generation in the linker — Done: linker DWARF types for autos from
R_USETYPE(e72f002ed0,70a1efbb5cstops reading Autom records), multi-CU per package and compiler-generated line tables (above),65a649c565,32190b0a49expanded import path in function DIE,ab4a71fca7R_ADDRCUOFFrelative to CU start,8506b7d42f,9bba63bbbe/c112289ee4bogus-line for infinite loops. Left open: DWARF generation still onsym.Symbol. - Symbol ABIs: stable ABI0 vs ABIInternal in the linker and object files — Done:
63815923fcABI aliases for external symbols,37b194a4221.13 puts shlib “.type” functions in internal ABI,a2b1dc863ffactors out direct-call identification. Left open: nothing noted. - Mach-O and Darwin support — Done:
2959ba1f55/06e5529ece/1aa64b55f1prefix syms with “_” on darwin links,d856e05d64PLATFORM_IOS,d3660e8ef8PIE on darwin/arm by moving RODATA out of TEXT,cc21e4d130/396a9b98baloader port. Left open: nothing noted. - PE / Windows — Done:
31bfab4ac6DEP,8fc35238a7terminal-services aware,c96d794f66consistent PE versions,e4c3925925libmsvcrt.a during internal link,af880809d8/274f4cef93output via MapViewOfFile / FlushViewOfFile. Left open: nothing noted. - AIX / XCOFF — Done:
cfa421c9a6relocation-based TOC lookup in new loader,e961b26c27. Left open: nothing noted. - WebAssembly — Done:
57662b1575producer section replaces the go.version section,30521d5126valid binaries with large data sections,03bb3e9ad1fast path inwriteUleb128(97% of 858277 calls need under 7 bits),1c8e6077f6/2686e74948runtime async-event goroutine kept in deadlock traces and made short-lived. Left open: nothing noted. - Build modes: PIE, plugin, c-shared, c-archive, shared libraries — Done: plugin on freebsd/amd64 (
88ca80b322),795e8c2317DWARF with plugins on Darwin, PIE on darwin/arm (d3660e8ef8),6dc250f456typerel size with c-archive. Left open: nothing noted. - Host object loading and external linking — Done:
5e514b76e2loads symbols from .syso in external link mode,59a6847039pass-through of undefined call targets,bf7e55b618directly exec archive when external tmpdir,c78ac39ae9gold only on arm/arm64 Linux/Android,d3c2b1f176,f29e53d664/e4c01f088bfixes forld -rELF host objects,ffa5c85c92MIPS64 ELF relocation record layout. Left open: nothing noted. - Architecture ports and trampoline insertion — Done: riscv64 initial support (
bf5f64107a,1046a9cb1barchreloc), freebsd/arm64 (e0a5fae676,152dddee7euse ld.bfd),2e4f490b31open-coded defers on riscv64. Left open: nothing noted.
Other changes
- Loader and dev.link bring-up details internal —
79877e5f91,e63c1df348(move work after deadcode),c455e8878f(decodetype on bytes),f7659d49be(global-indexSymtype),e44dfa1f2b,0b25ab5d96/9036351dd7/b661547d94(relocation-query and batch-read methods),7256f50065(cgo import may overwrite contentless data symbol),6cbf37b30b(record go.itablink symbols during read),e5acb58c39(objdump usesNewReaderFromBytes),bd229936cf(restore export-data hash),5777ffd6e6(either duplicate may be dupok),43d25a61c1(deterministic dynexp order),24ea07d592(internal packages added at end),4a43a50791/48a0b97902(cgo_import_static and cgo attributes earlier),db75205a9b(-strictdupsrestored),4adf822fc9,931845aee3,18e9cdc70e,41348081fa. - Goexit cannot be aborted by recursive panic user-visible —
7dcd343ed6. - libFuzzer coverage user-visible —
e341e93c51adds-d=libfuzzerinstrumentation and a__libfuzzer_extra_countersELF section, intended with-buildmode=c-archive(experimental). - Open-coded defers internal —
dad616375f/be64a19d99: deferBits stored on the stack,FUNCDATA_OpenCodedDeferInfo, extra code segment calling deferreturn after recover, stackguard 880 to 896, defer cost 35.4ns to 5.6ns, panic+recover 62ns to 255ns. - nacl removal user-visible —
07b4abd62e. - Stack object symbols internal —
1abe22c3c1,43001a0dc91.13,6dc250f456. - ld.bfd and gold choices internal —
c78ac39ae9,152dddee7e,d3c2b1f176. - Reloc objects internal —
9a8b497240reset datsize when switching to Segrelrodata. - Direct call identification internal —
a2b1dc863f. - Go1.14 DWARF internal —
5a210b5858,32190b0a49. - ELF internal —
12dbd20a50,fa7d40abe0. - Compiler —
c3e8a20a65,9bba63bbbe,c112289ee4. - Linker cleanups internal — Various tool-driven and simple cleanups, and macho_combine_dwarf.go code cleanup. (
494dd1dddc) - DWARF file table object format internal — Updated the object file format for the DWARF file table. (
21bf37b5a2) - Skip symbol references for missing symbols internal — Linker skips symbol references when looking for missing symbols. (
8adc1e00aa)