]> Cypherpunks repositories - gostls13.git/commit
runtime: use the right number of parameters in syscall_SyscallX on Windows
authorqmuntal <quimmuntal@gmail.com>
Mon, 12 Feb 2024 11:38:37 +0000 (12:38 +0100)
committerQuim Muntal <quimmuntal@gmail.com>
Mon, 19 Feb 2024 07:24:08 +0000 (07:24 +0000)
commit35fa852d6dda69ce367e449fff78b3fc09834c97
tree60c0b405754a4ce87602174de600fb61a155403c
parentaf5943f90cc919c38188067bbe006bdc148b576c
runtime: use the right number of parameters in syscall_SyscallX on Windows

The syscall_SyscallX functions currently discard the nargs parameter
when calling syscall_SyscallN. This precludes some optimizations
down the line. For example, on amd64, a syscall that takes 0 arguments
don't need to set any of the params passing registers (CX, DX, R8, and
R9).

This CL updates all syscall_SyscallX functions so they call
syscall_SyscallN with an argument slice of the right length.

While here, remove the hack in syscall_SyscallN to support less than 4
arguments, and update instead asmstdcall on amd64 to properly handle
this case.

Change-Id: I0328e14f34c2b000fde06cc6a579b09e8c32f2b9
Reviewed-on: https://go-review.googlesource.com/c/go/+/563315
TryBot-Result: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/runtime/sys_windows_amd64.s
src/runtime/syscall_windows.go