3 ms·
> If the JIT code needed to call two different dynamic functions separated by more than 2GB, then it’s not possible for both to be direct. Well, you can do
by vient 5y ago
> If the JIT code needed to call two different dynamic functions separated by more than 2GB, then it’s not possible for both to be direct.
Well, you can do
MOV rax, 0x1122334455667788
PUSH rax
RET
in this case. Still direct, just a bit slower. Wonder if modern CPUs speculate past this construction.
- dfox 5y agoRET is typically special cased in the speculation logic. I suspect that this construction will have significantly larger miss prediction rate (on some uArchs quite possibly 100%) than straight indirect jump.