]> Cypherpunks repositories - gostls13.git/commit
runtime: eliminate externalthreadhandler
authorAustin Clements <austin@google.com>
Tue, 13 Apr 2021 12:44:56 +0000 (08:44 -0400)
committerAustin Clements <austin@google.com>
Tue, 13 Apr 2021 21:13:12 +0000 (21:13 +0000)
commitc19759aa487f7d6f479daa00e7462425f4efc481
treea580e1b01eeb2ecdb81d383e922ad8bb155095b5
parente69f02265c74529a368a2ff27fdce4aeb3483e8b
runtime: eliminate externalthreadhandler

This function is no longer used.

Eliminating this actually fixes several problems:

- It made assumptions about what registers memclrNoHeapPointers would
  preserve. Besides being an abstraction violation and lurking
  maintenance issue, this actively became a problem for regabi because
  the call to memclrNoHeapPointers now happens through an ABI wrapper,
  which is generated by the compiler and hence we can't easily control
  what registers it clobbers.

- The amd64 implementation (at least), does not interact with the host
  ABI correctly. Notably, it doesn't save many of the registers that
  are callee-save in the host ABI but caller-save in the Go ABI.

- It interacts strangely with the NOSPLIT checker because it allocates
  an entire M and G on its stack. It worked around this on arm64, and
  happened to do things the NOSPLIT checker couldn't track on 386 and
  amd64, and happened to be *4 bytes* below the limit on arm (so any
  addition to the m or g structs would cause a NOSPLIT failure). See
  CL 309031 for a more complete explanation.

Fixes #45530.
Updates #40724.

Change-Id: Ic70d4d7e1c17f1d796575b3377b8529449e93576
Reviewed-on: https://go-review.googlesource.com/c/go/+/309634
Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/cmd/internal/objabi/funcid.go
src/cmd/link/internal/ld/pe.go
src/runtime/memclr_386.s
src/runtime/memclr_amd64.s
src/runtime/os_windows.go
src/runtime/symtab.go
src/runtime/sys_windows_386.s
src/runtime/sys_windows_amd64.s
src/runtime/sys_windows_arm.s
src/runtime/sys_windows_arm64.s