#Weird instruction sequence for function calls
1 messages · Page 1 of 1 (latest)
If I have understood your question correctly, because of dynamic dispatch?! function calls are often resolved at runtime based on the types of arguments. Indirect calls through rax facilitate this flexibility. Debugging and profiling could be another potential reason.
This is for fully deduced function, though, so there are no indirect calls. The movabs also just loads a constant
julia> @noinline g(x) = x
julia> f(x) = g(x)
julia> @code_native f(1)
julia_f_168: # @julia_f_168
# %bb.0: # %top
push rbp
mov rbp, rsp
movabs rax, offset j_g_170
call rax
pop rbp
ret
And I don't see how this would help with debugging or profiling, tbh
I would suggest asking on the slack or discourse, as that's where the people more knowledgeable about Julia's internals are
Then I'll do that, thank for the hint :)