Source file
src/runtime/sys_wasmx.go
1
2
3
4
5
6
7 package runtime
8
9 import (
10 "internal/goarch"
11 "internal/runtime/sys"
12 "unsafe"
13 )
14
15 type m0Stack struct {
16 _ [8192 * sys.StackGuardMultiplier]byte
17 }
18
19 var wasmStack m0Stack
20
21 func wasmDiv()
22
23 func wasmTruncS()
24 func wasmTruncU()
25
26
27 func wasmExit(code int32)
28
29
30
31 func gostartcall(buf *gobuf, fn, ctxt unsafe.Pointer) {
32 sp := buf.sp - retPCSize
33 pc := uint64(buf.pc)
34 if goarch.IsWasm32 != 0 {
35 pc |= uint64(buf.lr) << 32
36 }
37 *(*uint64)(unsafe.Pointer(sp)) = pc
38 buf.sp = sp
39 buf.pc = uintptr(fn)
40 if goarch.IsWasm32 != 0 {
41 buf.pc = funcValuePC(buf.pc)
42 buf.lr = uintptr(fn)
43 }
44 buf.ctxt = ctxt
45 }
46
47 func notInitialized()
48
49
50
51
52 func notInitialized1() {
53 writeErrStr("runtime: wasmexport function called before runtime initialization\n")
54 if isarchive || islibrary {
55 writeErrStr("\tcall _initialize first\n")
56 } else {
57 writeErrStr("\tcall _start first\n")
58 }
59 }
60
View as plain text