Index theorems for holomorphic self-maps