If we a method that requires a special OSR prologue and epilogue for the opt compiler we turn the bytecodes into a single stream starting at index 0. In BC2IR we adjust the bytecode index of some instructions so that it corresponds to that of the original bytecode. There appear to be latent bugs in this -
RVM-597 for example, I believe there is a similar problem for runtime exceptions such that null and bound check failures would get the wrong exception handler as the bcIndex appears in the code to be wrong by the bciAdjustment, however, the exception handler map has some adjustment to take this into account. The comments in the exception handler map and BC2IR indicate that this design is in the process of being rethought. This needs to be sorted out as these latent bugs are now surfacing.