runtime: use LLVM intrinsic to read the stack pointer

This should result in smaller code.
This commit is contained in:
Ayke van Laethem
2021-11-27 14:34:34 +01:00
committed by Ron Evans
parent 3d73ee77d3
commit 74b20ca234
10 changed files with 17 additions and 28 deletions
+1 -3
View File
@@ -1,7 +1,5 @@
package runtime
import "device"
const GOARCH = "386"
// The bitness of the CPU (e.g. 8, 32, 64).
@@ -13,5 +11,5 @@ func align(ptr uintptr) uintptr {
}
func getCurrentStackPointer() uintptr {
return device.AsmFull("movl %esp, {}", nil)
return uintptr(stacksave())
}