Added untested code for register cache