Stream: git-wasmtime

Topic: wasmtime / issue #1062 Optimize instruction `arguments`


view this post on Zulip Wasmtime GitHub notifications bot (Nov 06 2025 at 17:37):

fitzgen closed issue #1062:

The arguments function for instructions returns a slice of the operands of an instruction, so it's called a lot. It's generated by gen_arguments_method here:

https://github.com/CraneStation/cranelift/blob/master/lib/codegen/meta-python/gen_instr.py#L60

Currently, there are several possible formats for instructions, so it does a match to determine how to retrieve the arguments slice. In practice, it's compiled to an indirect jump with a table.

It would be interesting to experiment with making all instructions use a ValueList, rather than just using ValueList for variable-length argument lists. That might use a little more memory, but it might speed up arguments by making it avoid the jump table.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 06 2025 at 17:37):

fitzgen commented on issue #1062:

This issue is old, relatively out of date, and very generic. Feel free to file more specific issues or send PRs if you have an optimization.


Last updated: Dec 06 2025 at 06:05 UTC