diff --git a/runtime/compiler/control/JITClientCompilationThread.cpp b/runtime/compiler/control/JITClientCompilationThread.cpp index ea368fc1f5f..df2da6bc4d6 100644 --- a/runtime/compiler/control/JITClientCompilationThread.cpp +++ b/runtime/compiler/control/JITClientCompilationThread.cpp @@ -258,7 +258,9 @@ handleServerMessage(JITServer::ClientStream *client, TR_J9VM *fe, JITServer::Mes auto recv = client->getRecvData(); const std::string name = std::get<0>(recv); bool isVettedForAOT = std::get<1>(recv); - client->write(response, fe->getSystemClassFromClassName(name.c_str(), name.length(), isVettedForAOT)); + // Always need non-AOT front-end here, since class validation is done on the server + TR_J9VMBase *fej9 = TR_J9VMBase::get(vmThread->javaVM->jitConfig, vmThread); + client->write(response, fej9->getSystemClassFromClassName(name.c_str(), name.length(), isVettedForAOT)); } break; case MessageType::VM_isMethodTracingEnabled: diff --git a/runtime/compiler/z/codegen/J9TreeEvaluator.cpp b/runtime/compiler/z/codegen/J9TreeEvaluator.cpp index 677e9801ff7..2eef77a0bf9 100644 --- a/runtime/compiler/z/codegen/J9TreeEvaluator.cpp +++ b/runtime/compiler/z/codegen/J9TreeEvaluator.cpp @@ -4002,10 +4002,10 @@ J9::Z::TreeEvaluator::generateTestAndReportFieldWatchInstructions(TR::CodeGenera if (isResolved) { fieldClassReg = cg->allocateRegister(); - if (!(cg->needClassAndMethodPointerRelocations())) + J9Class *fieldClass = static_cast(dataSnippet)->getFieldClass(); + if (!(cg->needClassAndMethodPointerRelocations()) && cg->canUseRelativeLongInstructions(reinterpret_cast(fieldClass))) { // For non-AOT (JIT and JITServer) compiles we don't need to use sideEffectRegister here as the class information is available to us at compile time. - J9Class *fieldClass = static_cast(dataSnippet)->getFieldClass(); TR_ASSERT_FATAL(fieldClass != NULL, "A valid J9Class must be provided for direct rdbar/wrtbar opcodes %p\n", node); generateRILInstruction(cg, TR::InstOpCode::LARL, node, fieldClassReg, static_cast(fieldClass)); } @@ -4822,7 +4822,7 @@ VMarrayStoreCHKEvaluator( if (debugObj) debugObj->addInstructionComment(cursor, "Check if src.type == array.type"); - intptr_t objectClass = (intptr_t) fej9->getSystemClassFromClassName("java/lang/Object", 16, !cg->comp()->isOutOfProcessCompilation()); + intptr_t objectClass = (intptr_t) fej9->getSystemClassFromClassName("java/lang/Object", 16, true); /* * objectClass is used for Object arrays check optimization: when we are storing to Object arrays we can skip all other array store checks * However, TR_J9SharedCacheVM::getSystemClassFromClassName can return 0 when it's impossible to relocate j9class later for AOT loads