live Local Numbers By Kind Per Entry Point
As the code is being generated and we encounter an L2_SAVE_ALL_AND_PC_TO_INT, we examine its corresponding target block to figure out which registers actually have to be captured at the save, and restored at the L2_ENTER_L2_CHUNK. At that point, we look up the local numbers from the JVMTranslator and record them by RegisterKind in this field.
During optimization, an edge from an L2_SAVE_ALL_AND_PC_TO_INT to its target L2_ENTER_L2_CHUNK is treated as though the jump happens immediately, so that liveness information can be kept accurate. The final code generation knows better, and simply saves and restores the locals that back registers that are considered live across this gap.
The key of this map is the target L2_ENTER_L2_CHUNK instruction, and the value is a map from RegisterKind to the List of live local numbers.