-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add jit compile helper time to detect @ForceInline annotation #11993
Comments
@gita-omr ^^ |
I'll take a dive into this |
See related #2076 which talks about
|
Also unfortunate for @forceinline 😅 |
I am experimenting with certain methods which are tagged with |
Details are in the issues below. Fixes: eclipse-openj9#11993 Fixes: eclipse-openj9#11990 Most of the work was done by Sharon Wang. Creating this PR on her behalf. Signed-off-by: Tobi Ajila <atobia@ca.ibm.com>
@tajila could we resume the discussion on what exactly is needed to implement this? |
We would need to know the defining class and the method name (or moethodref). Essentially, we need to know which implementation the JIT is referring to. The challenge is that in polymorhpic callsites there is no way to determine this statically. |
Right. I was thinking that sometimes we try to de-virtualize a call but not necessarily inline it. At this point, we could check the annotation. Then, we could provide the exact class of the object on which we are invoking the method(might not be the one that have the method implementation though, but some of its parents would). |
We can provide something like this:
This means if you dont call this on the defining class you may get FALSE. |
Not sure we can find the defining class... I think it might be derived class that uses definition of some parent class... |
@tajila Please see my previous comment |
for |
too often 😔 |
sorry about that |
Ok, will need to double check, but let's assume that for now. |
Helpers to detect `@ForceInline` and `@IntrinsicCandidate`, general helper `methodContainsRuntimeAnnotation` Fixes: eclipse-openj9#11993 Signed-off-by: Eric Yang <eric.yang@ibm.com>
The @ForceInline (jdk.internal.vm.annotation.ForceInline) will be used to notify the JIT that the method will benefit from inlining.
We will introduce a compile time jithelper to so the JIT can query if the method is annotated with @ForceInline or not.
First we will add a VMHelper
//@param clazz, the class that own the field
//@param the cpindex of the method to query
//@return true, if forceinline, false otherwise
BOOLEAN
isMethodTaggedForForceInline(J9Class clazz, UDATA cpIndex);
Take a look at dumpAnnotationInfo in rcdump.c to see how to look up method annotations.
To find the name of the field given a cpIndex romFieldRef = (J9ROMMethodRef *)&clazz->ramConstantPool->romConstantPool[cpIndex];
Compile time helpers are stored in cthelpers.cpp
The text was updated successfully, but these errors were encountered: