]> Cypherpunks repositories - gostls13.git/commit
runtime: call nanotimeQPC from nanotime1 normally
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 21 Apr 2021 20:45:44 +0000 (20:45 +0000)
committerMichael Knyszek <mknyszek@google.com>
Wed, 21 Apr 2021 23:01:42 +0000 (23:01 +0000)
commit6639bb894d8770290f1860a4cad8f8726079b870
tree1df6114027d104bc8ac36419dc0cd30e7e4a39e7
parent7e97e4e8ccdba9677f31ab9380802cd7613f62c5
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>
src/runtime/sys_windows_amd64.s