-
Notifications
You must be signed in to change notification settings - Fork 722
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
Copy local signature from MethodHandleNatives.resolve #20700
base: master
Are you sure you want to change the base?
Conversation
e59bbaf
to
74b5d5e
Compare
runtime/bcverify/j9bcverify.tdf
Outdated
@@ -91,7 +91,7 @@ TraceExit=Trc_RTV_unlinkClassLoadingConstraints_Exit NoEnv Overhead=1 Level=1 Te | |||
|
|||
TraceEvent=Trc_RTV_checkClassLoadingConstraintForName Overhead=1 Level=3 Template="checkClassLoadingConstraintForName - Checking constraints between %p and %p for %.*s" | |||
|
|||
TraceAssert=Assert_RTV_validateClassLoadingConstraints Overhead=2 Level=5 NoEnv Assert="validateArgs(P1, P2, P3, P4, P5, P6), 1" | |||
TraceAssert=Assert_RTV_validateClassLoadingConstraints Overhead=2 Level=5 NoEnv Assert="validateArgs(P1, P2, P3, P4, P5, P6, P7, P8), 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 trace point is level 5, which is not enabled by default.
We cannot change an existing trace point like this. It could cause problems parsing snap trace file generated by an older build that does not have this change.
Instead of changing this trace point, maybe you can add a new function like the following to set copyUTF1
and copyUTF2
static void
findNamesInSegments(validateArgs (J9VMThread *vmThread, U_8 *name1, U_8 *name2, UDATA *name1Found, UDATA *name2Found)
{
J9MemorySegment *seg = vmThread->javaVM->classMemorySegments->nextSegment;
while (seg) {
if (!(*name1Found)
&& (seg->heapBase <= name1)
&& (seg->heapTop >= name1)
) {
*name1Found = TRUE;
}
/* same for name2 */
/* break if both names are found in the segment */
seg = seg->nextSegment;
}
}
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.
I just noticed this trace point is level 2, so searching the classname is the class segment will have performance impact. There is a better way to fix this. Looking at the caller of j9bcv_checkClassLoadingConstraintsForSignature()
, if the sig1
and sig2
are from the J9ROM** macro, then they are in the class segment and don't need to be copied.
The only case that needs to be copied is lookupSig
here:
openj9/runtime/vm/lookupmethod.c
Lines 239 to 240 in d1adf51
J9NameAndSignature * nas = (J9NameAndSignature *) nameAndSig; | |
lookupSig = nas->signature; |
We could change j9bcv_checkClassLoadingConstraintsForSignature()
to pass in additional parameters to whether copy the strings.
Signed-off-by: Theresa Mammarella <[email protected]>
For the case mentioned in #20189 (comment)
sig1
inj9bcv_checkClassLoadingConstraintsForSignature
should be copied butsig2
does not need to be copied. I added an additional boolean for each signature and it is only set to false if the signature is found in a class memory segment.Related to: #20189