Caches: improve HardRef cache performance, make it JIT friendly