Explorer

core.wasm-runtime-list-get

description
Runtime function 12 of the definy compiler: list_get(list, index) -> value: an option, some(item) within the range, none outside (including negative indices). The tags "none" and "some" are the globals 4 and 5 (core.compile-to-wasm puts them first in the string table). Local variable declarations and instructions, without the byte length (wasm.code-entry adds it)
type
List<Number>
expression
[
  2,
  1,
  @wasm.value-type-i64,
  1,
  @wasm.value-type-ref-null,
  @core.wasm-type-values,
  @wasm.local-get,
  1,
  @wasm.call,
  15,
  @wasm.local-set,
  2,
  @wasm.local-get,
  0,
  @wasm.call,
  19,
  @wasm.local-set,
  3,
  @wasm.local-get,
  2,
  @wasm.i64-const,
  0,
  @wasm.i64-lt-s,
  @wasm.local-get,
  2,
  @wasm.local-get,
  3,
  @wasm.gc-prefix,
  @wasm.array-len,
  @wasm.i64-extend-i32-u,
  @wasm.i64-ge-s,
  @wasm.i32-or,
  @wasm.if,
  @wasm.value-type-ref-null,
  @core.wasm-type-value,
  @wasm.i32-const,
  6,
  @wasm.global-get,
  4,
  @wasm.ref-null,
  @core.wasm-type-value,
  @wasm.gc-prefix,
  @wasm.struct-new,
  @core.wasm-type-variant,
  @wasm.else,
  @wasm.i32-const,
  6,
  @wasm.global-get,
  5,
  @wasm.local-get,
  3,
  @wasm.local-get,
  2,
  @wasm.i32-wrap-i64,
  @wasm.gc-prefix,
  @wasm.array-get,
  @core.wasm-type-values,
  @wasm.gc-prefix,
  @wasm.struct-new,
  @core.wasm-type-variant,
  @wasm.end,
  @wasm.end
]
visibility
public
core.wasm-runtime-list-get (project definy, branch main, snapshot CfIAXM725tR74SWd4aoTUz4-JJQfqnllblZbQ2Sv204)
id: 5gjNFpJcpJC7tRkFrCnjB5AFdO9F3y7sZ2uMqlSlGcQ
content hash: J7RUrHOnmuZHBKWAvdOC3AWiyQIXmeP5vqKm_EsahvA