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

Avoid checking the class loading constraints with -Xverify:none #5265

Conversation

ChengJin01
Copy link

@ChengJin01 ChengJin01 commented Mar 26, 2019

The change is to avoid checking the class loading constraints
when the verifier is disabled by -Xverify:none.

Close: #4904

Signed-off-by: Cheng Jin jincheng@ca.ibm.com

@ChengJin01
Copy link
Author

The fix was verified by the external user.

Reviewer: @DanHeidinga
FYI: @pshipton

@ChengJin01 ChengJin01 changed the title Avoid checking the class loading contraints with -Xverify:none Avoid checking the class loading constraints with -Xverify:none Mar 26, 2019
@@ -601,7 +603,7 @@ addInterfaceMethods(J9VMThread *vmStruct, J9ClassLoader *classLoader, J9Class *i
if (NULL != methodClass) {
vTableMethodLoader = methodClass->classLoader;
}
if (interfaceLoader != vTableMethodLoader) {
if ((interfaceLoader != vTableMethodLoader) && verifierLoaded) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The verifierLoaded check should be bubbled up to line 601. We don't need to do any of the work in this block other if the verifier is disabled - just the goto continueInterfaceScan; is relevant

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed and moved it to line 601 as suggested.

@@ -454,6 +454,8 @@ addInterfaceMethods(J9VMThread *vmStruct, J9ClassLoader *classLoader, J9Class *i
J9Method **vTableMethods = J9VTABLE_FROM_HEADER(vTableAddress);
J9ROMClass *interfaceROMClass = interfaceClass->romClass;
UDATA count = interfaceROMClass->romMethodCount;
bool verifierLoaded = J9_ARE_ANY_BITS_SET(vmStruct->javaVM->runtimeFlags, J9_RUNTIME_VERIFY);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verifierLoaded -> verifierEnabled

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already renamed to verifierEnabled

@@ -1250,7 +1253,7 @@ processVTableMethod(J9VMThread *vmThread, J9ClassLoader *classLoader, UDATA *vTa
}
/* fill in vtable, override parent slot */
J9ClassLoader *superclassVTableMethodLoader = superclassVTableMethodClass->classLoader;
if (superclassVTableMethodLoader != classLoader) {
if ((superclassVTableMethodLoader != classLoader) && verifierLoaded) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the check out to include line 1255 as well. I'd rather deal with an extra level indenting if it gives simpler to reason about code

Copy link
Author

@ChengJin01 ChengJin01 Mar 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already adjusted the scope of check as suggested.

@DanHeidinga DanHeidinga self-assigned this Mar 27, 2019
The change is to avoid checking the class loading contraints
when the verifier is disabled by -Xverify:none.

Close: eclipse-openj9#4904

Signed-off-by: Cheng Jin <jincheng@ca.ibm.com>
@ChengJin01 ChengJin01 force-pushed the disable_classLoadingconstraints_with_verify_none branch from e2c4592 to 88c2e40 Compare March 27, 2019 04:05
Copy link
Member

@DanHeidinga DanHeidinga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Great job tracking this down @ChengJin01 !

@DanHeidinga
Copy link
Member

Jenkins test sanity zlinux jdk8

@DanHeidinga
Copy link
Member

@ChengJin01 Can you create a PR for this change against the v0.14.0-release branch as well as we've already split for that release.

@ChengJin01
Copy link
Author

ChengJin01 commented Mar 27, 2019

@DanHeidinga , the PR for 0.14.0 has been created at #5272.

@pshipton pshipton merged commit dde0f75 into eclipse-openj9:master Mar 28, 2019
@ChengJin01 ChengJin01 deleted the disable_classLoadingconstraints_with_verify_none branch June 23, 2020 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants