github.com/wasilibs/wazerox@v0.0.0-20240124024944-4923be63ab5f/internal/engine/compiler/arch.go (about) 1 package compiler 2 3 import ( 4 "github.com/wasilibs/wazerox/internal/asm" 5 "github.com/wasilibs/wazerox/internal/wasm" 6 ) 7 8 // newArchContext returns a new archContext which is architecture-specific type to be embedded in callEngine. 9 // This must be initialized in init() function in architecture-specific arch_*.go file which is guarded by build tag. 10 var newArchContext func() archContext 11 12 // nativecall is used by callEngine.execWasmFunction and the entrypoint to enter the compiled native code. 13 // codeSegment is the pointer to the initial instruction of the compiled native code. 14 // 15 // Note: this is implemented in per-arch Go assembler file. For example, arch_amd64.s implements this for amd64. 16 func nativecall(codeSegment uintptr, ce *callEngine, moduleInstanceAddress *wasm.ModuleInstance) 17 18 // registerNameFn is used for debugging purpose to have register symbols in the string of runtimeValueLocation. 19 var registerNameFn func(register asm.Register) string