Skip to content
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

Get metadataCache field without caching to avoid circular dependency #11761

Merged
merged 1 commit into from
Jan 26, 2021

Conversation

JasonFengJ9
Copy link
Member

@JasonFengJ9 JasonFengJ9 commented Jan 25, 2021

Introduced a private helper method getDeclaredFieldInternal() to get metadataCache field without caching to avoid circular dependency.

Note: Initial #10930 caused cmdLineTester_jvmtitests cma001 failing / crashing (#11040) at AIX platform:

...
<30002a00>      !j9method 0x000000003000A188   java/lang/Class.getCanonicalName()Ljava/lang/String;
<30002a00>                              JNI call-in frame
<30002a00>                              Native method frame
<30002a00>                              Generic special frame
<30002a00>      !j9method 0x0000000030103398   jdk/internal/reflect/NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
<30002a00>      !j9method 0x0000000030101BC0   jdk/internal/reflect/DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
<30002a00>      !j9method 0x0000000030036660   java/lang/reflect/Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
<30002a00>      !j9method 0x000000003000A3E8   java/lang/Class.lookupCachedField(Ljava/lang/String;)Ljava/lang/reflect/Field;
<30002a00>      !j9method 0x0000000030009288   java/lang/Class.getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
<30002a00>      !j9method 0x0000000030009DC8   java/lang/Class.getFieldOffset(Ljava/lang/Class;Ljava/lang/String;J)J
<30002a00>      !j9method 0x0000000030009DE8   java/lang/Class.getFieldOffset(Ljava/lang/String;)J
<30002a00>      !j9method 0x0000000030009D28   java/lang/Class.getMetadataCache()Ljava/lang/Class$MetadataCache;
<30002a00>      !j9method 0x000000003000A188   java/lang/Class.getCanonicalName()Ljava/lang/String;
<30002a00>                              JNI call-in frame
<30002a00>                              Native method frame
<30002a00>                              Generic special frame
<30002a00>      !j9method 0x0000000030103398   jdk/internal/reflect/NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
...

This PR is at top of #10930 (didn't rebase previous commit due to various changes afterwards)
Also included #11017

Verified in a personal build ( JDK 8/11/15 ppc64_aix) that sanity.functional passes with this PR.

close #11040
Fixes #9963

Signed-off-by: Jason Feng fengj@ca.ibm.com

@JasonFengJ9
Copy link
Member Author

@pshipton Could you please review?

fyi @DanHeidinga @alexey-anufriev

@alexey-anufriev
Copy link
Contributor

@JasonFengJ9, would it make sense to include these changes as well
4021d2a#diff-ad8aa32f0e56523cfba2c1fdf6705314463c53cf344d1fd79be3abd0c624f6eb ?

@pshipton, I think after this I can continue with #11041, right?

@JasonFengJ9
Copy link
Member Author

would it make sense to include these changes as well
4021d2a#diff-ad8aa32f0e56523cfba2c1fdf6705314463c53cf344d1fd79be3abd0c624f6eb ?

yeah, included it.

Introduced a private helper method getDeclaredFieldInternal() to get
metadataCache field without caching to avoid circular dependency.

Signed-off-by: Jason Feng <fengj@ca.ibm.com>
@pshipton
Copy link
Member

jenkins test sanity aix jdk8,jdk11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants