Stream: git-wasmtime

Topic: wasmtime / issue #14168 Unnecessary stack checks and prol...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 19 2026 at 20:04):

alexcrichton opened issue #14168:

Given this input:

(module
  (type $t (func))
  (global (export "g") (mut (ref $t)) (ref.func $f))
  (func $f)

  (func (export "call")
    (return_call_ref $t (global.get 0))
  )
)

this currently compiles as:

$ wasmtime compile foo.wat
$ wasmtime objdump foo.cwasm --filter 1
wasm[0]::function[1]:
            pushq   %rbp
            movq    %rsp, %rbp
            movq    8(%rdi), %r10
            movq    0x18(%r10), %r10
            addq    $0x10, %r10
            cmpq    %rsp, %r10
            ja      0x52
            movq    0x30(%rdi), %rsi
            movq    %rdi, %r8
            movq    8(%rsi), %r10
            ╰─╼ trap: Normal(NullReference)
            movq    0x18(%rsi), %rdi
            movq    %r8, %rsi
            movq    %rbp, %rsp
            popq    %rbp
            jmpq    *%r10
            ud2
            ╰─╼ trap: Normal(StackOverflow)

There's a few inefficiencies with this codegen we could improve upon:

Nothing major here, but might be nice to clean up some of this as well.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 27 2026 at 16:56):

fitzgen added the cranelift:goal:optimize-speed label to Issue #14168.


Last updated: Aug 30 2026 at 09:07 UTC