Skip to content

VPKnownObject Constraints for JITServer - #7565

Merged
vijaysun-omr merged 1 commit into
eclipse-omr:masterfrom
luke-li-2003:ServerVPKnownObject
Dec 3, 2024
Merged

VPKnownObject Constraints for JITServer#7565
vijaysun-omr merged 1 commit into
eclipse-omr:masterfrom
luke-li-2003:ServerVPKnownObject

Conversation

@luke-li-2003

Copy link
Copy Markdown
Contributor

Ensure VPKnownObject works in server mode with appropriate queries.

@luke-li-2003

Copy link
Copy Markdown
Contributor Author

@mpirvu

Comment thread compiler/optimizer/VPConstraint.cpp Outdated
vp->addConstraint(constraint, hash);
}
}
TR_J9VMBase::ObjectClassInfo ci = vp->comp()->fej9()->getObjectClassInfoFromKnownObjectIndex

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread compiler/optimizer/VPConstraint.cpp Outdated
}
}
TR_OpaqueClassBlock *clazz = vp->comp()->fej9()->getObjectClassFromKnownObjectIndex
(vp->comp(), index, isJavaLangClass);

Copy link
Copy Markdown
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

mpirvu commented Nov 28, 2024

Copy link
Copy Markdown
Contributor

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
Comment thread compiler/optimizer/VPConstraint.cpp Outdated
bool matchJavaLangClass;
TR_OpaqueClassBlock *clazz = vp->comp()->fej9()->getObjectClassFromKnownObjectIndex
(vp->comp(), index, &matchJavaLangClass);
TR_ASSERT(matchJavaLangClass == isJavaLangClass,

Copy link
Copy Markdown
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;

Comment thread compiler/optimizer/VPConstraint.cpp Outdated
TR::VMAccessCriticalSection::tryToAcquireVMAccess);

if (vpConstStringCriticalSection.hasVMAccess())
if (vpConstStringCriticalSection.hasVMAccess() && 0)

Copy link
Copy Markdown
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
Copy Markdown
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 <luke.li@ibm.com>
@mpirvu

mpirvu commented Dec 2, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

jenkins build all

@vijaysun-omr vijaysun-omr self-assigned this Dec 2, 2024
@vijaysun-omr

Copy link
Copy Markdown
Contributor

Jenkins build all

@vijaysun-omr

Copy link
Copy Markdown
Contributor

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

@mpirvu mpirvu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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