3 ms·
Huh, I'm a little surprised that the try/catch de-optimization is still a thing. I watched a v8 optimizing compiler talk maybe ~4 years ago when this was discus
by jdc0589 10y ago
Huh, I'm a little surprised that the try/catch de-optimization is still a thing. I watched a v8 optimizing compiler talk maybe ~4 years ago when this was discussed.
Wasn't the workaround to do nothing in the try/catch body aside from calling a named function defined outside the function scope where the try/catch was defined?
- Klathmon 10y agoYeah, you can basically turn try/catch into something that looks like the promise constructor and pass in a "try" function and a "catch" function, and then everything is optimized well (for the most part, this can still prevent some fancy optimizations).
- pcwalton 10y ago> Huh, I'm a little surprised that the try/catch de-optimization is still a thing. It's fixed in Turbofan, but that's not shipping yet.
- bmeurer 10y agoTurboFan is shipping for functions with try/catch or try/finally.