Explorer

core.wasm-runtime-length

description
Runtime function 18 of the definy compiler (exported as length): length(value) -> i32: the byte length of a string, or the number of items of a list (twice the number of fields for a record). Local variable declarations and instructions, without the byte length (wasm.code-entry adds it)
type
List<Number>
expression
[
  0,
  @wasm.local-get,
  0,
  @wasm.gc-prefix,
  @wasm.struct-get,
  @core.wasm-type-value,
  0,
  @wasm.i32-const,
  2,
  @wasm.i32-eq,
  @wasm.if,
  @wasm.value-type-i32,
  @wasm.local-get,
  0,
  @wasm.gc-prefix,
  @wasm.ref-cast,
  @core.wasm-type-string,
  @wasm.gc-prefix,
  @wasm.struct-get,
  @core.wasm-type-string,
  1,
  @wasm.gc-prefix,
  @wasm.array-len,
  @wasm.else,
  @wasm.local-get,
  0,
  @wasm.call,
  19,
  @wasm.gc-prefix,
  @wasm.array-len,
  @wasm.end,
  @wasm.end
]
visibility
public
core.wasm-runtime-length (project definy, branch auto-release, snapshot oiQgPqhJm-TbM4kexXeRHBaJB_tS7gwBSewII64P-44)
id: wNeKNfBVKVcgtTqHlgypip0M9qv5HcpoFxgN2re66ns
content hash: LYRvZuneFFoWiT3DPRkbw9EVciqb_tIWuTR-SnBUUJ8