Go 1.6
GC pause work: root jobs in workers, decentralised state machine. Hand-written parser replaces yacc. cgo pointer checks (cgocheck). mips64. PIE and shared libraries on more architectures. MSan. Concurrent-map-misuse detection.
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)
Pause work: root jobs in workers, STW loops removed, decentralised state machine, background GC goroutine removed.
- Concurrent sweep and proportional sweep — Done: remove the in-use page loop and the sweep-wait loop from the STW phases (
dac220b0a9,9a31d38f65); sweep termination decentralised (9630c47e8c,a51905fa04); credit fixes (7407d8e582,6383fb6152,87d939dee8,c1cbe5b577,ff5c945382); simplifiedmSpan_Sweep(70462f90ec). Left open: nothing noted. - Concurrent mark: write barriers and the dev.garbage collector — Done: concurrent scan and mark-2 root rescans performed by GC workers (
82d14d77da,fbf273250f); span roots, data/BSS root marking partitioned into 256K chunks (d3df04cd8c); finalizer-bearing objects scanned concurrently (608c1b0d56); STW loops over all spans removed (dac220b0a9,9a31d38f65); work buffers 256 B → larger (1870572180), two cached workbufs per gcWork to cut flapping (b6c0934a9b),work.partialremoved (feb92a8e8c), eager balancing of buffers (9439fa1078);GODEBUG=cgocheck=2uses the barrier to detect Go pointers written to non-Go memory (be1ef46775) user-visible. Left open: stack re-scan in mark termination still O(# stacks); fixed in 1.7 (2a889b9d931.7) and removed in 1.8 (hybrid barrier). - Decentralized GC state machine and mark termination simplification — Done: decentralised start, sweep termination, mark done (
f54bcedce1,9630c47e8c,a51905fa04,12e23f05ff,c99d7f7f85,171204b561,3842596284), GC coordinator goroutine removed (d5ba582166,bbf2da00fc),gcModetype (fbd2660af3),GCstwphase removed (a42f668654), state lifted intowork(1959621584,b0d5e5c500,3cd56b4dca). Left open: mark 2 and gchelper still present. - GC pacer: trigger controller, assists and background utilisation — Done: direct per-G assist balance, assists before allocating, preemptible, park/ready (
89c341c5e9,65aa2da617,456528304d,15aa6bbd5a), heap distance (9e77c89868), proportional sweep fixes (7407d8e582,6383fb6152,87d939dee8). Left open: nothing noted. - Finalizers and span specials — Done: concurrent scan of finalizer objects (
608c1b0d56), tiny-alloc finalization fix (bf606094ee). Left open: nothing noted. - Mark work distribution: parfor, work buffers, gcWork and root jobs — Done: root jobs and buffers (
572f08a064,d3df04cd8c,1870572180,b6c0934a9b,9439fa1078,feb92a8e8c,62ba520b23,dcd9e5bc0f), mark workers attached to P after parking (eb3b1830b0). Left open: nothing noted. - Allocation-site profiling and GC debugging modes — Done:
cgocheck=2(be1ef46775) user-visible. Left open: nothing noted.
Other changes
- Closed GC races internal — tiny-allocator clear in mark termination (
835c83b40d,4d39bb6a3a), stat underflow (97dc591534), sleep/wakeup of assists (b05f18e3f7). - Diagnostics and API hygiene internal — pointer diagnostics (
b7c55ba496,97b64d88eb,b307910b6e,14aacc2fd8,26397f1383), assist/drain consolidation (39ed682206,9b3cdaf0a3,c18b163c15,4cca1cc05e,28f458ce5b,d986bf2741,1698018955,4ac4085f8e), stack span freeing outside STW (56ad88b1ff), nowritebarrierrec annotations (ab9d5f38be,27df2e3f76), stack barrier races (a4a57bb4f9,d446ba99a4), sweep trace (4ad64cadf8,1e1ea66991), unsafe clean-ups (4c2465d47d,4562784bae,c279250946,7df8ba136c,29330c118d,4ff231bca1,c17c42e8a5,ee0305e036,7d1d642956), Plan 9/Windows (31430bda09,1cb53ce36b). - Update gcController.scanWork regularly internal — The GC controller now updates scanWork regularly during scanning. (
8e8219deb5)
Scheduler and concurrency
From Scheduler and concurrency runtime (Go 1.0–1.17)
Simplified buffered channels, fewer thread wakeups, GC-work handoff; threads: channels, scheduler.
- The G-M-P scheduler: from global-lock M:N to per-P run queues, spinning Ms and work stealing — Done: only spinning Ms wake new spinning Ms (fewer thread wakeups)
fb6f8a96f2;p.runqas[]guintptr0ca4488cc1; nmspinning comparison fix3efe36d4c4; handoff P starts an M when only GC work exists (deadlock with locked Gs)f309bf3eef; unnecessary worker wakeups removed; proc1.go merged into proc.go386fa03609. - Network poller: from the netFD select loop to the runtime-integrated epoll/kqueue/IOCP poller — Done: throw on unexpected netpoll error instead of looping
b6d115a583. - Channels and select — Done: simplified buffered channels
8e496f1d69,e410a527b2. - sync.Map, atomic.Value and sync/atomic — Done: mips64
d58081cf0a. - Goroutine and M lifecycle: caches, ids, LockOSThread, Goexit, cgo extra Ms, deadlock detection — Done: NumGoroutine/Stack agree on excluding system goroutines
c5bafc8281,fac8202c3f. - Stop-the-world, safe points and GC–scheduler interaction — Done: stack barrier lock for traceback
f90b48e0d3,3f22adecc7,d446ba99a4; mark workers attach to P after parkingeb3b1830b0,09940b92a0; P handoff starts M for GC workf309bf3eef; forced GC only when not running01baf13ba5; idle mark workers not started when barriers cleared20f276e237.
Other changes
- Signal handling and cgo internal —
a7d2b4d7ce,70c9a8187a,934e055f41,7af0839e11. - Windows/trace fixes internal —
001a75a74c,f32f2954fb(never allocate new M when jumping time forward),7b767f4e52(internal/race). - Tracing/profiling safety internal —
03227bb55e(traceBufPtr to avoid write barriers in sysmon/scheduler),50d8d4e834,b50b24837d,9c04d00214,86f1944e86,5a68eb9f25,0abf443513.
Data structures and type metadata
From Runtime data structures and type metadata (Go 1.0–1.17)
Atomic pointer writes in memmove/memclr, aeshash DoS hardening, removal of type.zero, concurrent-map-misuse detection.
- Hash map core: from the first hashmap.c to the 8-entry bucket design — Done: stop returning
t.zeroon a miss (38519e69d0,af78482d6b), skip key overwrite on update when not needed (00c638d243), best-effort detection of concurrent map misuse via a flag next toh.count(50c5042047). - Hash functions and algorithm tables: memhash, AES hash, fallback hash — Done: aeshash DoS hardening (
91059de095). - Runtime type descriptors: layout, shrinking and name encoding — Done:
zerofield removed (af78482d6b),_Kindconstants removed (2961cab965), methods sorted withsort.Interface(bca70a66a7). - Interface values, itabs and type assertions — Done: type-safe iface/eface (
84afa1be76),convT2E/Irace read (9172a1b573). - memmove, memclr, duff routines and pointer-write atomicity — Done: duffzero/duffcopy amd64 (
2421c6e3df,5cf281a9b7), pointer-atomic memmove/memclr (4b7d5f0b94,2c911143fd,168a51b3a1,9f6df6c940), ppc64 NOFRAME (45c06b27a4). - internal/bytealg and string/byte comparison primitives — Done: ppc64 and identical-slice shortcut (
32d3b96e8b,805e56ef47). - Strings: concatenation, conversion and printing helpers — Done: string files merged and
stringStructOf(881b0e7880,d4a7ea1b71), stack buffer fix (4d02b12417). - Soft-float, 64-bit division and complex arithmetic helpers — Done: “add r11, pc, r11” (
40af15f28e), mips64 support in reflect and runtime asm (559fb85af6,424738e43e).
Other changes
- Reflect and msan internal — runtime package identified via
myimportpath(45c3cf68b0),reflect.mapassignnoescape (8d31a86a1e), msan calls (73f329f472), embedded unexported structs RO and access (adf9b30e55,afe9837b23), DeepEqual NaN-key and unsafe.Pointer handling (a77182f47f,928fe05a4f).
Diagnostics and knobs
From Diagnostics and knobs (Go 1.0–1.17)
msan runtime support; tracer made free of write barriers; debug.SetTraceback; panic frames restored in tracebacks.
- Execution tracer (trace v1): events, per-goroutine sequencing, annotations — Done: write barriers eliminated from the tracer so it can be called from sysmon and the scheduler:
traceBufPtrreplaces*traceBuf(03227bb55e), the same fortraceStackandtraceAllocBlock(2be1ed80c5,e9aef43d87),traceBufslice replaced by an index (f5c42cf88e); blocking-syscall tracing made identical forentersyscallandentersyscallblock(001a75a74c); hashing of trace stacks fixed (739f133837); stack lock acquired intraceEvent(08594ac7c7). Left open: nothing noted beyond the sequencer cost. - Race detector integration — Done:
race1.gomerged intorace.go(243757576d); instrumented calls have a type width (9179c9cb5c). Left open: nothing noted. - CPU profiler and runtime/pprof writers (legacy format to compressed protobuf) — Done: SIGPROF handled inside stack barriers (
3a2fc06833);GoroutineProfilefixes (313fd1cb13,d9fdbf4820); documentation ofSetCPUProfilewith c-archive/c-shared (7688ffe134). Left open: nothing noted. - Heap profile accounting and MemStats — Done: GC/MemProfile interaction documented (
08b80ca880). Left open: nothing noted. - GODEBUG, runtime/debug, debug log and traceback knobs — Done: user-visible
debug.SetTraceback(bb0567b304); panics shown in tracebacks again,gopanicrewritten topanic(0c02bc009a);GODEBUGdoc pointers to net and net/http (cd91c3b036);debug.Stackviaruntime.Stack(2d697b2401). Left open: nothing noted. - MSan and sanitizer integration — Done: user-visible msan runtime support, with calls inserted by
-msan(5174df9087);msanreadskipped on the system stack (880a689124). Left open:msanmalloc/msanfree“will be from other runtime functions in a subsequent CL”.
Other changes
- Stack barriers internal —
sigprofin stackBarrier, check and debugging (cb859021d1,a7c09ad4fb); write barriers out ofgentraceback(b43b375c6c); scan state in goroutine header (c7c7c7031d); linkname instead of assembly stubs forruntime/debug(42c7929c04); literals janitoring (4f33436004);-racenit (1babba2e4c).
OS layer, stacks and panics
From OS interface, stacks and panics (Go 1.5–1.17)
cgo pointer checks (GODEBUG=cgocheck), GOTRACEBACK=single, runtime/internal/{sys,atomic}, the pcvalue cache, mips64 and android/{386,amd64,arm64} ports, c-archive/c-shared signal handling and addmoduledata for shared builds.
- New and ported OS/arch targets, 1.5–1.17 — Done: linux/mips64 and mips64le files (
a36dda7880,980b00f55b,e0053f8b1c,846a9adf05,b2b8559987), android/amd64 syscalls and TLS (30ee5919bd,dfc8649854), android/arm64 (ce8f49f42f,4480d6a927,c091d4cd25,d26a0952a8, c-shared73ff7cb1ed), android/386 (34db31d5f5,05c4c6e2f4,b2259dcef0,90e26f52c6),runtime/internal/sysmachinery (432cb66f16,c3ba74931f,d3498c5abd), a 64 kB system stack on arm (21f35b33c2), and larger frames/stack limits on ppc64 (c83c806535,c1b6e392f5,b8f8969fbd,a4855812e2). Left open: mips64 cgo and runtime tail landed in 1.7. - Goroutine stack growth, shrinking, GC stack barriers and stack objects — Done: merged
stack1.go/stack2.go(db2e73faeb), barrier sync checks (77e528293b,bb6fb929d6,ecf388f3a4,e2bb03f175), recycling large stack spans (0cbf8d13a7),pcvaluecache for stack scan (beedb1ec33: Issue10898 16.5 s to 9.2 s), 64 kB system stack on arm (21f35b33c2). - Tracebacks, symbol tables and
runtime.Callers/CallersFrames— Done:pcvaluecache (beedb1ec33),GOTRACEBACK=singledefault (bf1de1b141), cgo pointer-check debugging prints (166cfd2c87). - Defer, panic, recover and Goexit (runtime side) — Done:
panic1.gomerged intopanic.go(9358f7fa61), Go/cgo exported function may not return Go pointers (0e2c635788). - Signals: masks, forwarding, sigaltstack and the unified Unix signal layer — Done: c-archive/shared signal handling (
fbdfa99246,21b4f234c7,a7d2b4d7ce,e24b2445b4,a7cad52e04,f7e51c1320),SIGCONT/SIGTSTP/SIGCANCELpolicy (81b35117d9,3fd19fdc51), allowsignal.Ignoreof user-generated throwing signals (81adfa508a),nowritebarrierrecin signal path (84a95be922,e126f30a66),m.sigmasktypedsigset(7db77271e4,a7383fc467), drop signal stack on NetBSD/DragonFly threads and related (4c4476c297,123510bf83,801bebefa9,aea4de80f9), Darwin sigaltstack fixes (f40c05eea4,0408ca7de1,fb30270037), OS X TRAP bug (331a6055ab),sigfwdstack alignment (2d916bec96), pthread_sigmask on darwin arm (e884334b55), SIGRTMAX qemu workaround (d10675089d), SIGEMT on mips64 (68c6aad58b), signal-handler sigpanic via r12 on ppc64 (f000523018),sigsetstackon Solaris (956535f5cb), exit status (2c67c8c303), integer compare fix (b9fde8605e), drop unneeded sigfwd on unsupported platforms (9fb79380f0),sigreturnstub (31322996fd),sigsendcompare (a94e906c41),EPIPEbehaviour (58c73de7d0). - cgo runtime support: pointer checks, callbacks, extra Ms, C-to-Go call path — Done: pointer checks (
9dcc58c3d1,0e2c635788,d91ec5bb40,e97096661e,dd6753a6f2,166cfd2c87,387d5b8cfb), msan with cgo (0c1f0549b8),asmcgocallwithout a g (3af29fb858), Solaris syscall without g (35a5bd6431), dropm on arm/arm64/ppc64/mips64 (c02aa463db), ppc64le cgocallback (3dda43c6aa), mmap in cgo avoids write barrier (b3c05f08a9). - Shared-library and buildmode entry points (c-archive, c-shared, plugin, shared) — Done: arm64 and arm
addmoduledata(4e3deae96d,1b4d28f8cf), ppc64le (1ccefcd1b8), 386 (09d7de8d61), shared-mode tweaks (c5856cfdb6,35d71d6727), darwin/386 (47ccf96a95), arm64 c-shared (73ff7cb1ed), PIC vsyscall on 386 (bc3f14fd2a,6056cc5df6,7af0839e11). - Windows runtime — Done:
WriteConsolefor print/panic (d958881271),NumCPUwith affinity (6410e67a1e),timeBeginPeriodremoval then revert (ab4c9298b8in 1.7),msvcrtlink (0b5bcf53ee), larger assumed stack in handlers (fdf9b3c994),usleep2params (d7c12042bf). - Assembly-level runtime entry points: memequal/cmp/IndexByte, hashing, atomics and ABI wrappers — Done: ppc64 cmpstring (
32d3b96e8b), DOS-proof aeshash (91059de095,731bdc5115), atomics package (67faca7d9c,b2b8559987,80d0b98d80,040932869e), MMX check on 386 and no prefetch on 386 (35e84546d7,0adf6dce8a), no CMOV on 386 (8c9ef9dd0a), asm index for short strings (95333aea53). - Plan 9 and NaCl ports — Done: Plan 9 abort notes (
d093bf489b), mOS split (58e3ae2fae).
Other changes
- assembly, atomics and architecture internal — user-visible bytes: improve Compare function on amd64 for large byte arrays (
32add8d7c8) - cgo and C interop internal — runtime/cgo: remove __stack_chk_fail_local (
db5eb2a2c3); user-visible runtime: fixes for arm64 shared libraries (9f0baca505); runtime/cgo: export _cgo_reginit on ppc64x (8537ff8a39); user-visible runtime: mark cgo callback results as written for msan (8f3f2ccac0); runtime/cgo: assume Solaris thread stack is at least 1 MB (cd58f44b20); runtime/cgo: more +build cgo tags (3a21f0a9c1) - Linux, vDSO, time and auxv internal — user-visible runtime: add a missing hex conversion (
24be0997a2); user-visible runtime: check that masks and shifts are correct aligned (3583a44ed2); user-visible runtime: move arch1_$GOARCH.go into arch_$GOARCH.go (1cf05ee612); user-visible runtime: remove redundant type cast (3be4d59820); user-visible runtime: remove a redundant nil pointer check (5d88323fa6); user-visible runtime: change odd ‘print1_write’ file names (ef986fa3fc); user-visible runtime: move m’s OS-specific semaphore fields into mOS (ec9aae772c); user-visible runtime: copy sqrt normalization bugfix from math (fb7178e7cc); user-visible runtime: delete runtime/internal/atomic/textflag.h (7c38ae084e); user-visible runtime: replace tls0 with m0.tls (7bb38f6e47); user-visible runtime: remove zgoarch_*.go files (06eb504ca4); user-visible runtime: fix conflict resolution in golang.org/cl/14207 (fd2bc8681d); user-visible runtime: remove erroneous go:noescape declaration (28f9d96c75); user-visible runtime: remove redundant empty function call from Breakpoint on arm (d326a96419) - BSD, Solaris, AIX, Plan 9, NaCl internal — all: use one ‘l’ when cancelling everywhere except Solaris (
67ddae87b9); user-visible runtime: return errno value from Solaris mmap as expected (c93193aec0) - other runtime/OS plumbing internal — pprof: improve sampling for heap profiling (
27ee719fb3) - signals and crashes internal — user-visible runtime, os/signal: use //go:linkname instead of assembly stubs to get access to runtime functions (
0b8d583320); user-visible runtime: fix errno sign for some mmap and mincore cases (cc0a04d351) - Darwin/iOS internal — user-visible runtime: fix darwin/arm64 build (
c5a2f364d3) - Generated zgoarch update and newosproc internal — Regenerated zgoarch_*.go and made newosproc asm access m.id directly. (
15b51d6ae6,dbdd8c2c94)
Compiler frontend
From Compiler frontend (Go 1.1–1.9)
Hand-written recursive-descent parser replaces yacc, compact binary export data under -newexport, captureless-closure constants, go:noinline, -msan, mass NodeList→slice cleanup.
- The C-to-Go translation of the compiler (cmd/gc → cmd/internal/gc → cmd/compile/internal/gc) — Done: leftovers cleaned:
cb0e98b833“fix some C to Go translation leftovers”,dd42eff8fe/703bd83623/22452ac592/dab0dac01a/391cc54da8/bab01a0b4b/d5fe165ca0/a2119aca7d/b9dbb030d5convert ad-hocNodeListuses to[]*Node,8712e1867b/8937780c8a/e03c7896a7/9ac0fff70a/a20fbe8e18bool conversions,cd7d7382bband53d43cb556introduce types for decl contexts and untyped constant kinds;b569b87ca1replaces yacc (see parser thread). Left open:NodeListitself. - Parser: from yacc to a hand-written recursive-descent parser — Done:
b569b87ca1recursive-descent parser (default),b5fe07710fyacc removed,247959d9b8rejects identifiers beginning with a non-ASCII digit,e18cd34c76correct line for:=,fe762b6466parenthesized go/defer message. Left open: gc’s parser still buildsNodes directly, not a separate AST. - Binary export data and the object-file split — Done: user-visible
ae2f54a771binary format behind-newexport,3d3bc88bb5export list as slice,e6ccfc1ad1,92ba69d216,91c8e5f80b,d37d76af43,ab5d2bf92f(don’t export Note field in bodies),feb2a5d610. Left open: no inline bodies in binary form; not default. - Closures, method values and variable capture — Done:
4f97ec0866. - Language changes and rules as implemented in the compiler — Done: user-visible
336c998291,be20948e27,27691fa467,c488548967,d6a203ecab,67722fea50,8a34cf7ee0(no blank methods on builtins),b60c8203ea. - Constant arithmetic,
Mpint/Mpfltand floating-point constants — Done:85de30e72f,c396c047c6(remove restriction on float exponent parsing),76285213b8,79a3b561b5,ddbc802b07,2c11164db5,715f63778d,732e2cd746,50fa646776. - Static initialization, composite literals and
init— Done:4f97ec0866,aaabe3d849,1ca7a64a0d. - Walk-level lowering and runtime-call optimisations — Done:
eddd7ff3cd,bca70a66a7. - Write barriers, precise stacks and liveness (compiler side) — Done:
3a765430c1,402e37d4a9,dac87e9ed3(systemstack only in runtime). - Compiler data structures:
Node,Nodes,Type, and thetypespackage — Done:[]*Nodemigrations (703bd83623,22452ac592,dab0dac01a,391cc54da8,bab01a0b4b,d5fe165ca0,a2119aca7d,b9dbb030d5,dd42eff8fe), bool conversions. - Pragmas, directives and compiler flags — Done: user-visible
a92543e1a1,3a765430c1,0c69f1303f,dac87e9ed3,876b7cc227,3ae4dc8a75,78c05b8657. - Race detector and sanitizer instrumentation in the frontend — Done: user-visible
9e902f0f3a,0c69f1303f.
Other changes
- Misc internal —
acc90c53e8,7ebb96a489,68f4f96c1e,2dc63d1544,211cdf1e00,67ddae87b9,ffe743945f,d08f34e744,89a68e9f1a,70da2d0a2a(ICE on invalid declaration),684218e135,f2eb3de636,12126752cc,23791ee11d,52f111fb34(BOM corner-case),de2bc5722d,7218b79f23,af8cd3f6bd,8ae423ef84,c7a3403140,918a2644f2,34cbccd341,87a65f6ce7,0bad50f2a4,fe762b6466,a20556bf56,662ab8be31,de531fc255,5395846890,d9b32f0c7d,7ce2402bae,a8fc547f78,92ba69d216,ab5d2bf92f,dace9397b1,c1ad904bdb; ,888aadfa60(android/386 pie). - Dead code and string-compare removal internal —
dc3540d982,7c61d24f97(deadcode-tool findings: hunk allocator,applywritebarrier_bv, etc.),6d0178359f,c73df92be6(stringsCompareremoved),8f931e49f5. - Vendored math/big updates internal — Updated the compiler’s vendored copy of math/big. (
548041ed08,a4599efcfb) - Comment updates in gc internal — Updated old C-style comments, go.y references and added comments on how declarations and scopes work. (
6327e8dc69)
Middle end and SSA optimizer
From Middle end and SSA optimizer (Go 1.0–1.9)
Escape precision for variadic args and loop levels; string compare cleanup (threads: escape analysis, copies/strings).
- Escape analysis (esc.c → esc.go) — Done:
f7a39a54e9,745cdc3ad7,e779bfa5d2. Left open: nothing noted. - Write-barrier insertion: from gc to the SSA writebarrier pass — Done:
85dd62d5dd. Left open: nothing noted. - Lowering of copies, strings and slices; intrinsics — Done:
eddd7ff3cd,c73df92be6,7eb94db44c,423b0cc25a. Left open: nothing noted.
Other changes
- Fixes and diagnostics internal —
05a3b1fce5,9238cbd57a,8b1b81f463,336c998291,22a204dd0f,63a6f305ef.
Backends and assemblers
From Backends and assemblers (Go 1.0–1.6)
mips64 port; position-independent code on ppc64le, arm, arm64, 386; AVX/VEX assembler support and AVX2 runtime assembly; code layout split from object writing. Threads: mips64, PIC/TLS, assemblers, zeroing/copying.
- Per-architecture compilers 6g/8g/5g/9g and the shared gc code generator — Done: mips64 back end copied from ppc64 (
14f919578d,d5cd4ab46a);Etype/Opnamed types and bool fields (8e7a3ea11e,8712e1867b,259466452d,05c35ac5d1); 387 builds stop usingfucomi*(3d01f28e47). Left open: the SSA backend (dev.ssa) was the planned replacement for amd64 in 1.7. - Register allocation and the peephole optimizer (reg.c, peep.c) — Done: register fix for
==(6ec1809b83), regopt must not use REGTMP on ppc64 or CX in PIC (0357c38adf,61da0e92d0,9514285da9); AVARLIVE in peep for arm/arm64/mips64/ppc64 (5f23bc8903); duffcopy clobbering X0 (ffb20631fc,0bef88aa5f). - Expression and statement code quality in 6g/8g/5g (division, bounds checks, loops, slices, interfaces) — Done: test-first-field-of-struct special case for amd64 and 386 (
9aed0b7e3d,f3b064ae01), magic-multiply no longer smashes AX (03c8164849), write barrier on type switch (e3033fc535), Syscall-like functions for liveness (1ac637c766),args_stackmapnot forfunc _(292ad59291). - Stack frames, pointer maps and liveness analysis in the compiler — Done: Syscall-like assembly functions recognised for liveness so arguments stay live for the whole call (
1ac637c766); noargs_stackmapforfunc _(292ad59291);AVARLIVEin peephole passes (5f23bc8903). - Stack frame layout, prologues, stack split and frame pointers — Done: x86 functions aligned and padded with INT $3 (0xCC) rather than 0x00 which can decode as valid instructions (
7d2c6eb3f5); PCSP table fixed atmorestackcalls (66f1f89dc0); fixed stack part centralised (97055dc1f1); ppc64x stack limit raised (c1b6e392f5); stack barriers in ppc64le shared libs (3a1bed82a6). - Zeroing and copying: Duff’s device, REP, unaligned moves and AVX2 runtime assembly — Done: MOVUPS-based duffzero (
2421c6e3df), AVX2 versions ofCompare, string compare,IndexByteandmemclr(0e23ca41d9,967564be7e,321a40721bup to -49% at 4K,b597e1ed54), SSE4.1Floor/Ceil(37cfb2e07e, ~-30%), duffcopy clobbers X0 (ffb20631fc,0bef88aa5f). - Normalising Prog/Addr in cmd/internal/obj (the portable instruction representation) — Done: code layout (
span) separated from object writing so the compiler could lay out each function as it is compiled, “should reduce the working set of the compiler. But not until Go 1.7” (ed03dab853); Tlsoffset removal (7bf959c67a); ProgInfo layout (b795ce9ab0). - Assemblers: 5a/6a/8a/9a and the Go cmd/asm — Done: robustness against fuzzing (
7437e3f02e,df37c4b987,63e2bed0ab,5e89acb580,980cb0caf2,173bf3487f,49580db149,49065cbfe4), nested#if(eaea5ade2b), more than one encoding error reported (36edf48a10),-eflag (02717bdc20), mips64 (43ea305435), ARMCMPF/CMPD(36af087aef), arm64 condition-code aliases (61a3ebed55); x86: YMM registers (d2b0c387b2), VEX encodings VZEROUPPER, VMOVDQU, VMOVDQA, VMOVNTDQ (9dd81d6227), then “correct, complete” AVX (8d881b811d), BMI-stylePDEP/PEXT(0bae38e094),POPCNT(d3ff40fb1f,7f620a57d0),HADDPD/HADDPS(e634765941), requested amd64 instructions (863d9b66f8), TSX (e9081b3c76), PSRLW fix (d96b4c494f), rejectfoo(SB)(AX)(9d6427d899). - C→Go translation of the toolchain (liblink, assemblers, compilers; dev.cc) — Done: janitoring of map/slice literals and gc (
3c37a61455,7d48573d46,90f69259ec,932c1e3dd3,dd42eff8fe,3e476827a6,6d0178359f,ea4e321d4d). - The ppc64 / ppc64le port (dev.power64, 9g/9a/9l) — Done: the PIC/TOC work listed above,
SRADCCimmediate assembly (10c0753761), epilogue for non-leaf generated methods (710b9ad617),archrelocsimplification (d821ae2a9e). - The arm64 (ARMv8) port (7g/7a/7l) — Done:
3a9bc571b0,72180c3b82,3534e2bef4,80d9106487,2a031e6a2a,73d590b4bd,3578bdf3c3,61a3ebed55,5f23bc8903. - The mips64 port and the mips/mips64 register space — Done: the above. Left open: nothing noted besides that the port starts with the ppc64 structure.
- Position-independent code, dynamic linking and TLS in the assemblers — Done: the list above. Left open: “the make TLS make sense project has quite a few more steps to go” (
9e6ba37b86).
Other changes
- Source paths in standard library objects user-visible —
$GOROOT/src/...substituted by the linker with the actual$GOROOT/GOROOT_FINALso binary distributions in other locations show valid paths (83746fd55a). - -h spam, AUSEFIELD internal —
1d901f55bd,0b37a6f47b(ignore AUSEFIELD underGOEXPERIMENT=fieldtrack). - CASE/BCASE removed internal —
3578bdf3c3,8d478e845c. - Stack/ARM/x86 miscellany internal —
a1e422071c1.5 arm line numbers after constant pool,d96b4c494f,50ad337238. - Remaining small code-generation, optimizer and tooling fixes (3 commits) internal — per-operator and per-back-end bug fixes and cleanups that do not carry design of their own: nil Sym guards, Bool2int removals, REGTMP removal on x86, lex error formatting (
448f84a43a,44ab8bab1c,00f42437fd) - Build, portability and warning fixes (1 commits) internal — Plan 9/gcc/clang warnings, yacc/bison, format verbs, buffer sizes, output-file handling and Windows paths in the compilers/assemblers/liblink (
53d42fbead) - TLS and obj cleanups internal — Cleaned up TLS handling, removed dead code and added new x86 instructions. (
a5cb76243a,69a143e388,1d1f2fb4c6)
Linker and object files
From Linker and object files (Go 1.0–1.9)
PIE and many shared/c-shared architecture additions, -msan, -libgcc/-extar, mips64, ppc64 external linking.
- Go symbol table, pc/line table and function metadata (gosymtab, pclntab, findfunc) — Done: duplicate symtab entries for global functions removed (
ebafc80eba); fixed filetab slice size (cf125a36d5). - DWARF generation in the linker — Done: aranges padding on 32-bit (
68aa7fb636), no warnings on unnamed.debug_strsymbols (26263354a3). - External (host) linking and cgo — Done: concurrent object copy for external linking (
cf73357e37),-z relro(9a6a8a0586),-z nodeletefor shared libs (bd7de94d7f), use a copy of libgcc.a for internal linking and-libgcc(754f707f5f,8d2f60f8a8),-extar(1aab7b9626), symbols from.aoverride.so(cd9fc3ebfb). - Build modes: -shared, c-archive, c-shared, shared, PIE, plugin — Done: user-visible PIE (
b7e4de4b1e,2ffdbd7ce4,26205cb3c0) and the architecture expansion listed above;-msanoption (7b4b96f248); sections.data.rel.ro(2c2cbb69c8). - From C to Go: cmd/link — Done: dead code cleanup (
e92d0d82e0),stringsCompareremoval (550b7ccf77), “link go.o first” (6bf794a36d),-Wremoved (a0c7f57903),-libgccand-extarflags. - Linker speed and memory (Go 1.7 focus) — Done:
cf73357e37. - Container writers: Windows PE, Mach-O and Plan 9 — Done: PE
.text32-byte aligned under external link (821e124c24). - Architecture and OS ports in the linker (arm, power64, arm64, mips, s390x, nacl, BSDs, Solaris) and trampolines — Done: mips64 (
053c75411f), ppc64 external and shared (c155e59062,1ccefcd1b8,9a476028c0), arm64addmoduledata(4e3a1e409a1.9), ARMaddmoduledata(1b4d28f8cf), IE TLS on 386 (3bf61fb2e5), R_PPC_REL32 (f1b919574c), new 386/amd64 relocs (914db9f060), ARM cgo ELF headers (3e6334e2e0). - Build IDs, ABI hashes, flags and determinism — Done: user-visible
-msan,-libgcc,-extarflags;$GOROOTsubstitution (83746fd55a);-Wremoved.
Other changes
- Misc internal —
af799d94f9pass value being relocated toarchreloc(d821ae2a9esimplifies ppc64),bf99d8f843,06da8fd84aembedruntime.goarmonly in the runtime’s module,4f74de1e4dSolaris buildid,47ccf96a95darwin/386 c-archive entry,712ffc0861R_AARCH64_RELATIVE for gcdata,70119accdf,5e7110b92bELF phdrs usable by upx,bd7e084d7dplan9_arm header,c7b1ef9918reject non-main toplevel,f7b66fffc5force external linking for shared libs on arm,6bf794a36dlink go.o first. - arm64 addmoduledata internal —
4e3deae96dimplementsaddmoduledatafor arm64, enabling shared libraries there.