Go 1.10
Buffered write barrier. Soft and hard heap goals. Per-P timer buckets. Threads can exit and LockOSThread nests. DWARF location lists. AVX/AVX2 in the assembler. Open-addressed itab table. Linker code-health refactor and content-based build IDs.
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)
Soft/hard heap goals and 5% assist headroom, buffered write barrier, worker scheduling cleanup.
- Decentralized GC state machine and mark termination simplification — Done: user-visible
runtime.GC()forces a cycle even with GOGC=off (0744c21b98);SetGCPercent(-1)waits for concurrent GC (64b68bedc5); STW duration measured more accurately (250a9610a4), gctrace CPU fix (89b7a08aea). Left open: nothing noted. - GC pacer: trigger controller, assists and background utilisation — Done: soft and hard heap limits, 5% assist headroom, utilisation separation (
03eb9483e3,af192a3e22,27923482fa,315c28b788,28e1a8e47a,b783930e63,e09dbaa1de). Left open: nothing noted. - Hybrid write barrier and buffered write barrier — Done: buffered barrier (
e9079a69f3), bulk barriers buffered (877387e38a),typedslicecopyrewrite (6a5f1e58ed), reset on all flush paths (043f112e52),heapBits.bitsnosplit (3675bff55d). Left open: fast path implemented only for amd64 per the commit message. - Allocating from mark bits: allocBits, freeindex and ctz — Done:
nextFreeFastinlinable (101fbc2c82), array-of-1 allocation special case (29e9b89b9a). Left open: nothing noted.
Other changes
- Misc internal — dynamic
allp(84d2c7ea83), KeepAlive in tests (2c990f4596), spans docs (53f2d53450), DWARF type for specialfinalizer (97d17fcfd1). - Malloc comment improvements internal — Added a max waste column to the size class table comment and improved nextSample comments. (
a6ae01a64a,8e11cb3f3b)
Scheduler and concurrency
From Scheduler and concurrency runtime (Go 1.0–1.17)
Per-P timer buckets, nested LockOSThread, no GOMAXPROCS limit, xorshift fastrand; threads: timers, lifecycle, random.
- The G-M-P scheduler: from global-lock M:N to per-P run queues, spinning Ms and work stealing — Done: user-visible GOMAXPROCS limit eliminated
ee55000f6c; no sleeping before stealing unless the victim P is running868c8b374d; fractional GC workers on all Pse09dbaa1de;sched.mnextint646c7bea6309;allprace in findrunnable7c2cf4e779. - Network poller: from the netFD select loop to the runtime-integrated epoll/kqueue/IOCP poller — Done: only call netpoll if
netpollinited86cd9c1176; errno positive in netpollopen4a0dcc2de1. - Timers: timerproc goroutine → per-bucket heaps → timers on Ps — Done: per-P timer buckets
76f4fd8a52; sift functions optimized6a7c63a08a; early return fromdeltimera72e26f246; monotonic zero on low-resolution clocks986582126a. - Channels and select — Done:
selectdonemoved into g32b94f13cf; makechan memory checks455775dae6. - sync.Map, atomic.Value and sync/atomic — Done: Value without
noCopy0c0c3c186b. - Goroutine and M lifecycle: caches, ids, LockOSThread, Goexit, cgo extra Ms, deadlock detection — Done: nested LockOSThread
c85b12b579, no thread creation from locked threads2595fe7fb6, terminating locked threads4f34a52913,lockedg/lockedmas guintptr165c15afa3, lockOSThread not for every cgo call332719f7ce. - Stop-the-world, safe points and GC–scheduler interaction — Done: assist credit flush on goroutine exit
f10d99f51d; accurate STW duration250a9610a4. - Fast random numbers for the scheduler — Done: xorshift64+
e7e4a4ffa3; sema fix9d9722a2e1.
Other changes
- Plan 9 / template thread internal —
926373ea79,d155b32f8d,f4faca6013,44d9e96da9. - Misc internal —
12ec54724b,a212083eea,3526d8031a,09739d2850,be589f8d2b,4b3a3bd3aa,733567a186,9d17e175e0,fbc8973a6b,8db19a4966,9735fcfce7,165e7523fb,3f150934e2(when to use sync.Map).
Data structures and type metadata
From Runtime data structures and type metadata (Go 1.0–1.17)
A large series of map micro-optimizations (evacuate refactor, fast-path copies, specialized memhash), the new open-addressed itab table with compile-time function pointers, MIPS soft-float.
- Hash map core: from the first hashmap.c to the 8-entry bucket design — Done: the large map refactoring series by Josh Bleecher Snyder and Martin Möhrmann, described in the fast-path and growth threads (starting with
64bd2c49b4,445717530c,aca92f352d,cbc4e5d9c4; see those threads for the rest). - Map growth, iteration order, overflow buckets and GC interaction — Done: evacuate refactors and fast-path copies (list above), tophash helper (
445717530c),makemapdynamic checks moved to the compiler (54125d191d,bb31217579forismapkey),makemapint hint calls (cbc4e5d9c4), fixedmakemap64signature (15d5fa0291), hiter zeroing avoided (034d825ea3,b6296426a0), mask shifts on x86 (f7aa454c58), NaN evacuation simplified (8a9d4184e6). - Map fast paths and compiler/runtime specialization — Done: the series listed above (
dad5d76e8f,61043d4671,29e6bdc69c,0c7fd56951,ec0e2edd3b,8585f9fdb1,25bbb695c8,2a56b023af,dc10aeeff8,aca92f352d,dabc361847). Left open: benchmarking was “impeded by #21546” per several messages. - Hash functions and algorithm tables: memhash, AES hash, fallback hash — Done: specialized memhash32/64 (
2a56b023af,176cd48e57), CPU-feature detection refactor for 386/amd64 (5a6c5809901.9 in 1.9). - Runtime type descriptors: layout, shrinking and name encoding — Done: struct field reflect info fixes (
d349fa25df), Noalg types out of typelinks (a4c009f5ae),dtypesymreturns*obj.LSym(d36cc9baf3). - Interface values, itabs and type assertions — Done: compile-time function pointers (
89d74f5416), hash table (3d1699ea78,98d0634b7a,04d6f982ae,fcf445dce2,d30f99647a). - reflect.Call, MakeFunc, method values and argument-frame GC precision — Done: interface→interface conversion in
Call(eafa29bdce), zero-sized return value pointer (0a48185b43). - reflect performance, caches and API additions — Done:
Copyfrom string (245e386e4c), safety audit of unsafe additions (8bb51a73e9), method indexing for non-ASCII (6f1724ff41,77b4beba2f). - memmove, memclr, duff routines and pointer-write atomicity — Done: arm64 SIMD IndexByte/memclr (
d259815ccb). - internal/bytealg and string/byte comparison primitives — Done: arm64 IndexByte/memclr SIMD (
d259815ccb). - Slices and append: growslice, makeslice and string/slice conversions — Done: simplified capacity check, overflow, infinite loop fixes (
365594ad59,371a5b494a,f3e0d14313). - Soft-float, 64-bit division and complex arithmetic helpers — Done: MIPS soft-float routines (
ac987df87c).
Other changes
- Map evacuate/iterator cleanups internal —
a6136ded32,f5804ce4f3,248a7c7c42,e0789d734d,589fc314af,02ad116bf1,b5c4211159,43d4c9f4f1,cf69867af4,2548d36c86,4c9989a360,a4956248a8(evacuation relation check moved to evacuate). - Reflect fixes internal —
newNameparameter (9c9df65c53), non-exported embedded field mutability (6471ace2ea), Type usable as map key documented (6317adeed7). - Runtime hygiene internal —
panicwrapstack walk (354fa9a84f), recordspan write barriers (164e1b8477), no allocation in unrecoverable panic (2edc4d4634), hexdump on traceback failure (dbd8f3d739).
Diagnostics and knobs
From Diagnostics and knobs (Go 1.0–1.17)
Block/mutex profiles in new format with delays in ns and mutex scaling; STW trace events; label-race fix.
- Execution tracer (trace v1): events, per-goroutine sequencing, annotations — Done: STW GC events traced (
b0392159f6); fix for a corrupted trace inStartTrace: the batch header write moved totraceFlush, andtraceStringnow takes*traceBufPtrso allocation tracing cannot overwrite the buffer (d58f4e9b7b); goroutine info initialised fromGoCreateincmd/trace(a58286c289). Left open: nothing noted. - Race detector integration — Done: false positive when reading profile labels fixed with
racereleasemergeon alabelSyncglobal (57584a0ee1, 1.10; alsoc82efb1fa31.9, 1.9); no race calls for zero-sized values andraceXinstead ofraceXrangefor types without subcomponents (b046878018,53c8be4a8d);Posleft unset for racewalk enter/exit (d2414cefba). Left open: nothing noted. - CPU profiler and runtime/pprof writers (legacy format to compressed protobuf) — Done: block/mutex profiles use the new profile format with delay in nanoseconds (
f99d14e0de), mutex profile scaled by sampling rate (e89d08e021; block profile not scaled because “how to infer unsampled values is unclear”); memstats read earlier (301b127a05); lost extra reset (96b1eff087); unwinding through cgo hardened (5c2be42a68,ebe38b867c,3ff41cdffa). Left open: block profile scaling. - Profile labels — Done: false-positive race when reading labels fixed with
racereleasemerge(57584a0ee1). Left open: nothing noted. - GODEBUG, runtime/debug, debug log and traceback knobs — Done: hexdump printed on traceback failure (
dbd8f3d739); autogenerated wrappers hidden (e97209515a,032678e0fb). Left open: nothing noted.
Other changes
- Per-P timers internal — per-P timer heaps, improving scalability for deadline-heavy servers (
76f4fd8a52); refactor of generic AST walking used by racewalk (12c9d753f8); mechanicalsort.Slice/LastIndexByteedits and a revert (57e7d62455,fb54abe9ce,d2826d3e06,d153df8e4b). - Race annotation comments internal — Added comments to race annotations. (
91b6425031)
OS layer, stacks and panics
From OS interface, stacks and panics (Go 1.5–1.17)
threads can exit, vDSO on linux/386 and amd64 on large stacks, DT_GNU_HASH, unified entry points, previous-handler signal death and late handler forwarding, never allocate in unrecoverable panic.
- Goroutine stack growth, shrinking, GC stack barriers and stack objects — Done: never allocate during an unrecoverable panic (
2edc4d4634),throwsplittraces and no stack growth insigpanicwhenthrowsplit(4671da0414,44213336f0,9483a0bc23), write barriers removed innewstack/gogo(3beaf26e4f), 1 MB stacks on 32-bit Windows (77ea9f9f31). - Tracebacks, symbol tables and
runtime.Callers/CallersFrames— Done: hide autogenerated wrappers (e97209515a), intrinsicgetclosureptr(57bf6aca71),getcallerpcloses its argument (229aaac19e), avoid bad unwinding fromsigpanicin C code is 1.11. - Defer, panic, recover and Goexit (runtime side) — Done: no allocation in unrecoverable panic (
2edc4d4634), write barriers allowed instartpanic_m(070cc8eb02),deferreturnavoidstypedmemmovefor nosplit limits (332719f7ce). - Signals: masks, forwarding, sigaltstack and the unified Unix signal layer — Done: previous-handler death (
5500c9ce27), late handler forwarding (c3189cee71),sigTabTunified (6126384f6d), Solarissigtrampgo(ae84aaee44), foreign handlers on Darwin (057a34a281), do not block signals that kill the program (eb97160f46),sigctxt.fault()normalized (56462d0f10), gsignal stack restore (292558be02), never-freed OS signal stacks (44d9e96da9), documentedsigtrampgo(294963fb7f), ios sigstack (764a6ac29e),dieFromSignalsleeps longer on Darwin (0ec59e4c08). - cgo runtime support: pointer checks, callbacks, extra Ms, C-to-Go call path — Done: no
lockOSThreadper cgo call (332719f7ce), PPC64LE cgo traceback (6fd1f825c1), crosscall2 frame (913fb18e7e),x_cgo_yieldinlining defeated (e0545faf27), darwin/arm panicmem without init function (69b0b3ad22,ae175f74cb). - Shared-library and buildmode entry points (c-archive, c-shared, plugin, shared) — Done: amd64/386/arm entry unification (
cf3f771203,30cb30e596,378de1ae43,d92aaa9707,c58b98b2d6), plugin re-enabled on darwin/amd64 (1134411a83), c-shared on ppc64le (3e7abf82e3), error not throw on duplicate plugin open (d8ae2156fe). - vDSO, time sources and process-wide randomness — Done: DT_GNU_HASH (
9065c3bf34), linux/386 vDSO (af40cbe83c), vdso_linux generalization (4477107b7b,c14dcfda6b), amd64 vDSO on large stack (a158382b1c), Sierra/High Sierra clocks (d8ff3d5920,2d6f941e8c), NetBSD monotonic (2065685664,66fcf45477). - Windows runtime — Done: 1 MB stacks on 386 (
77ea9f9f31),syscall.Exit(438c8f6b53). - CPU feature detection (
internal/cpu), auxv parsing andGODEBUG=cpu.*— Done: ppc64x detection (6661cf6dfd), x86 FMA (1a3230f281), x86 detection moved intointernal/cpu(66bfbd9ad7,b3ee6f0c2e,c4ee0e2a8b), cache line size 64 on arm64 (e0e7c03d14), ADX assembler support (44943aff33). - Assembly-level runtime entry points: memequal/cmp/IndexByte, hashing, atomics and ABI wrappers — Done:
eqstringremoved (3216e0cefa), ppc64x compare regression fixed (4641d78a59),systemstacktail call (15d6ab69fb),publicationBarriers390x (7fff1db060),sys.BigEndianbooleans (0c68b79e9c),RawSyscallpanics on Solaris (613f8cad90), Linux syscall number symbols (4d269ad175), usleep fixes (310be7be5c),getproccountfor non-multiple-of-8 affinity (eaf603601b). - Thread lifecycle, physical page size and scheduler-facing OS hooks — Done: thread exit (
eff2b2620d),lockedg/lockedmguintptr (165c15afa3), more CPUs on FreeBSD (a714470cce).
Other changes
- cgo and C interop internal — runtime/cgo, math: don’t use FP instructions for soft-float mips{,le} (
2708da0dc1); runtime/cgo: make code robust (51ba2bb819) - Darwin/iOS internal — user-visible runtime: fix exit1 arguments on Darwin (
91121ff704) - assembly, atomics and architecture internal — user-visible bytes: add optimized Equal for arm64 (
78ddf2741f); reflect: optimize CALLFN wrapper for arm64 (18508740b9) - signals and crashes internal — user-visible runtime: allow crash() to raise SIGABRT on darwin/arm64 (
7d80a2ea18); user-visible runtime: restore RSB for sigpanic call on mips64x (e5186895fc) - Linux, vDSO, time and auxv internal — user-visible runtime: move mincore from stubs.go to os_linux.go (
e9348ab4e9); runtime/internal/sys: use standard generated code header (0592a1a3de); user-visible runtime: give modulesSlice the correct type (0a7ef31d7d); user-visible runtime: remove commented out code from ARM Linux boot (b79e99bfb4); user-visible runtime: separate error result for mmap (193088b246); user-visible runtime: for kqueue treat EVFILT_READ with EV_EOF as permitting a write (23aad448b1); user-visible runtime: remove TODO (366f46fe00); user-visible runtime: remove another TODO (bf9ad7080d); user-visible runtime: pass dummy argc/argv correctly in r0_386_android_lib (6104939432) - other runtime/OS plumbing internal — all: unindent some big chunks of code (
59413d34c9); all: use Fatalf instead of Fatal if format is given (e858a6b9f0) - BSD, Solaris, AIX, Plan 9, NaCl internal — user-visible runtime: fix dragonfly/amd64 (
58c7b1d160); user-visible runtime: fix sysctl calling convention on netbsd/386 (70ee9b4a07); user-visible runtime: fix NetBSD CPU spin in lwp_park when CPU profiling is active (2ff2eab0d2)
Compiler frontend
From Compiler frontend (Go 1.10–1.17)
Export-data diet (skipping unreachable/duplicate inline bodies), better syntax-error recovery and line directives groundwork, and many small typechecker/map-lowering improvements; frontend still C-to-Go-translated gc.
- dev.regabi: from
*Nodestruct to their.Nodeinterface and concrete node types — Done: only groundwork: stringer-generatedOpandClassnames (3231d4e4ef,79dbc1cc7b,6e9960ea63), generic AST walking factored (12c9d753f8),OXFALLeliminated (4347baac7d),Localflags removed from Type/Node (b2e7eae7c4). Left open: nothing noted. - Indexed export format and the export-data lifecycle — Done: shrinking export work as described:
f0b3626904,8684534321,a509cae90d,13772edbbd,577967799c,c64e793850,3628c2d52f(no Markdcl/Popdcl in bimport); export-position precisionb976859b47,3124439b3a,a5b759aab8. Left open: still the sequential bimport/bexport format. - The syntax package: parser, scanner, source reader, positions and error recovery — Done: source buffer refilling bug (
e06a64a476), function-nesting recovery (68e390304e), list-parsing factor-out (645c661a54), missing-paren recovery (0b2cb89196), semi position (08e342d62c), function syntax representation documented (4b1f2bb688). Left open: nothing noted. - Language version gating (
-lang) and language changes implemented in the frontend — Done: user-visible:=may shadow dot-imported names (f22ef70254), non-constant shift indices (088a9ad543),main.mainmust be a function (3c375f1b7e). Left open: nothing noted. - Package initialization order, static initialisation and init functions — Done: static map initialisation (
91cb9edd5e),098126103e, map creation with small hints (fbfc2031a6,06a78b5737). Left open: nothing noted. - Concurrent compilation and frontend performance — Done:
99414a5b1d,f0b3626904,506386fd37. Left open: autogenerated functions serial. - Directives and pragmas in the frontend (
//go:handling) — Done:3a446d8652,8554fd6e7d(reserved import paths documented),41d3d153eb1.11 (1.11). Left open: nothing noted. - Inlining-related frontend work: export of bodies, type switches, closures, devirtualization — Done:
8684534321,7092a312e5. Left open: nothing noted. - The legacy typechecker: error quality, alias/recursive-type handling and type checking order — Done:
d05a1238d6,bb2f0da23a,25159d3af9,b77d9fe0ea,5f29a7a705,efa9efe8e4. Left open: nothing noted. - Lowering in order/walk and the shape of runtime calls emitted by the frontend — Done:
8a6e51aede,cbc4e5d9c4,fbfc2031a6,e0111bb0f4,53c8be4a8d,5a4b6bce37. Left open: nothing noted. - checkptr instrumentation and compiler debugging flags — Done:
7092a312e5,bd983a6d2e,f3d4ff7ddc. Left open: nothing noted. - Types package internals and type printing — Done:
2dd1f87d38,316e3036a7,f260ae6523,a53e853964. Left open: nothing noted.
Other changes
- Map, race and writebarrier tweaks internal —
06a78b5737,098126103e,943dd0fe33,5d39af9d9b,2fe53d8d55. - Go 1.10 tidy-ups internal —
9de7990054,3366f51544,180bfc4bd4,b2e8630f2f,6d33df1d65,83f0af1742,8bdf0b72b0,0168fdb552,ded2c65db3,fc5841af9e,270a789c52,bb45bc27b5,fcd32885df,7cb3e4fb1d,08b19a1c59;48e207d518fixesmapassign_fast*for pointer keys. - DWARF abstract origins fixes internal —
692f2e9c44,fdecaa837c,717d37591d,841d865a56. - cgo flag allow-list user-visible —
1dcb5836adrestricts#cgoflags (e.g. blocks-fplugin). - Misc frontend internal —
2f588ff08f-asmhdrwith aliases,71a9c4430fisdirectiface recursion,a509cae90d,d5960e3043,e59fe206e7closure structsNoalg,0fb82fbcceglobalboutremoved,99414a5b1d(see above). - Remove unused params and parser cleanups internal — Removed unused parameters in gc and factored out parsing of function bodies and parser tracing in syntax. (
3de8498b25,39edffb6b1,4b7325c7e3)
Middle end and SSA optimizer
From Middle end and SSA optimizer (Go 1.10–1.17)
Closing the SSA backend's first year: inlining closures with captures and refusing recover callers, location-list lifetimes, memmove-to-Move, stores to unread autos eliminated, and small-range loop simplification; walk shrank (print, select, order) and write barriers were already in SSA (threads: Inlining, Memory-op optimizations, Range loops, Write barriers, DWARF).
- Prove pass: unsatisfiability, partial-order facts, loop bounds-check elimination — Done: use right shifts to prove bounds so more checks vanish (
561b147e4b); loop finder made aware of irreducible loops (9e21e9c5cb, sets a function-level flag so the loop rotater is not confused). Left open: walk still emitted the bounds-check boundedness hints (commit says it will rely on these rules “when we eliminate boundedness checks from walk.go”). - Escape analysis: the esc.go fixes, the escape.go rewrite, and the move to package escape — Done: loop depth of range expression fix (
dbb1d198ab); Left open: esc.go design (AST walk, small leak encoding). - Inlining: budget, mid-stack inlining, closures, and what became inlinable — Done: closures with captures inlined (
c4b65fa4cc); better inliner diagnostics (475df0ebcc); simplifiedmkinlcall1(b80029ccf4); non-code nodes ignored (812b34efae);go:yeswritebarrierrecblocks inlining (4e64ee423c); broken accounting code removed (13bf4ada80); functions calling recover not inlined (b5b35be2b8); inline fixes for reassignments (483e298daa). Left open:-l=4mid-stack inlining unfinished (recoverwas the blocker). - Statement boundaries (is_stmt) and source positions through the optimizer — Done: line numbers in ssa.html (
edcf2d0cd6), explicit NoXPos for entry-block constants (f22cf7131a). Left open: no statement/non-statement distinction. - DWARF location lists from SSA — Done: keep float names (
788aa88cd0), more stack-slot names (a03480905b), name propagation (38c725b148), lifetime adjustment (d58d90152b), ssa dump files alphabetized (75f0ad705f). Left open: RegKill-based pipeline. - Switch lowering, select, and type switches in walk — Done: fixes for invalid switch case panics (
24ca86f308,39e523792e), value switches (bb45bc27b5). Left open: nothing noted. - Range loops, append and map idioms in walk — Done: range simplification (
743117a85e), single blank var handling (137e4a6c63), large-hint map bucket (6c102e141c). Left open: nothing noted. - Write-barrier elision and the writebarrier pass — Done: needwritebarrier removed (
e0111bb0f4), counter instead of loop (99c757adb5), notinheap elision (b78b54ff83,3a446d8652), typedslicecopy reporting (afbe646ab4). Left open: nothing noted. - Memory-op optimizations: memmove, Move/Zero, dead stores, nil checks — Done: unread-auto elimination (
744ebfde04), memmove with known size (f3884680fc), nil check after newobject (f1517ec6e5),nilcheckelim2copies (bad5abf64d), nil check before interface call (fa1f52c5f6). Left open: aliasing restrictions on memmove. - Arithmetic strength reduction, divisibility and intrinsics — Done:
a0453a180f,fb165eaffd,99fe3f8c63,0011cfbe2b, float constant propagation (9da29b687f,95b146e8eb), ppc64 Ctz (53bbddd527), soft-float routines for soft-float targets (6be1c09e19). Left open: lower-bound info on SSA values (“may trigger on more cases in the future”). - Compiler front of walk/order: ordering fixes and the dev.regabi IR refactor (package walk) — Done: walkprint simplified (
8b68fafd1f,a14a8a3eb9), OASOP order (34db5f0c4d), hiter type in order (9c3f268558), println fixes (02deb77f6d,4cff104771), panic frame info (7c8a9615c0). Left open: nothing noted. - Diagnostics for the optimizer: ssa.html, GOSSAFUNC and optimizer logging — Done: line numbers (
edcf2d0cd6), dump grouping (75f0ad705f). Left open: nothing noted.
Other changes
- Race, println and walk correctness internal — race instrumentation segfault (
4c8e8fc301), println and print/println of uint fixed (b65cffdcd8), mkcall argument mismatch made an error (8bbae3d5c9),unsafe.Pointerliveness for Syscall-like functions (840fad13ec), noopt builder weird append case (9d70b3ae04), zero-extension optimization disabled for Select on AMD64 (7f1c4b3afb), unsigned loads for multi-element comparisons (23e8e197b0), merge rules for panic calls fixed (41eabc0fc7), slices/strings over 2G not written (d7ac9bb992), pointer params turned into results (d5960e3043). - Frontend cleanups internal — fewer
linenouses (6013052e7d), removed gotos/redundant types/TODOs (7f88d3c121,71c9454f99,27a70ea560,f58c6c9915,1fbeccb15a),Class.Stringreplaces classnames (79dbc1cc7b), bad Ctypes (f14f7b3141),RegKillordering fix (63ef3cde33);runtime: remove link field from itab(04d6f982ae) and go/printer three-index slices (5d1addf45d) are cross-area.
Backends and assemblers
From Backends and assemblers (Go 1.7–1.11)
AVX/AVX2 assembler support via RestArgs, DWARF location lists and -gendwarfinl, math rounding and Abs intrinsics, ARM fused-op patterns, SSE zeroing on amd64, buffered write barrier compiler support (amd64), memory-op combining.
- Register allocation, flag allocation and stack slots — Done: rematerializable ops must not clobber flags, with a checker (
2cb61aa3f7);7dd279013bmarks ADD[Q|L]const rematerializable (reverted in the same cycle per2cb61aa3f7);e01eac371amarks LoweredGetCallerPC rematerializable;7eaa8efbe4. Left open: nothing noted. - Scheduling, tighten, block layout and CFG passes — Done: RPO traversal (
73f1a1a1a7),770d8d8207free values earlier in nilcheck,18b48afec9. Left open: nothing noted. - Rewrite-rule machinery and compile-time performance of the SSA compiler — Done:
1787ced894removes Symbol wrappers from Aux fields;ca360c3992better XPos for rematerialized values and JMPs;f22cf7131ausessrc.NoXPosfor entry-block constants. Left open: nothing noted. - Multi-architecture SSA ports: PPC64, MIPS64, MIPS32, s390x — Done: PPC64 math/Float64bits conversion rules (
40e25895e3), Abs/Copysign (4d0151ede5),622cfd8833not folding global addresses into load/store on PPC64 so temp register reloads are not repeated, little-endian consecutive-byte load/store merging (bb1fd3b5ff),b74b43de68requests R12 for indirect calls on ppc64le, s390x Abs/Copysign (96cdacb971) and rounding (7582494e06,4745604bcb),33c246ff92immediate sign extension fix. Left open: big-endian ppc64 merging “will be done later” (bb1fd3b5ff). - Liveness, stack maps, safepoints and write barriers — Done: buffered write barrier compiler support (
7e343134d3),0153a4130dfixes runtime.KeepAlive,e130dcf051aborts earlier on huge frames. Left open: buffered barrier only implemented on amd64 at this commit. - DWARF variable locations, statement positions and inline info from the backend — Done: dev.debug location tracking (
2d57d94ac3,4c54a047c6),-gendwarfinl(4435fcfd6c),3ba818c894distinguishing args from return values,6bbe1bc940,0b6b5641d7correct stack slots,d58d90152b,87f83eac7f,4a1be1e1daDW_AT_decl_line. Left open: location lists computed from regalloc liveness (replaced in 1.11). - Intrinsics for atomics, math/bits, math and runtime helpers — Done: math rounding and Abs intrinsics (
94484d8ed5,0f19e24da7,7582494e06,2f1f607b21,4745604bcb,fb05948d9e,4d0151ede5,96cdacb971), caller pc/sp (6cac100eef,6f3e5e637c), MIPS64 atomics (d63de28711). Left open: nothing noted. - Memory-op combining, byte-order idioms and load/store folding — Done:
9c99512d18,da34ddf24b,67fdf587dc,624630b824,6b8a3c8889,ac29f4d01c,bb1fd3b5ff,a2f22a6803indexed MOVB/MOVBU/MOVH/MOVHU on ARM,782ee23884redundant zero extension removal. Left open: big-endian ppc64 merging (bb1fd3b5ff). - amd64 and 386 instruction selection — Done:
df70982825,14cb41584d,adbfdfe377,a5868a47c6,a4e1a72f0a,ac29f4d01c,6b8a3c8889,7dd279013b. Left open: ADDconst rematerialization reverted (2cb61aa3f7). - ARM and ARM64 instruction selection and fused operations — Done: ARM fused ops and extensions (
a2f22a6803,64607dbd26,2899c3e8cb,a07176b45a,9732485851,1ec78d1dd1,78ea9a7129), ARM6407ec4385f1omit boolean zero extension,c02fc1605a. - Memory clearing and copying: Zero, Move and Duff’s device — Done:
df70982825,c02fc1605a,3fda3765b8(PPC64 rule regression fix). - cmd/internal/obj: Prog/LSym refactoring, concurrent backend and object-writing — Done:
8c67f210a1RestArgs,c35f239d52splitaenum.go/vex_optabs.gofrom the x86 assembler,a5868a47c6,918b98ca70restore dropped bounds checks. Left open: nothing noted. - x86 assembler: AVX, AVX2, AVX-512 and the instruction table — Done: RestArgs (
8c67f210a1), AVX/AVX2 (41fa265db0,c35f239d52,1e83f883c5,39de58bad7,4e19cfcdf2,49322ca9ed),a5868a47c6,0d65cd6c1c,5b043abe12restrict shift ops to 8-bit args. Left open: AVX-512 not yet. - ARM64 assembler — Done: the list in Design. Left open: assembler accepts forms it should reject (fixed 1.11:
9d72e8c6861.11,e351a160051.11,9594ba4fe51.11). - 32-bit ARM, MIPS and PPC64 assemblers — Done:
526f3420c2,3a165bba34, ARM VFP/ARMv6 (75cb22cb2f,074547a5ce,f727fa7939,0ed1c38017,9bf521b2b4,1ac8846984).
Other changes
- Runtime assembly user-visible — arm64
bytes.Countwith SIMD (9a14cd9e75), ppc64x IndexByte (be943df588), memclr arm64 with ZVA (b46d3988871.11, 1.11). - Inlining of local closures user-visible —
4f70a2a699. - Refactor internal — unexport gc names (
7537bb7b30,3b87defe4e),93471a1390. - MOVQconvert contract internal — resultInArg0 on x86 (
18b48afec9,a45d6859cb),40649e6979never use SP as index register. - fmt of generated code internal —
bd41c6783bGOSSAFUNC output. - DWARF/liveness fixes internal —
38bd725bf1,8c58900aeb,e1cf2be7a8,9372166faa,88c2fb9d04,0447216316,39983cf491,0d73f1e333. - Rules, assembler and port fixes internal —
1ce7442ec8,943dd0fe33,053840dc00,7846500a5a,55ac5b50b0,3f04db41a8,ded2c65db3,bb0bfd002a(c-shared on windows),290de1f880,14332ed5b8. - Renames and comments internal — Renamed line to pos in ssa, Rconv to rconv, and added or relocated comments (s390x SB addressing, plive, doasm, liveness, double spaces). (
99da8730b0)
Linker and object files
From Linker and object files (Go 1.10–1.17)
Code-health release for cmd/link: globals moved into Link, packages split out (object reader, sym, loadelf/loadmacho/loadpe), the PE writer rewritten around peFile/peSection, DWARF given one compilation unit per package, content-based build IDs, plus PIE/plugin/c-shared enablement across arches.
- Linker performance and memory engineering — Done: mostly code health:
SymKindshrunk to uint8 with attribute bits (1341104ae2,1b8987f1a7,253e605af4,302f0d1646), globals removed (5d95de2072,5fe9bbcf63,2e8545531e,6738c494ad,d05f82a11a,38cfeb9cb5), symbolAdd*as methods (0346664421), object reader andsymdata types split into packages (9f9bb97420,475d92ba4d,a910fe2c83), ldmacho/loadelf/loadpe moved to own packages (f7ad3a04f9,ecfa7375e4,d06815ba3f),Cwriteinstead of unrolled loops (f84a1db19f). Left open: nothing noted. - Dead-code elimination and method pruning — Done: nothing substantive in this slice. Left open: nothing noted.
- DWARF generation in the linker — Done: CU per package (
d4dda76b5f), producer flags (2c1d2e06af), file reference relocs (b52b77cb95), no compilation dir (2f170520aa,4a3d408d18), range lists without base selectors (018642d6cf),a0402b6bf8avoids relocs that confuse dsymutil, constants (9daee93121,7830a19a4f),c58b98b2d6hasmain bit in moduledata, DW_AT_data_member_location as constant (37dbfc51b0), go.info syms not created for non-Go functions (6d7db25e5c). Left open:24e4a128c9disables DWARF for plugins and programs using plugin.Open because type mangling is incompatible with the go.info generator. - Mach-O and Darwin support — Done:
b7c600d6baenablesbuildmode=pieon darwin/amd64, plugin on darwin/amd64 re-enabled (1134411a83),1f8433c66ano duplicate dylib,90ffc40e4fcorrect file flag,89a7adf8e4/4a5b99c3a8pagezero size for iOS,e285f39248ignore macho symbols in invalid sections,f797e485e0fix runtime.text twice with plugins,3e1e66fa05don’t pass -gdwarf-2 to external linker. Left open: nothing noted. - PE / Windows — Done: the peFile/peSection refactor (representative:
20832e6d4b,2c3d13b210,7188e00287,04d410d6cd,ce54a0c10a,d77d4f509c),410b73728f/f58c48f834isolate Windows-specific code,bb0bfd002ac-shared on Windows,923299a6b8stack commit size back to 4KB,77ea9f9f311MB stacks for 32-bit. Left open: nothing noted. - Build modes: PIE, plugin, c-shared, c-archive, shared libraries — Done: PIE on darwin/amd64 (
b7c600d6ba), plugin on ppc64le (e9cbabb334), c-shared on ppc64le (3e7abf82e3), c-shared on windows (bb0bfd002a), c-shared/c-archive on s390x (c2efb2fde5), plugin on darwin/amd64 re-enabled (1134411a83,88a1e85c70,f797e485e0),273b657b4e.c99cfd93a8forbids internal linking for cgo on ppc64 (multiple TOC sections). Left open: the ppc64 internal linker cannot handle multiple TOC sections; plugins and DWARF were incompatible (24e4a128c9). - Host object loading and external linking — Done:
8e5ac83d43,1053ae5cf5(goobj parses native objects in the archive),589ea93678(nm handles cgo archive),4eca0898ec/0c4d035ca8refactors,ef6978b218R_X86_64_PC64 relocations,2763672ecbnative relocation type names in errors,cd5c10f040ELF note alignment,ba42b3ffd3sniff runtime-gdb.py path,6424c40c22no default entry symbol in some situations,8396015e80setsruntime.GOROOTdefault at link time user-visible (so a moved toolchain reports its relocated root),28639df158apply -X after symbol load. Left open: nothing noted. - Architecture ports and trampoline insertion — Done: GOMIPS (
12abacb555), s390x modes (c2efb2fde5). Left open: nothing noted. - Build identity, buildinfo and reproducibility — Done:
7dea509703,840f2c167fstandard-Voutput,0be2d52eba-importcfg. Left open: nothing noted. - Linker restructuring (1.10 code health and error reporting) — Done: the commits above, SymKind attribute bit extraction (
1341104ae2,1b8987f1a7,302f0d1646),0c4d035ca8*relocrefactor,e29efbcbcbfixes unintentional symbol creation,d02647242dchecks the magic header. Left open: nothing noted.
Other changes
- Remaining PE writer refactor steps internal — the ~25 small commits that turn
pe.gointopeFile/peSectionmethods:2c2b172377,babc5b1dd6,6aa386686c,a9257b6b69,1d53fc5123,2b0e9e8e9e,c3552a9050,97246527e8,44211c14e4,7f7be843e9,3558c16d48,64985505b0,72967551e5,6f299c7f7e,6561e4b61c,84af5ea9b4,2034297bdb,fe1ccc5b88,ac9be2020b,cb3fe3aa0d,6a537c1d47,b7397c8100. - Small cleanups and fixes internal —
342d25fc05,37b04c9062,5b43bbe63b,1ee701e857,bce795fb1f,1e093043e7,0e2cde7c69,ed815d0038,da4d740fc8,ce6e0b089f,8ce8143f10,7bd0b61000,f22ba1f247/5e42658fc0(reverted by90d71fe99e); fixes064ae118c1(runtime/cgo detection with -linkshared),6eef2bb5ee(file leak in ldshlibsyms),350b74bc4b(zero symtab fields),c996d07fee(module data on ppc64le);59fe2fbfe5lets the linker combine.debug_ranges. - ARM ELF flags internal —
b2d3d6e676fixes computation of ELF flags when loading ARM objects. - Pagezero and iOS validation internal —
89a7adf8e4,4a5b99c3a8change-pagezero_sizefor iTunes Connect only on darwin/arm64. - Windows stack commit user-visible —
923299a6b8restores 4KB stack commit size;77ea9f9f31always uses 1MB stacks on 32-bit Windows. -Xfor plugins and after symbol loading user-visible —273b657b4e,28639df158.- Export data truncation internal —
5e423ed855fixes a bug where export data was truncated. - Misc compiler DWARF internal —
88c2fb9d04unused autos in DWARF inlining,5e1dcb7a04receiver position workaround,d7ac9bb992do not write slices/strings over 2GB. - Search for dylibs and entries internal —
1f8433c66a,6424c40c22. - Linker cleanups internal — Various tool-driven and simple cleanups, and macho_combine_dwarf.go code cleanup. (
966c459fa4)