Add support for jitDispatchJ9Method for MH on P
Enables transformation of invokeBasic, linkToStatic, and linkToSpecial calls into jitDispatchJ9Method acall nodes. Codegen recognizes this node in private linakge and produces code to directly call the MethodHandle target at runtime - using a new PPCJ9HelperCall snippet when the target is interpreted - otherwise branch and link to jit start pc of target
depends on https://github.com/eclipse-omr/omr/pull/8074
@zl-wang can I get a review on this please? This is what we discussed with @IBMJimmyk last week
will do, after i return from vacation next Wed.
High-level comments:
- HelperCallSnippet seemed being used for disjoint purposes across platforms and in OMR side as well. this use (new file) in OpenJ9 PPC codegen looked more aligned with OMR side of story. Please consider how to make it more readable/understandable and less confusing for future newcomers! I was thinking: could we do away without this new file and integrating MH invoke support in existing files (anyway)? or, naming the new file for its specific purpose (MH invocation support)?
- rightToLeft or leftToRight argument ordering should be still applicable to the invocation by and large, instead of disabling it as you wrote it, although i understood this thing has never been used in reality to begin with. You only need to special-case the first argument (j9method? if I remembered correctly). The shifted argument list should be identical to a normal java method dispatch in IL representation ... so, the disabling is unexpected at high level.
I will review the details when i get around.
still somewhat at a high level:
There were J9 helperCallSnippet customization examples already for certain special purposes in files: runtime/compiler/p/codegen/J9PPCSnippet.[ch]pp
I don't see why you cannot add this case there. i supposed you either didn't notice their existence or saw some advantages of creating new file for it.