In the context of a JIT, you have a tradeoff to make: do you exhaust all possibilities for optimization, or do you do as little as possible to get something running. That's why you have things like Hotspot, where they initially do as little as possible to get things rolling, then optimize heavily as it finds bottlenecks. This is no easy task.