Black Lives Matter. Support the Equal Justice Initiative.

Source file src/runtime/sys_wasm.go

Documentation: runtime

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package runtime
     6  
     7  import (
     8  	"runtime/internal/sys"
     9  	"unsafe"
    10  )
    11  
    12  type m0Stack struct {
    13  	_ [8192 * sys.StackGuardMultiplier]byte
    14  }
    15  
    16  var wasmStack m0Stack
    17  
    18  func wasmMove()
    19  
    20  func wasmZero()
    21  
    22  func wasmDiv()
    23  
    24  func wasmTruncS()
    25  func wasmTruncU()
    26  
    27  func wasmExit(code int32)
    28  
    29  // adjust Gobuf as it if executed a call to fn with context ctxt
    30  // and then stopped before the first instruction in fn.
    31  func gostartcall(buf *gobuf, fn, ctxt unsafe.Pointer) {
    32  	sp := buf.sp
    33  	sp -= sys.PtrSize
    34  	*(*uintptr)(unsafe.Pointer(sp)) = buf.pc
    35  	buf.sp = sp
    36  	buf.pc = uintptr(fn)
    37  	buf.ctxt = ctxt
    38  }
    39  

View as plain text