Liking cljdoc? Tell your friends :D

helins.wasm.count

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.
raw docstring

block'clj/s

(block' flatidx opvec)

blocktype'clj/s

(blocktype' blocktype)

br'clj/s

(br' _flatidx opvec)

br_if'clj/s

(br_if' _flatidx opvec)

br_table'clj/s

(br_table' _flatidx opvec)

byte'clj/s


call'clj/s

(call' flatidx opvec)

call_indirect'clj/s

(call_indirect' flatidx opvec)

code'clj/s

(code' ctx-write code)

codesec'clj/s

(codesec' {:as ctx :wasm/keys [codesec]})

data-drop'clj/s

(data-drop' flatidx opvec)

datacountsec'clj/s

(datacountsec' ctx)

dataidx'clj/s


datasec'clj/s

(datasec' {:as ctx {:as ctx-write flatidx-mem :wasm.flatidx/mem} :wasm/write})

elem-drop'clj/s

(elem-drop' flatidx opvec)

elemidx'clj/s


elemsec'clj/s

(elemsec' {:as ctx {:as ctx-write flatidx-func :wasm.flatidx/func} :wasm/write})

elemtype'clj/s


else'clj/s

(else' flatidx instr+)

export'clj/s

(export' ctx-write space k-flatidx count-idx)

exportsec'clj/s

(exportsec' {:as ctx :wasm/keys [exportsec]})

expr'clj/s

(expr' flatidx opvec+)

For a vector of instr'.

For a vector of [[instr']].
raw docstring

f32'clj/s

(f32' _f32)

f64'clj/s

(f64' _f64)

funcclj/s

(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.
raw docstring

func'clj/s

(func' flatidx {:wasm/keys [expr locals]})

funcidx'clj/s


funcsec'clj/s

(funcsec' ctx)

functype'clj/s

(functype' [param+ result+])

global'clj/s

(global' flatidx global)

globalidx'clj/s


globalsec'clj/s

(globalsec' ctx)

globaltype'clj/s

(globaltype' _global)

i32'clj/s

(i32' i32)

i64'clj/s

(i64' i64)

idxclj/s

(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.
raw docstring

if'clj/s

(if' flatidx opvec)

importdesc'clj/s

(importdesc' ctx-write space k-flatidx f-item)

importsec'clj/s

(importsec' {:as ctx :wasm/keys [importsec]})

instr'clj/s

(instr' flatidx opvec)

instr'+clj/s

(instr'+ flatidx opvec+)

Behaves same as expr'.

Behaves same as [[expr']].
raw docstring

labelidx'clj/s


limits'clj/s

(limits' {min- :wasm.limit/min max- :wasm.limit/max})

localidx'clj/s


locals'clj/s

(locals' local+)

loop'clj/s

(loop' flatidx opvec)

magic'clj/s


memarg'clj/s

(memarg' [align offset])

memidx'clj/s


memory-copy'clj/s

(memory-copy' _flatidx _opvec)

memory-fill'clj/s

(memory-fill' _flatidx _opvec)

memory-init'clj/s

(memory-init' flatidx opvec)

memsec'clj/s

(memsec' ctx)

memtype'clj/s

(memtype' mem)

module'clj/s

(module' ctx)

name'clj/s

(name' buffer)

op-constvalclj/s

(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.
raw docstring

op-main->fclj/s

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
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
raw docstring

op-memargclj/s

(op-memarg _flatidx opvec)

Used for memory instructions that have a memarg'.

Used for memory instructions that have a [[memarg']].
raw docstring

op-memoryclj/s

(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.
raw docstring

op-misc->fclj/s

Map of immediate to "misc" opcode (0xFC) -> reading function.

Map of **immediate to "misc" opcode (0xFC)** -> **reading function**.
raw docstring

op-tableclj/s

(op-table flatidx opvec)

Table instruction involving a table index immediate.

Table instruction involving a table index immediate.
raw docstring

op-table-miscclj/s

(op-table-misc flatidx opvec)

op-var-globalclj/s

(op-var-global flatidx opvec)

Used for global variable instructions.

Used for global variable instructions.
raw docstring

op-var-localclj/s

(op-var-local _flatidx opvec)

Used for local variable instructions.

Used for local variable instructions.
raw docstring

opcode'clj/s


ref-func'clj/s

(ref-func' flatidx opvec)

ref-null'clj/s

(ref-null' _flatidx _opvec)

reftype'clj/s


resulttype'clj/s

(resulttype' valtype+)

s33'clj/s

(s33' s33)

section'clj/s

(section' n-byte)
raw docstring

section'+clj/s

(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']].
raw docstring

section-id'clj/s


section-spaceclj/s

(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.
raw docstring

select-t'clj/s

(select-t' _flatidx opvec)

startsec'clj/s

(startsec' {:as ctx :wasm/keys [startsec]})

table-copy'clj/s

(table-copy' flatidx opvec)

table-init'clj/s

(table-init' flatidx opvec)

tableidx'clj/s


tablesec'clj/s

(tablesec' ctx)

tabletype'clj/s

(tabletype' table)

typeidx'clj/s


typesec'clj/s

(typesec' {:as ctx :wasm/keys [typesec]})

u32'clj/s

(u32' u32)

valtype'clj/s


vec'clj/s

(vec' count-item coll)

version'clj/s

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close