private int getSelectedInsnIndexOfMethod(@Nonnull ASTMethod method) {
		int pos = editor.getCodeArea().getCaretPosition();
		if (!method.range().within(pos))
			return -1;
		ASTCode code = method.code();
		if (code == null)
			return -1;
		List<ASTInstruction> instructions = code.instructions();
		int paragraph = editor.getCodeArea().getCurrentParagraph();
		int result = Collections.binarySearch(instructions, new ASTEmpty(new Token(
				new Range(pos, pos + 1),
				new Location(paragraph, 0, 1, null),
				TokenType.IDENTIFIER,
				"."
		)), (o1, o2) -> {
			Location l1 = o1.location();
			Location l2 = o2.location();
			if (l1 == null) return 1;
			else if (l2 == null) return -1;
			return Objects.compare(l1, l2, Comparator.naturalOrder());
		});
		if (result < 0) result = -result;
		return Math.min(instructions.size() - 1, result + 1);
	}
Component panel for the assembler which shows the data from stack analysis of the currently selected method.

@author Matt Coley
recaf-ui/src/main/java/software/coley/recaf/ui/pane/editing/assembler/JvmStackAnalysisPane.java