3 ms·
I think the way it is usually done is that the JIT assumes, for example after profiling, that an expression has a specific type, generates code according to tha
by gpderetta 4y ago
I think the way it is usually done is that the JIT assumes, for example after profiling, that an expression has a specific type, generates code according to that assumption and adds strategic guards to check that the assumptions are still valid, with a fall back path to the original unoptimized code. Thanks to the magic of branch prediction the guards have little runtime cost.