Energy loss of ions moving through high-density matter