julia
c7db8947 - gf: Call a builtin without dispatching on it

Commit
19 days ago
gf: Call a builtin without dispatching on it A dynamic call of a builtin (`getfield`, `Core.apply_type`, `Core.IntrinsicFunction` and the rest, as the interpreter makes for every one of them) looked up the builtin's single method like any other: in the call-site cache, and on a miss in the typemap, only to reach the same `jl_fptr_args` entry every time. No method can be added to a builtin and its method is valid from the first world on, so there is nothing to look up. So each builtin's `DataType` now records the index of its function in `jl_builtin_f_addrs`, in a new `dispatch_hint` byte, and `jl_apply_generic` calls that function directly, without probing the call-site cache (where a builtin's entry also no longer competes for slots). A lookup that is not for a call still finds the builtin's method in the typemap. The byte adds a field to `DataType`, so the images have to be rebuilt. Assisted-by: Claude Code (Opus 5.5)
Author
Committer
Parents
Loading