Skip to content

Commit 8a30e5f

Browse files
authored
Merge pull request #18933 from gacholio/asgct
Optimize AsyncGetCallTrace methodID retention
2 parents 5fc665e + 9601088 commit 8a30e5f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

runtime/j9vm/asgct.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ asyncFrameIterator(J9VMThread * currentThread, J9StackWalkState * walkState)
104104
frame->lineno = (jint)walkState->bytecodePCOffset;
105105
}
106106
walkState->userData1 = (void*)(frame + 1);
107+
declaringClass->classLoader->asyncGetCallTraceUsed = 1;
107108
return J9_STACKWALK_KEEP_ITERATING;
108109
}
109110

@@ -213,7 +214,6 @@ void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void *ucontext)
213214
PORT_ACCESS_FROM_JAVAVM(BFUjavaVM);
214215
ASGCT_parms parms = { trace, depth, ucontext, currentThread, num_frames, NULL, NULL, NULL, NULL, NULL, 0 };
215216
UDATA result = 0;
216-
BFUjavaVM->asyncGetCallTraceUsed = 1;
217217
j9sig_protect(
218218
protectedASGCT, (void*)&parms,
219219
emptySignalHandler, NULL,

runtime/oti/j9nonbuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3468,6 +3468,7 @@ typedef struct J9ClassLoader {
34683468
omrthread_monitor_t hotFieldPoolMutex;
34693469
omrthread_rwmutex_t cpEntriesMutex;
34703470
UDATA initClassPathEntryCount;
3471+
UDATA asyncGetCallTraceUsed;
34713472
} J9ClassLoader;
34723473

34733474
#define J9CLASSLOADER_SHARED_CLASSES_ENABLED 8
@@ -6007,7 +6008,6 @@ typedef struct J9JavaVM {
60076008
#if defined(J9VM_OPT_CRIU_SUPPORT)
60086009
omrthread_monitor_t delayedLockingOperationsMutex;
60096010
#endif /* defined(J9VM_OPT_CRIU_SUPPORT) */
6010-
UDATA asyncGetCallTraceUsed;
60116011
U_32 compatibilityFlags;
60126012
} J9JavaVM;
60136013

runtime/vm/classallocation.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ freeClassLoader(J9ClassLoader *classLoader, J9JavaVM *javaVM, J9VMThread *vmThre
378378

379379
if (NULL != classLoader->jniIDs) {
380380
if (J9_ARE_NO_BITS_SET(javaVM->extendedRuntimeFlags2, J9_EXTENDED_RUNTIME2_NEVER_KEEP_JNI_IDS)
381-
&& (javaVM->asyncGetCallTraceUsed || J9_ARE_ANY_BITS_SET(javaVM->extendedRuntimeFlags2, J9_EXTENDED_RUNTIME2_ALWAYS_KEEP_JNI_IDS))
381+
&& (classLoader->asyncGetCallTraceUsed || J9_ARE_ANY_BITS_SET(javaVM->extendedRuntimeFlags2, J9_EXTENDED_RUNTIME2_ALWAYS_KEEP_JNI_IDS))
382382
) {
383383
pool_state idWalkState;
384384
J9GenericJNIID *jniID = pool_startDo(classLoader->jniIDs, &idWalkState);

0 commit comments

Comments
 (0)