It doesn’t - this has been a basically solved problem since Self and deoptimisation were invented.
[1] https://carolchen.me/blog/jits-impls/
[1] https://carolchen.me/blog/jits-impls/