On Tuesday, 24 September 2019 at 19:17:25 UTC, jmh530 wrote:
On Tuesday, 24 September 2019 at 18:24:36 UTC, Ivan Butygin
wrote:
On Tuesday, 24 September 2019 at 17:49:13 UTC, jmh530 wrote:
About bind call overhead, bind object hold pointer to shared
payload, which is allocated via malloc. This payload has
function pointer (initially null).
During compileDynamicCode call runtime will update this
pointer to generated code.
Bind object opCall call this function pointer from payload.
[snip]
That's very helpful. The bind stuff is making a little more
sense to me now.
Is there a concern that ldc cannot inline these function
pointers versus the normal function calls?
We probably can't do anything with static->jit calls overhead.
Just try to jit big enough functions to make this overhead
negligible. But jit->static calls will be optimized. When
compiler sees call to other function in jitted code and function
body is available it will try to pull this function to jitted
code as well even if it isn't marked
@dynamicCompile/@dynamicCompileEmit. Static calls to such
functions will still use static version but jit will use its own
version which can be optimized with rest of jitted code and can
be inlined into jitted code.