Skip to content

Commit 4dd9cd0

Browse files
committed
Change exception being caught to NPE and fix compilation errors
1 parent a964844 commit 4dd9cd0

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

jcl/src/java.base/share/classes/com/ibm/jit/JITHelpers.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,9 +1184,9 @@ public static Object invoke(MethodAccessor ma, Object obj, Object[] args) throws
11841184
try {
11851185
return ma.invoke(obj, args);
11861186
} catch (InvocationTargetException e) {
1187-
if (e.getCause() != null && e.getCause().getClass().getName().equals("java.lang.AssertionError")) {
1187+
if (e.getCause() != null && e.getCause().getClass().getName().equals("java.lang.NullPointerException")) {
11881188
// TODO: Need synchronization to prevent many threads entering here
1189-
System.err.println("Caught org.opentest4j.AssertionFailedError inside JITHelpers");
1189+
System.err.println("Caught java.lang.NullPointerException inside JITHelpers");
11901190

11911191
debugAgentRun(ma, obj, args);
11921192

runtime/compiler/control/DebugAgent.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ debugAgentRevertToInterpreter(J9VMThread* vmThread, J9JITExceptionTable *jitMeth
221221

222222
void *pc = compInfo->getPCIfCompiled(jitMethod->ramMethod);
223223
fprintf(stderr, "Invalidating PC = %p %.*s.%.*s%.*s\n", pc,
224-
(UDATA)J9UTF8_LENGTH(className), J9UTF8_DATA(className),
225-
(UDATA)J9UTF8_LENGTH(methName), J9UTF8_DATA(methName),
226-
(UDATA)J9UTF8_LENGTH(methSig), J9UTF8_DATA(methSig));
224+
(int)J9UTF8_LENGTH(className), J9UTF8_DATA(className),
225+
(int)J9UTF8_LENGTH(methName), J9UTF8_DATA(methName),
226+
(int)J9UTF8_LENGTH(methSig), J9UTF8_DATA(methSig));
227227

228228
TR::Recompilation::methodCannotBeRecompiled(pc, frontendOfThread);
229229

@@ -269,10 +269,10 @@ debugAgentRecompile(J9VMThread* vmThread, J9JITExceptionTable *jitMethod, IDATA
269269
J9UTF8 *className = J9ROMCLASS_CLASSNAME(clazz->romClass);
270270

271271
void *pc = compInfo->getPCIfCompiled(jitMethod->ramMethod);
272-
fprintf(stderr, "Recompiling PC = %p lastOptIndex = %d lastOptSubIndex = %d %.*s.%.*s%.*s\n", pc, lastOptIndex, lastOptSubIndex,
273-
(UDATA)J9UTF8_LENGTH(className), J9UTF8_DATA(className),
274-
(UDATA)J9UTF8_LENGTH(methName), J9UTF8_DATA(methName),
275-
(UDATA)J9UTF8_LENGTH(methSig), J9UTF8_DATA(methSig));
272+
fprintf(stderr, "Recompiling PC = %p lastOptIndex = %d lastOptSubIndex = %d %.*s.%.*s%.*s\n", pc, (int)lastOptIndex, (int)lastOptSubIndex,
273+
(int)J9UTF8_LENGTH(className), J9UTF8_DATA(className),
274+
(int)J9UTF8_LENGTH(methName), J9UTF8_DATA(methName),
275+
(int)J9UTF8_LENGTH(methSig), J9UTF8_DATA(methSig));
276276

277277
// The request to use a trace log gets passed to the compilation via the optimization plan. The options object
278278
// created before the compile is issued will use the trace log we provide to initialize IL tracing.

0 commit comments

Comments
 (0)