Performance-oriented cache management scheme based on a retention state for energy-harvesting nonvolatile processors