-
Notifications
You must be signed in to change notification settings - Fork 1k
Make internal classloader instrumentation indy compatible #12242
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
Changes from 11 commits
0fd0e09
d28efde
18b9029
87f7d42
116daaa
106904e
f351043
e8a5ef2
67b1d40
57d73cd
b46acad
e54d881
393e3ef
cd7c0f9
7fc8277
33b6130
2456716
dc26c83
0154cd3
5f3f166
b01f387
712c70d
85beb7a
3e03153
05bc99f
492c968
6662850
1173824
43a4ae0
03932e4
add664a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,9 @@ static byte[] transform(byte[] bytes) { | |
| })); | ||
|
|
||
| TransformationContext context = new TransformationContext(); | ||
| if (justDelegateAdvice) { | ||
| context.disableReturnTypeChange(); | ||
| } | ||
|
Comment on lines
+70
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| ClassVisitor cv = | ||
| new ClassVisitor(AsmApi.VERSION, cw) { | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,6 +92,12 @@ public class IndyBootstrap { | |
|
|
||
| IndyBootstrapDispatcher.init( | ||
| MethodHandles.lookup().findStatic(IndyBootstrap.class, "bootstrap", bootstrapMethodType)); | ||
|
|
||
| // Ensure that CallDepth is already loaded in case of bootstrapAdvice recursions with | ||
| // ClassLoader.loadClass | ||
| // This is required because CallDepth is a bootstrap class and therefore triggers our | ||
| // ClassLoader.loadClass instrumentations | ||
| Class.forName(CallDepth.class.getName()); | ||
|
||
| } catch (Exception e) { | ||
| throw new IllegalStateException(e); | ||
| } | ||
|
|
||
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.
Not related to this PR but I think we need to add a method to the experimental interface that lets instrumentation module declare that it is compatible with non-inline advice so we could disable the advice rewriting for it.
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.
I was thinking of it but felt like this instrumentation was a special case where this was needed and that would only be temporary until we remove support for non-indy instrumentations.
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.
Actually I was thinking that the main use for it would be to track the indy conversion progress and ensuring that modules that were made indy compatible once aren't broken by later changes. I'm pretty sure there was at least one more module that use the same trick to disable the advice rewriting.