c2 parser is conservative about the bci unstable_if trap. It points to the conditional branch. When interpreter resumes execution, it will reevaluate the condition branch and take another path. unstable_trap collects liveness information at the bci and make live locals the input parameters of CallStaticJava uncommon_trap node.
We can aggressively set next bci for the unstable traps. Most of next BCIs (fall through or destination) are closer to the exit. It's likely to have less live locals. There are 3 benefits.
1. less inputs of uncommon_trap node can simplify IR. this may unblock other optimizations such as useless function elimination JDK-8276998 or scalar replacement.
2. deoptimizations become faster because we don't need to reallocate those dead objects.
3. save codecache space. we store all debuginfo in codecache. for those scalarized objects, we have to save fields of them in debuginfo. we can avoid them if they are not live.