When calling F(argument_expression)
, is argument_expression
evaluated before pushing the stack for F?
For example, when calling F(G(H(arg)))
, does the compiler first push the stack for H, evaluate H, pop, then push the stack for G, etc? Or does it first push the stack for F, then for G, then for H, then pop back up 3 layers?
Also, is one way any faster than the other?
The parameters are fully evaluated before the called function can run, per spec.
I.e.: In your example, H(arg)
will be fully evaluated before G(result of H(arg))
can run, etc.
At any given time you'll have one-level depth of the stack.