nl_tokens: Compute the StackMapTypes of the live variables of the current method at a specific location within the method . There may be gaps ( Bogus or non - live slots ) so we can t just count the number of live variables we must find the max index of all the live variables .
pl_tokens: protected final StackMapType [ ] calculate_live_local_types ( MethodGen mg , int location ) { int max_local_index = - 1 ; StackMapType [ ] local_map_types = new StackMapType [ mg . getMaxLocals ( ) ] ; Arrays . fill ( local_map_types , new StackMapType ( Const . ITEM_Bogus , - 1 , pool . getConstantPool ( ) ) ) ; for ( LocalVariableGen lv : mg . getLocalVariables ( ) ) { if ( location >= lv . getStart ( ) . getPosition ( ) ) { if ( lv . getLiveToEnd ( ) || location < lv . getEnd ( ) . getPosition ( ) ) { int i = lv . getIndex ( ) ; local_map_types [ i ] = generate_StackMapType_from_Type ( lv . getType ( ) ) ; max_local_index = Math . <mask> ( max_local_index , i ) ; } } } return Arrays . copyOf ( local_map_types , max_local_index + 1 ) ; }