On Thu, 6 Apr 2023 17:08:33 GMT, Jorn Vernee <jver...@openjdk.org> wrote:
>> Chen Liang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Whitespace, cleanup, rename benchmarks to be informative > > test/micro/org/openjdk/bench/java/lang/invoke/MethodHandleProxiesAsIFInstanceCall.java > line 176: > >> 174: public void constantLambda() { >> 175: i = constantLambda.doWork(i); >> 176: } > > I think setting the result into an instance field like this can work, but > it's imo better to let JMH handle it. So, these methods should just return > the value instead of writing it to the `i` field. I think the point here is to make sure work is done by ensuring the VM cannot figure out the input value to doWork, isn't it? To make that more clear, I decide to initialize i to a random value from identity hash code instead. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/13197#discussion_r1160105192