diff options
author | Michael Anthony Knyszek <mknyszek@google.com> | 2021-04-21 20:45:44 +0000 |
---|---|---|
committer | Michael Knyszek <mknyszek@google.com> | 2021-04-21 23:01:42 +0000 |
commit | 6639bb894d8770290f1860a4cad8f8726079b870 (patch) | |
tree | 1df6114027d104bc8ac36419dc0cd30e7e4a39e7 /src/runtime/sys_windows_amd64.s | |
parent | 7e97e4e8ccdba9677f31ab9380802cd7613f62c5 (diff) | |
download | go-6639bb894d8770290f1860a4cad8f8726079b870.tar.gz go-6639bb894d8770290f1860a4cad8f8726079b870.zip |
runtime: call nanotimeQPC from nanotime1 normally
Currently we call runtimeQPC as ABIInternal because it shaves off 24
bytes by not having an extra wrapper, and at the time we were exceeding
the nosplit stack limit in some cases.
However, this code was written before we had the regabiargs GOEXPERIMENT
flag, and wasn't properly flagged. Naturally, with regabiargs enabled,
it leads to garbage being returned, because it needs to store
runtimeQPC's result to the stack.
We didn't notice this because today runtimeQPC is only used in Wine, not
on any native Windows platform.
Back when I wrote this code, it appeared to be necessary on even native
Windows, but it turns out that's not true anymore. Turn it back into a
native call through a wrapper.
For #40724.
Change-Id: Ia2e5901965ef46c5f299daccef49952026854fe6
Reviewed-on: https://go-review.googlesource.com/c/go/+/312429
Trust: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/runtime/sys_windows_amd64.s')
-rw-r--r-- | src/runtime/sys_windows_amd64.s | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/runtime/sys_windows_amd64.s b/src/runtime/sys_windows_amd64.s index a9a7dfdd49..72ced3cd1c 100644 --- a/src/runtime/sys_windows_amd64.s +++ b/src/runtime/sys_windows_amd64.s @@ -367,13 +367,7 @@ loop: MOVQ CX, ret+0(FP) RET useQPC: - // Call with ABIInternal because we could be - // very deep in a nosplit context and the wrapper - // adds stack space. - // TODO(#40724): The result from nanotimeQPC will - // be passed in a register, so store that to the - // stack so we can return through a wrapper. - JMP runtime·nanotimeQPC<ABIInternal>(SB) + JMP runtime·nanotimeQPC(SB) RET TEXT time·now(SB),NOSPLIT,$0-24 |