Skip to content

Commit

Permalink
Expose a new limitOption for OpenJ9
Browse files Browse the repository at this point in the history
The option processing framework now includes a limitOption function
overload that allows the user to specify a particular compilation filter
set.

Fixes: #eclipse-openj9/openj9#15399
Signed-off-by: Christian Despres <despresc@ibm.com>
  • Loading branch information
cjjdespres committed Dec 8, 2022
1 parent acdbafc commit a00b0b9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions compiler/ras/Debug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ class TR_Debug
virtual char * limitfileOption(char *, void *, TR::OptionTable *, TR::Options *, bool loadLimit, TR_PseudoRandomNumbersListElement **pseudoRandomListHeadPtr = 0);
virtual char * inlinefileOption(char *, void *, TR::OptionTable *, TR::Options *);
virtual char * limitOption(char *, void *, TR::OptionTable *, TR::Options *, bool loadLimit);
char * limitOption(char *, void *, TR::OptionTable *, TR::Options *, TR::CompilationFilters * &);
virtual int32_t * loadCustomStrategy(char *optFileName);
virtual bool methodCanBeCompiled(TR_Memory *mem, TR_ResolvedMethod *, TR_FilterBST * &);
virtual bool methodCanBeRelocated(TR_Memory *mem, TR_ResolvedMethod *, TR_FilterBST * &);
Expand Down
19 changes: 16 additions & 3 deletions compiler/ras/LimitFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,12 +612,12 @@ TR_Debug::limitfileOption(char *option, void *base, TR::OptionTable *entry, TR::
}

char *
TR_Debug::limitOption(char *option, void *base, TR::OptionTable *entry, TR::Options * cmdLineOptions, bool loadLimit)
TR_Debug::limitOption(char *option, void *base, TR::OptionTable *entry, TR::Options * cmdLineOptions, TR::CompilationFilters *&filters)
{
char *p = option;

// this use the old interface
TR_FilterBST *filter = addFilter(p, static_cast<int32_t>(entry->parm1), 0, 0, loadLimit);
filters = findOrCreateFilters(filters);
TR_FilterBST *filter = addFilter(p, static_cast<int32_t>(entry->parm1), 0, 0, filters);

if (!filter)
return option;
Expand Down Expand Up @@ -682,6 +682,19 @@ TR_Debug::limitOption(char *option, void *base, TR::OptionTable *entry, TR::Opti
return p;
}

char *
TR_Debug::limitOption(char *option, void *base, TR::OptionTable *entry, TR::Options * cmdLineOptions, bool loadLimit)
{
if (loadLimit)
{
return limitOption(option, base, entry, cmdLineOptions, _relocationFilters);
}
else
{
return limitOption(option, base, entry, cmdLineOptions, _compilationFilters);
}
}


void * TR_FilterBST::operator new(size_t size, TR::PersistentAllocator &allocator)
{
Expand Down

0 comments on commit a00b0b9

Please sign in to comment.