Given WASM items described in Clojure data structures, computes their size in bytes.
This namespace is used before compilation for pre-computing how much memory to allocate while recomputing indices so they fit in dense lists.
Everything is computed in a map that is being assoc'ed in the ctx
at :wasm/write
.
See README for namespace organization and naming scheme.
Given WASM items described in Clojure data structures, computes their size in bytes. This namespace is used before compilation for pre-computing how much memory to allocate while recomputing indices so they fit in dense lists. Everything is computed in a map that is being assoc'ed in the `ctx` at `:wasm/write`. See README for namespace organization and naming scheme.
(block' flatidx opvec)
(blocktype' blocktype)
(br' _flatidx opvec)
(br_if' _flatidx opvec)
(br_table' _flatidx opvec)
(call' flatidx opvec)
(call_indirect' flatidx opvec)
(code' ctx-write code)
(codesec' {:as ctx :wasm/keys [codesec]})
(data-drop' flatidx opvec)
(datacountsec' ctx)
(datasec' {:as ctx {:as ctx-write flatidx-mem :wasm.flatidx/mem} :wasm/write})
(elem-drop' flatidx opvec)
(elemsec' {:as ctx {:as ctx-write flatidx-func :wasm.flatidx/func} :wasm/write})
(else' flatidx instr+)
(export' ctx-write space k-flatidx count-idx)
(exportsec' {:as ctx :wasm/keys [exportsec]})
(f32' _f32)
(f64' _f64)
(func flatidx-type {:wasm/keys [typeidx]})
For functions found in the funcsec and in imports.
WASM specification does not have a special name for it since binary-wise it is simply a type index.
For functions found in the funcsec and in imports. WASM specification does not have a special name for it since binary-wise it is simply a type index.
(func' flatidx {:wasm/keys [expr locals]})
(funcsec' ctx)
(functype' [param+ result+])
(global' flatidx global)
(globalsec' ctx)
(globaltype' _global)
(i32' i32)
(i64' i64)
(idx idx)
For the time being at least, all WASM indices are represented as u32'
and hence,
are read by this function.
For the time being at least, all WASM indices are represented as [[u32']] and hence, are read by this function.
(if' flatidx opvec)
(importdesc' ctx-write space k-flatidx f-item)
(importsec' {:as ctx :wasm/keys [importsec]})
(instr' flatidx opvec)
(limits' {min- :wasm.limit/min max- :wasm.limit/max})
(locals' local+)
(loop' flatidx opvec)
(memarg' [align offset])
(memory-copy' _flatidx _opvec)
(memory-fill' _flatidx _opvec)
(memory-init' flatidx opvec)
(memsec' ctx)
(memtype' mem)
(module' ctx)
(name' buffer)
(op-constval f-value)
(op-constval f-value _flatidx opvec)
Used for numerical operations declaring a constant value.
Used for numerical operations declaring a constant value.
Map of opcode -> reading function for opcodes which:
Map of **opcode** -> **reading function** for opcodes which: - Have any kind of immediate(s) - Is not 0xFC (the "misc" opcode that leads to a second-level opcode
(op-memarg _flatidx opvec)
Used for memory instructions that have a memarg'
.
Used for memory instructions that have a [[memarg']].
(op-memory flatidx opvec)
Used for memory instructions that have a memidx'
as only immediate.
Used for memory instructions that have a [[memidx']] as only immediate.
Map of immediate to "misc" opcode (0xFC) -> reading function.
Map of **immediate to "misc" opcode (0xFC)** -> **reading function**.
(op-table flatidx opvec)
Table instruction involving a table index immediate.
Table instruction involving a table index immediate.
(op-table-misc flatidx opvec)
(op-var-global flatidx opvec)
Used for global variable instructions.
Used for global variable instructions.
(op-var-local _flatidx opvec)
Used for local variable instructions.
Used for local variable instructions.
(ref-func' flatidx opvec)
(ref-null' _flatidx _opvec)
(resulttype' valtype+)
(s33' s33)
(section'+ {{:wasm.count/keys [codesec datasec datacountsec elemsec exportsec
funcsec globalsec importsec memsec startsec
tablesec typesec]}
:wasm/write})
Sums all precomputed sections.
Used by module'
.
Sums all precomputed sections. Used by [[module']].
(section-space ctx k-section k-flatidx k-count count-item)
Used by most WASM sections.
Takes care of counting everything and maintaining a flattened index.
Used by most WASM sections. Takes care of counting everything and maintaining a flattened index.
(select-t' _flatidx opvec)
(startsec' {:as ctx :wasm/keys [startsec]})
(table-copy' flatidx opvec)
(table-init' flatidx opvec)
(tablesec' ctx)
(tabletype' table)
(typesec' {:as ctx :wasm/keys [typesec]})
(u32' u32)
(vec' count-item coll)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close