diff options
author | Ayke van Laethem <[email protected]> | 2021-11-27 14:34:34 +0100 |
---|---|---|
committer | Ron Evans <[email protected]> | 2021-11-30 10:01:44 +0100 |
commit | 74b20ca234d901b5f9d4c202321a611ca60ee6a7 (patch) | |
tree | 38c5dada72936e88b63e31d8a95be631234248d5 /src/runtime/runtime.go | |
parent | 3d73ee77d37683384277f1ea9cef5bb64d2a76f9 (diff) | |
download | tinygo-74b20ca234d901b5f9d4c202321a611ca60ee6a7.tar.gz tinygo-74b20ca234d901b5f9d4c202321a611ca60ee6a7.zip |
runtime: use LLVM intrinsic to read the stack pointer
This should result in smaller code.
Diffstat (limited to 'src/runtime/runtime.go')
-rw-r--r-- | src/runtime/runtime.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/runtime/runtime.go b/src/runtime/runtime.go index d0617fde4..dc4c9f87d 100644 --- a/src/runtime/runtime.go +++ b/src/runtime/runtime.go @@ -39,6 +39,12 @@ func memmove(dst, src unsafe.Pointer, size uintptr) // llvm.memset.p0i8.i32(ptr, 0, size, false). func memzero(ptr unsafe.Pointer, size uintptr) +// This intrinsic returns the current stack pointer. +// It is normally used together with llvm.stackrestore but also works to get the +// current stack pointer in a platform-independent way. +//export llvm.stacksave +func stacksave() unsafe.Pointer + //export strlen func strlen(ptr unsafe.Pointer) uintptr |