go/src/cmd/link/internal/wasm/asm.go

const I32

const I64

const F32

const F64

const sectionCustom

const sectionType

const sectionImport

const sectionFunction

const sectionTable

const sectionMemory

const sectionGlobal

const sectionExport

const sectionStart

const sectionElement

const sectionCode

const sectionData

const funcValueOffset

func gentext(ctxt *ld.Link, ldr *loader.Loader) {}

type wasmFunc

type wasmFuncType

func readWasmImport(ldr *loader.Loader, s loader.Sym) obj.WasmImport {}

var wasmFuncTypes

func assignAddress(ldr *loader.Loader, sect *sym.Section, n int, s loader.Sym, va uint64, isTramp bool) (*sym.Section, int, uint64) {}

type wasmDataSect

var dataSects

func asmb(ctxt *ld.Link, ldr *loader.Loader) {}

// asmb writes the final WebAssembly module binary.
// Spec: https://webassembly.github.io/spec/core/binary/modules.html
func asmb2(ctxt *ld.Link, ldr *loader.Loader) {}

func lookupType(sig *wasmFuncType, types *[]*wasmFuncType) uint32 {}

func writeSecHeader(ctxt *ld.Link, id uint8) int64 {}

func writeSecSize(ctxt *ld.Link, sizeOffset int64) {}

func writeBuildID(ctxt *ld.Link, buildid []byte) {}

// writeTypeSec writes the section that declares all function types
// so they can be referenced by index.
func writeTypeSec(ctxt *ld.Link, types []*wasmFuncType) {}

// writeImportSec writes the section that lists the functions that get
// imported from the WebAssembly host, usually JavaScript.
func writeImportSec(ctxt *ld.Link, hostImports []*wasmFunc) {}

// writeFunctionSec writes the section that declares the types of functions.
// The bodies of these functions will later be provided in the "code" section.
func writeFunctionSec(ctxt *ld.Link, fns []*wasmFunc) {}

// writeTableSec writes the section that declares tables. Currently there is only a single table
// that is used by the CallIndirect operation to dynamically call any function.
// The contents of the table get initialized by the "element" section.
func writeTableSec(ctxt *ld.Link, fns []*wasmFunc) {}

// writeMemorySec writes the section that declares linear memories. Currently one linear memory is being used.
// Linear memory always starts at address zero. More memory can be requested with the GrowMemory instruction.
func writeMemorySec(ctxt *ld.Link, ldr *loader.Loader) {}

// writeGlobalSec writes the section that declares global variables.
func writeGlobalSec(ctxt *ld.Link) {}

// writeExportSec writes the section that declares exports.
// Exports can be accessed by the WebAssembly host, usually JavaScript.
// The wasm_export_* functions and the linear memory get exported.
func writeExportSec(ctxt *ld.Link, ldr *loader.Loader, lenHostImports int) {}

// writeElementSec writes the section that initializes the tables declared by the "table" section.
// The table for CallIndirect gets initialized in a very simple way so that each table index (PC_F value)
// maps linearly to the function index (numImports + PC_F).
func writeElementSec(ctxt *ld.Link, numImports, numFns uint64) {}

// writeCodeSec writes the section that provides the function bodies for the functions
// declared by the "func" section.
func writeCodeSec(ctxt *ld.Link, fns []*wasmFunc) {}

// writeDataSec writes the section that provides data that will be used to initialize the linear memory.
func writeDataSec(ctxt *ld.Link) {}

// writeProducerSec writes an optional section that reports the source language and compiler version.
func writeProducerSec(ctxt *ld.Link) {}

var nameRegexp

// writeNameSec writes an optional section that assigns names to the functions declared by the "func" section.
// The names are only used by WebAssembly stack traces, debuggers and decompilers.
// TODO(neelance): add symbol table of DATA symbols
func writeNameSec(ctxt *ld.Link, firstFnIndex int, fns []*wasmFunc) {}

type nameWriter

func writeI32Const(w io.ByteWriter, v int32) {}

func writeI64Const(w io.ByteWriter, v int64) {}

func writeName(w nameWriter, name string) {}

func writeUleb128(w io.ByteWriter, v uint64) {}

func writeUleb128FixedLength(w io.ByteWriter, v uint64, length int) {}

func writeSleb128(w io.ByteWriter, v int64) {}

func fieldsToTypes(fields []obj.WasmField) []byte {}