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.
(expr' flatidx opvec+)
For a vector of instr'
.
For a vector of [[instr']].
(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.
(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.
(instr'+ flatidx opvec+)
Behaves same as expr'
.
Behaves same as [[expr']].
(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-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.
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close