News for hackers. Stuff that matters.
Re:Java is very fast, if you don’t create many objects by Karellen on Monday September 12, 2022 @03:59PM (#32816030)
How will the runtime system know to invalidate and recompile the code, if the alert check isn't being done on every call?

At some level, the check for the alert has to be done on every call. If it isn't being done, the one time there should be an alert it will be missed. If it is being done, where is it being done if not in the optimised JITted code, and how is that code even more optimised than the JITted version would be? Why not just put that optimisation in the JITted code?

Re:Java is very fast, if you don’t create many objects by kjeetgill on Monday September 12, 2022 @06:36PM (#32818070)
The terms you'll want to read up on are JIT speculation and deoptimisation. There's a whole range of things that can be done like trapping the null derefrence instead of an explicit check, once hot code is inlined the check could be lifted out several call frames outside of loops. Then you can ignore the check later.

All sortsa stuff can happen.