arch_wasm.mx raw
1 //go:build wasm
2
3 package runtime
4
5 const GOARCH = "wasm"
6
7 // The bitness of the CPU (pointers are 32-bit in wasm32).
8 const TargetBits = 32
9
10 const deferExtraRegs = 0
11
12 // WASM instructions are variable-length, but call instructions
13 // are typically encoded as a single opcode + index.
14 const callInstSize = 1
15
16 // align aligns a pointer to 16-byte boundary.
17 func align(ptr uintptr) uintptr {
18 return (ptr + 15) &^ 15
19 }
20
21 func getCurrentStackPointer() uintptr {
22 return uintptr(stacksave())
23 }
24