Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/compiler/control/CompilationRuntime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ class CompilationInfo
bool importantMethodForStartup(J9Method *method);
bool shouldDowngradeCompReq(TR_MethodToBeCompiled *entry);

bool isMethodIneligibleForAot(J9Method *method);
bool isMethodIneligibleForAot(J9Method *method, TR_Memory *trMemory);

int32_t computeDynamicDumbInlinerBytecodeSizeCutoff(TR::Options *options);
TR_YesNoMaybe shouldActivateNewCompThread();
Expand Down
30 changes: 25 additions & 5 deletions runtime/compiler/control/CompilationThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,11 +637,32 @@ bool TR::CompilationInfo::importantMethodForStartup(J9Method *method)
}

bool
TR::CompilationInfo::isMethodIneligibleForAot(J9Method *method)
TR::CompilationInfo::isMethodIneligibleForAot(J9Method *method, TR_Memory *trMemory)
{
const J9ROMMethod *romMethod = J9_ROM_METHOD_FROM_RAM_METHOD(method);
const J9ROMClass *romClass = J9_CLASS_FROM_METHOD(method)->romClass;
J9UTF8 *className = J9ROMCLASS_CLASSNAME(romClass);
J9UTF8 *methodName = J9ROMMETHOD_NAME(romMethod);
J9UTF8 *methodSignature = J9ROMMETHOD_SIGNATURE(romMethod);
size_t classNameLength = J9UTF8_LENGTH(className);
size_t methodNameLength = J9UTF8_LENGTH(methodName);
size_t methodSignatureLength = J9UTF8_LENGTH(methodSignature);

if (TR::Options::getAOTCmdLineOptions() && TR::Options::getAOTCmdLineOptions()->getDontCompile())
{
TR::SimpleRegex *regex = TR::Options::getAOTCmdLineOptions()->getDontCompile();
char *name = (char*)trMemory->allocateMemory(classNameLength + 1 + methodNameLength + methodSignatureLength + 1, stackAlloc);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that a frontend is available in the caller of this method (TR_J9VMBase *fe = TR_J9VMBase::get(_jitConfig, vmThread);) Would it be easier to use sampleSignature() to simplify all this?

memset(name, 0, classNameLength + 1 + methodNameLength + methodSignatureLength + 1);
strncpy(name, (char*)J9UTF8_DATA(className), classNameLength);
name[classNameLength] = '.';
strncpy(name + classNameLength + 1, (char*)J9UTF8_DATA(methodName), methodNameLength);
strncpy(name + classNameLength + 1 + methodNameLength, (char*)J9UTF8_DATA(methodSignature), methodSignatureLength);
name[classNameLength + 1 + methodNameLength + methodSignatureLength + 1] = '\0';
if (TR::SimpleRegex::match(regex, name))
{
return true;
}
}

bool disableJLI = true;
#if defined(J9VM_OPT_OPENJDK_METHODHANDLE)
Expand All @@ -658,9 +679,8 @@ TR::CompilationInfo::isMethodIneligibleForAot(J9Method *method)
if (J9UTF8_LENGTH(className) == 36 &&
0 == memcmp(utf8Data(className), "com/ibm/rmi/io/FastPathForCollocated", 36))
{
J9UTF8 *utf8 = J9ROMMETHOD_NAME(romMethod);
if (J9UTF8_LENGTH(utf8) == 21 &&
0 == memcmp(J9UTF8_DATA(utf8), "isVMDeepCopySupported", 21))
if (J9UTF8_LENGTH(methodName) == 21 &&
0 == memcmp(J9UTF8_DATA(methodName), "isVMDeepCopySupported", 21))
return true;
}
return false;
Expand Down Expand Up @@ -7667,7 +7687,7 @@ TR::CompilationInfoPerThreadBase::preCompilationTasks(J9VMThread * vmThread,
|| !entry->_oldStartPC)

// Eligibility checks
&& !_compInfo.isMethodIneligibleForAot(method)
&& !_compInfo.isMethodIneligibleForAot(method, &trMemory)
&& (!TR::Options::getAOTCmdLineOptions()->getOption(TR_AOTCompileOnlyFromBootstrap)
|| fe->isClassLibraryMethod((TR_OpaqueMethodBlock *)method), true)
// Including this here has the effect of forbidding JITServer AOT cache compilations
Expand Down
2 changes: 1 addition & 1 deletion runtime/compiler/env/j9method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ TR_ResolvedRelocatableJ9Method::isCompilable(TR_Memory * trMemory)
{
TR::CompilationInfo *compInfo = TR::CompilationInfo::get(fej9()->_jitConfig);

if (compInfo->isMethodIneligibleForAot(ramMethod()))
if (compInfo->isMethodIneligibleForAot(ramMethod(), trMemory))
return false;

return TR_ResolvedJ9Method::isCompilable(trMemory);
Expand Down