Re:My favorite bug: segfaults in Java
by TheLoneWolfling on Sunday March 29, 2015 @05:20PM
(#9286528)
Except that, as evidenced by this case, the JVM isn't doing the optimization either!
(Also: it's not a stupid approach. Due to the way the JVM loads things, most of the time you don't know that any particular method won't be overridden later by something that does, in fact, have side effects. There are very few optimizations that could actually be done by the Java compiler.)
(Also: it's not a stupid approach. Due to the way the JVM loads things, most of the time you don't know that any particular method won't be overridden later by something that does, in fact, have side effects. There are very few optimizations that could actually be done by the Java compiler.)