How does Graal make the optimization in Reflexion possible
My previous article only explained how I implement the optimization, and this article is write to explain how GraalVM make it possible.
To verify that Graal actually performs these optimizations, we can inspect the generated machine code. Luckily, there is a way to read the assembly generate by Graal JVMCI JIT, so we can check what is the code becomes after JVMCI compiled it.
By setting up a directive file like this
1
2
3
4
5
6
7
[
{
match: "*::*Call*",
PrintAssembly: true,
PrintInlining: true
}
]
And run the benchmark with -XX:+UnlockDiagnosticVMOptions -XX:PrintAssemblyOptions=intel -XX:CompilerDirectivesFile=directives.json VM options, we can check the generated assembly code.
WIP…
This post is licensed under CC BY 4.0 by the author.