I don't really see why:<p><pre><code> public class TestJIT {
public static void main(String[] args) {
for (int i = 0; i < 20_000; i++) {
payload();
}
}
public static int payload(int a, int b) {
return a + b;
}
}
</code></pre>
shouldn't be optimized into a 'no-op'. The end-effect is the same.
Excellent. Next time I’ll have something to refer to when making memes like this one: <a href="https://twitter.com/_saagarjha/status/1576961522936340480" rel="nofollow">https://twitter.com/_saagarjha/status/1576961522936340480</a>. Maybe I can avoid building OpenJDK too!
Some self-advertising of a linux tool I made which can display perf record data with Java JIT disassembly (doesn't need hsdis): <a href="https://github.com/dzaima/grr?tab=readme-ov-file#java-jit">https://github.com/dzaima/grr?tab=readme-ov-file#java-jit</a>