What you’re essentially asking is: why are you supporting JavaScript?
Also a lot of those optimizations occur in jits for statically types languages. Because many of the optimizations are functionally equivalent to “static” language ideas like devirtualisation and the like.