Memoization with invokedynamic