Using inline cache for functions called more than once in a method