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

VPKnownObject Constraints for JITServer #7565

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

luke-li-2003
Copy link
Contributor

Ensure VPKnownObject works in server mode with appropriate queries.

@luke-li-2003
Copy link
Contributor Author

@mpirvu

vp->addConstraint(constraint, hash);
}
}
TR_J9VMBase::ObjectClassInfo ci = vp->comp()->fej9()->getObjectClassInfoFromKnownObjectIndex
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is TR_J9VMBase::ObjectClassInfo defined?

Copy link
Contributor

Choose a reason for hiding this comment

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

Note that getObjectClassInfoFromKnownObjectIndex() already exists, but does not do exactly what the code it replaces does.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ObjectClassInfo is defined under class TR_J9VMBase in VMJ9.h, I see a few other structs defined like that as well.

}
}
TR_OpaqueClassBlock *clazz = vp->comp()->fej9()->getObjectClassFromKnownObjectIndex
(vp->comp(), index, isJavaLangClass);
Copy link
Contributor

Choose a reason for hiding this comment

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

This implementation eliminates the assert that made sure that, whenever the parameter isJavaLangClass is true, clazz is the class the java/lang/class

@mpirvu
Copy link
Contributor

mpirvu commented Nov 28, 2024

This PR depends on eclipse-openj9/openj9#20695

@luke-li-2003 luke-li-2003 force-pushed the ServerVPKnownObject branch 2 times, most recently from 1a9e704 to a855f6d Compare November 28, 2024 17:16
bool matchJavaLangClass;
TR_OpaqueClassBlock *clazz = vp->comp()->fej9()->getObjectClassFromKnownObjectIndex
(vp->comp(), index, &matchJavaLangClass);
TR_ASSERT(matchJavaLangClass == isJavaLangClass,
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer this assert to be made FATAL.
Also, I propose the following message:

"Use createForJavaLangClass if and only if the object is an instance of java/lang/Class;

@@ -1385,7 +1375,7 @@ TR::VPConstString *TR::VPConstString::create(OMR::ValuePropagation *vp, TR::Symb
TR::VMAccessCriticalSection vpConstStringCriticalSection(vp->comp(),
TR::VMAccessCriticalSection::tryToAcquireVMAccess);

if (vpConstStringCriticalSection.hasVMAccess())
if (vpConstStringCriticalSection.hasVMAccess() && 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess these "&& 0" are hacks that will be removed

if (vp->comp()->isOutOfProcessCompilation())
return false;

TR::KnownObjectTable *knot = vp->comp()->getKnownObjectTable();
Copy link
Contributor

Choose a reason for hiding this comment

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

We should keep this test that makes sure knot exists

@luke-li-2003 luke-li-2003 force-pushed the ServerVPKnownObject branch 4 times, most recently from e764ea2 to 55816c2 Compare December 2, 2024 17:05
Ensure VPKnownObject works in server mode with appropriate queries.

Signed-off-by: Luke Li <[email protected]>
@mpirvu
Copy link
Contributor

mpirvu commented Dec 2, 2024

I think we can make this PR ready for review by the OMR committers.

@luke-li-2003 luke-li-2003 marked this pull request as ready for review December 2, 2024 18:17
@vijaysun-omr
Copy link
Contributor

jenkins build all

@vijaysun-omr vijaysun-omr self-assigned this Dec 2, 2024
@vijaysun-omr
Copy link
Contributor

Jenkins build all

@vijaysun-omr
Copy link
Contributor

@mpirvu may I ask you to formally approve when you are good with these changes ? Since you were having a conversation with Luke.

Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

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

LGTM

@vijaysun-omr vijaysun-omr merged commit 9ac0d11 into eclipse-omr:master Dec 3, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants