Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Make internal classloader instrumentation indy compatible #12242
base: main
Are you sure you want to change the base?
Make internal classloader instrumentation indy compatible #12242
Changes from all commits
0fd0e09
d28efde
18b9029
87f7d42
116daaa
106904e
f351043
e8a5ef2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
[for reviewer] without this the advice return type is assumed to be an array, which means
skipOnIndex
is added when usingskipOn
annotation attribute, and this breaks when advice is not inlined.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.
[minor] maybe add that this class needs to be explicitly initialized early because it's the one preventing recursive calls and is thus the one called first when
loadClass
advice method is executed. Adding a comment where this first call is made would also be relevant too just in case someone tries to add something before it.Also, could we make this static init part of the advice static init instead ? If possible that would be easier to link with the advice method code. On the other hand this
CallDepth
init call might be needed elsewhere.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.
It is in fact not the case that this class needs to be initialized early. It instead needs to be linked to
IndyBootstrap
early:When some
IndyBootstrap.bootstrapAdvice
is executed for the first time, the JVM encounters a call toCallDepth.forClass
. When linking this call, the JVM itself invokesAgentClassLoader.loadClass(CallDepth)
to link that callsite. This in turn will delegate to the instrumentedClassLoader.loadClass
because it is a bootstrap class. It doesn't matter where withinbootstrapAdvice
this call happens, it just happened by chance that it is the first one.For the reasons above: No, this is not possible, because it wouldn't link the usage of
CallDepth
from within theIndyBootstrap
class.