Explorer

core.compile-string-literal

description
Instructions that push the string value: global.get of the string table entry (core.compile-string-table), or a new string from array.new_fixed of the bytes when it is not in the table
type
Fn(value: String, local: Number, strings: List<Record{value: String, address: Number}>) -> List<Number>
expression
fn(value$0, local$1, strings$9) =>
  let address$10 = @core.compile-string-address(strings: $9, value: $0, index: 0);
  match @core.less-than(left: $10, right: 0) {
    true =>
      let bytes$2 = @core.string-to-bytes(value: $0);
      let len$3 = @core.list-length(value: $2);
      @core.list-concat(
        left: [@wasm.i32-const, 2],
        right: @core.list-concat(
          left: @core.compile-string-bytes(bytes: $2, index: 0, local: $1),
          right: @core.list-concat(
            left: [@wasm.gc-prefix, @wasm.array-new-fixed, @core.wasm-type-bytes],
            right: @core.list-concat(
              left: @wasm.unsigned-leb128(n: $3),
              right: [@wasm.gc-prefix, @wasm.struct-new, @core.wasm-type-string]
            )
          )
        )
      ),
    false =>
      @core.list-concat(left: [@wasm.global-get], right: @wasm.unsigned-leb128(n: $10))
  }
visibility
public
core.compile-string-literal (project definy, branch auto-release, snapshot oiQgPqhJm-TbM4kexXeRHBaJB_tS7gwBSewII64P-44)
id: WhLDxxyZsziIY9xLMpUAoby8DHbt_ICQhjcPKRXYWAw
content hash: qS82Do71hYbs8P4uxMPT2JkvgLRemwBrDipduveBPMY