diff options
| author | Austin Clements <austin@google.com> | 2021-04-13 08:44:56 -0400 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2021-04-13 21:13:12 +0000 |
| commit | c19759aa487f7d6f479daa00e7462425f4efc481 (patch) | |
| tree | a580e1b01eeb2ecdb81d383e922ad8bb155095b5 /src/runtime/sys_windows_386.s | |
| parent | e69f02265c74529a368a2ff27fdce4aeb3483e8b (diff) | |
| download | go-c19759aa487f7d6f479daa00e7462425f4efc481.tar.xz | |
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>
Diffstat (limited to 'src/runtime/sys_windows_386.s')
| -rw-r--r-- | src/runtime/sys_windows_386.s | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/src/runtime/sys_windows_386.s b/src/runtime/sys_windows_386.s index c8839b9976..d6b521ab65 100644 --- a/src/runtime/sys_windows_386.s +++ b/src/runtime/sys_windows_386.s @@ -156,57 +156,6 @@ TEXT runtime·lastcontinuetramp<ABIInternal>(SB),NOSPLIT,$0-0 MOVL $runtime·lastcontinuehandler(SB), AX JMP sigtramp<>(SB) -TEXT runtime·externalthreadhandler<ABIInternal>(SB),NOSPLIT|TOPFRAME,$0 - PUSHL BP - MOVL SP, BP - PUSHL BX - PUSHL SI - PUSHL DI - PUSHL 0x14(FS) - MOVL SP, DX - - // setup dummy m, g - SUBL $m__size, SP // space for M - MOVL SP, 0(SP) - MOVL $m__size, 4(SP) - CALL runtime·memclrNoHeapPointers(SB) // smashes AX,BX,CX - - LEAL m_tls(SP), CX - MOVL CX, 0x14(FS) - MOVL SP, BX - SUBL $g__size, SP // space for G - MOVL SP, g(CX) - MOVL SP, m_g0(BX) - - MOVL SP, 0(SP) - MOVL $g__size, 4(SP) - CALL runtime·memclrNoHeapPointers(SB) // smashes AX,BX,CX - LEAL g__size(SP), BX - MOVL BX, g_m(SP) - - LEAL -32768(SP), CX // must be less than SizeOfStackReserve set by linker - MOVL CX, (g_stack+stack_lo)(SP) - ADDL $const__StackGuard, CX - MOVL CX, g_stackguard0(SP) - MOVL CX, g_stackguard1(SP) - MOVL DX, (g_stack+stack_hi)(SP) - - PUSHL AX // room for return value - PUSHL 16(BP) // arg for handler - CALL 8(BP) - POPL CX - POPL AX // pass return value to Windows in AX - - get_tls(CX) - MOVL g(CX), CX - MOVL (g_stack+stack_hi)(CX), SP - POPL 0x14(FS) - POPL DI - POPL SI - POPL BX - POPL BP - RET - GLOBL runtime·cbctxts(SB), NOPTR, $4 TEXT runtime·callbackasm1<ABIInternal>(SB),NOSPLIT,$0 |
