-
Notifications
You must be signed in to change notification settings - Fork 738
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
JIT common and x86 support for constant dynamic #2754
Conversation
OMR dependency: eclipse-omr/omr#2912 |
@cathyzhyi Could you do a review? |
Travis CI build failure is expected due to OMR dependency change. |
10fe200
to
e3ae231
Compare
runtime/compiler/env/j9method.cpp
Outdated
// Else if second slot is Void.class, the CP entry is resolved to null (0) value. | ||
// Other casese, the CP entry is considered unresolved. | ||
bool | ||
TR_ResolvedJ9Method::isUnresolvedConstantDynamic(I_32 cpIndex) |
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.
Does the first slot represent the value of the condy and the second slot represent the resolved class of the condy? Maybe it's better to say this explicitly in the comment to avoid confusion especially when the name of the second slot is called exception
.
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.
Both value and exception slots are of object pointer type. If first slot is non null, the CP entry is resolved to a non-null value. Else if second slot is the class object of j/l/Void, the CP entry is resolved to null (0) value. We retrieve the Void class object via javaVM->voidReflectClass->classObject, which is protected by VMAccessCrtiticalSection to ensure vm access. Other cases, the CP entry is considered unresolved. Added VMAccessCrtiticalSection code and more comments.
@yanluo7 , @cathyzhyi any ETA for the latest changes? This blocks the z delivery part. @fjeremic , @gita-omr @andrewcraik |
70f9541
to
140cf1b
Compare
@yanluo7 asked me to review this yesterday - I have just arrived back from vacation so I will try and do a review today. If the review goes well the merge should be very soon, but I would target end of the week. |
runtime/compiler/env/j9method.cpp
Outdated
bool | ||
TR_ResolvedJ9Method::isConstantDynamic(I_32 cpIndex) | ||
{ | ||
TR_ASSERT(cpIndex != -1, "cpIndex shouldn't be -1"); |
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.
This should probably be an TR_ASSERT_FATAL - it will never work with cpIndex -1, it doesn't handle the case, and it is just plain wrong to call it with -1. The check is cheap so keeping it in at runtime will make sure we don't miss a bad use of this API.
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.
Yes, this method should have fatal assertion as this query is the entry point of JIT condy processing logic.
runtime/compiler/env/j9method.cpp
Outdated
void * | ||
TR_ResolvedJ9Method::dynamicConstant(I_32 cpIndex) | ||
{ | ||
TR_ASSERT(cpIndex != -1, "cpIndex shouldn't be -1"); |
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.
same thing for this one
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.
Added fatal assertion here.
{ | ||
char *autoboxClassSig = NULL; | ||
int32_t autoboxClassSigLength = 0; | ||
switch (returnTypeUtf8Data[0]) |
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.
There should be an assert above this to make sure the signature is valid - ie 1 char.
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.
Here we are inside the if (isCondyPrimitive)
condition so it's already implicitly ensured that turnTypeUtf8Length
is 1 for the type signature UTF8 : bool isCondyPrimitive = (1 == returnTypeUtf8Length);
valueOffset = comp()->fej9()->getObjectHeaderSizeInBytes() | ||
+ comp()->fej9()->getInstanceFieldOffset(typeClassBlock, "value", 5, "Z", 1); | ||
break; | ||
default: |
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.
shouldn't this assert?
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.
Yes, added a fatal assertion for unrecognized type signature.
@yanluo7 the new methods need doxygen comments to describe their operation, their inputs and their return values as well as anything else people using the API need to know / be aware of |
37c2667
to
1a803cb
Compare
runtime/compiler/ilgen/Walker.cpp
Outdated
loadConstant(TR::dconst, *(double*)(obj+valueOffset)); | ||
break; | ||
default: | ||
break; |
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.
need an assert here too to match the case above.
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.
Added assertion.
runtime/compiler/ilgen/Walker.cpp
Outdated
dt = TR::Int32; | ||
break; | ||
default: | ||
break; |
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.
Also needs an assert
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.
Added assertion.
Jenkins test sanity all jdk11 |
Ok I think that looks good - will let sanity run and then I think this should be good to go. |
We're waiting for an OMR-Acceptance promotion due to a bad OMR merge causing mutual dependencies for Z codny support. Sorry about that. You can launch a Jenkinds depends build against eclipse/omr#master though. That should work fine. |
Jenkins test sanity all jdk11 depends eclipse/omr#master |
@fjeremic thanks we'll do that - my bad for not noticing since I've been busy with non-openj9 things |
Signed-off-by: Yan Luo <Yan_Luo@ca.ibm.com>
Added missing |
Jenkins test sanity all jdk11 depends eclipse/omr#master |
@yanluo7 can you take a look at sanity and see if the failures are of concern in your opinion - I will look at them separately and see if we agree |
@andrewcraik The entry point to all the constant dynamic logic gated by |
@yanluo7 I agree - there don't seem to be constant dynamic failures in the above so I will merge this. |
Signed-off-by: Yan Luo Yan_Luo@ca.ibm.com