Since the JIT traces can see both sides of the call, it can remove the work done to parse and shuffle the arguments during optimization.
For example, calling the function
with keyword arguments:
requires the tuple ("b", "a") to pushed to the stack after the arguments
and for the CALL_KW_PY instruction to parse and reorder the arguments.
We can work out the reordering required and emit the necessary stack permuting code,
then replace the CALL_KW_PY with a much more effcient CALL_PY_EXACT_ARGS
In the example above:
LOAD_CONSTANT ("b", "a")
CALL_KW_PY 3
can be replaced with
SWAP 2
CALL_PY_EXACT_ARGS 3
Linked PRs
Since the JIT traces can see both sides of the call, it can remove the work done to parse and shuffle the arguments during optimization.
For example, calling the function
with keyword arguments:
requires the tuple
("b", "a")to pushed to the stack after the argumentsand for the
CALL_KW_PYinstruction to parse and reorder the arguments.We can work out the reordering required and emit the necessary stack permuting code,
then replace the
CALL_KW_PYwith a much more effcientCALL_PY_EXACT_ARGSIn the example above:
can be replaced with
Linked PRs