alexcrichton transferred Issue #595:
The
argumentsfunction for instructions returns a slice of the operands of an instruction, so it's called a lot. It's generated bygen_arguments_methodhere: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
matchto 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 usingValueListfor variable-length argument lists. That might use a little more memory, but it might speed upargumentsby making it avoid the jump table.
Last updated: Dec 06 2025 at 05:03 UTC