Skip to content

Conversation

@KavinSatheeskumar
Copy link
Contributor

@KavinSatheeskumar KavinSatheeskumar commented Oct 31, 2025

Add an additional option to prevent AOT compilation on specified methods.

A quick note on the Xjit:exclude= option.

Xjit:exclude= is a so called "limit option" (which means the callback used to process it is OMR::Options::limitOption.) This method calls TR::Options::debug()->limitOption(..., bool) to create a new limit option.

limit options are available so that individual compilations can have separate options set that differ from the main options. Typically, a regex is specified indicating which methods should have the predetermined options enabled.

TR::Options::debug()->limitOption(..., bool) essentially delegates to TR_Debug::limitOption(..., TR::CompilationFilters), however, if the final boolean is true, then _relocationFilters is passed into TR_Debug::limitOption(..., TR::CompilationFilters), otherwise _compilationFilters is passed.

_relocationFilters only applies to AOT loads and _compilationFilters applies to all methods. This makes it difficult to apply options selectively to JIT compilation.

Moreover, the system is rather convoluted so this approach makes things substantially easier.

Depends on eclipse-omr/omr#8008

@KavinSatheeskumar
Copy link
Contributor Author

KavinSatheeskumar commented Oct 31, 2025

Note this PR will be marked as non-draft when -Xaot:dontCompile={method1} -Xaot:dontCompile={method2} is supported

nevermind, we decided this is not desirable

@KavinSatheeskumar KavinSatheeskumar marked this pull request as ready for review October 31, 2025 19:40
const J9ROMClass *romClass = J9_CLASS_FROM_METHOD(method)->romClass;
J9UTF8 *className = J9ROMCLASS_CLASSNAME(romClass);
size_t classNameLength = J9UTF8_LENGTH(className);

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible that TR::Options::getAOTCmdLineOptions() does not exist?

trMemory->freeMemory(name, stackAlloc);
return true;
}
trMemory->freeMemory(name, stackAlloc);
Copy link
Contributor

Choose a reason for hiding this comment

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

Not needed.

void TR_Memory::freeMemory(void *p, TR_AllocationKind kind, ObjectType ot)
{
    switch (kind) {
        case persistentAlloc:
            _trPersistentMemory->freePersistentMemory(p);
            break;
        default:
            (void)0;
            break;
    }
}

if (regex)
{
char *name = (char*)trMemory->allocateMemory(classNameLength+1, stackAlloc); // TODO: find correct way to allocate
strncpy(name, (char*)J9UTF8_DATA(className), classNameLength);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you compare only the class name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants