-
Notifications
You must be signed in to change notification settings - Fork 738
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
Reimplement getMethodFromName around other queries #4175
Conversation
This way it needs no special treatment in TR_J9SharedCacheVM, since the required records are naturally created within the two simpler queries. The callingMethod is now ignored because all callers pass the names of JCL classes that are loaded by the bootstrap loader. The only restriction that could be imposed by using the loader associated with callingMethod would be to potentially "hide" the class, but in that case the existing code retries with the bootstrap class loader anyway. So now the bootstrap loader is used on the first attempt. getMethodFromName is split into two virtual methods, one without this extra parameter, so that OMR can also remove the parameter without breaking compatibility. For TR_ValidateMethodFromClassAndSig, the callingClass ("beholder") is now optional. Callers of getMethodFromClass do not have to provide a callingClass, and in particular none is provided in getMethodFromName. Signed-off-by: Devin Papineau <devinmp@ca.ibm.com>
This record is unused now that getMethodFromName() is implemented in terms of getSystemClassFromClassName() and getMethodFromClass(). Signed-off-by: Devin Papineau <devinmp@ca.ibm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question, if the callingClass
is optional, why do we need to specify it in the validation record at all?
If provided, it's used for testing visibility |
As I'm not an expert on the Java semantics, @andrewcraik could you give this a once over? |
Is it possible during the validation run where previously we would fail the AOT load when |
I'll look tomorrow morning when I have time to go through it properly - I'm going to launch sanity now in the hope the review doesn't require major changes. |
Jenkins test sanity xlinux,win,plinux jdk8,jdk11 |
No idea why the xlinux jdk11 build shows as failed :S. I asked the question here https://openj9.slack.com/archives/C8312LCV9/p1546610068034700 |
We would only fail the load as a quiet failure of the assertion that prevents unexpected null return values, but e.g. debug builds would crash. It's not a legitimate situation that requires load failure. We can get null only if |
I see, that makes sense; I got confused because of the |
I'm ok to merge this once @andrewcraik takes a look at the refactoring done for |
So I'm fine with this - there is a capability reduction in that the current code can find a non-system loader from the constant pool and use that to look up a class while the new implementation only uses the system loader. That being said the types we lookup by name are loaded by the system loader since they are only core JCL types. Further, the lookup using the non-system loader falls back to the system loader so you don't get an accurate result for a lookup anyway (you will miss some failures) so the non-system case is not correct anyway. I'm fine with this change - if we need the non-system loader case it deserves a different API anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This series reimplements
getMethodFromName
in terms ofgetSystemClassFromClassName
andgetMethodFromClass
in order to eliminate the unnecessaryMethodByName
validation kind.