Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect usage of TR::Options #2290

Merged
merged 2 commits into from
Jul 10, 2018
Merged

Conversation

harryyu1994
Copy link
Contributor

@harryyu1994 harryyu1994 commented Jun 28, 2018

  • during compilation, the per-method TR::Options should be used instead of the global one
  • mostly happens at the Optimizer and Code Generation stage
  • simplify comp()->getOptions()->getOption(TR_XXX) to comp()->getOptions(TR_XXX)

Signed-off-by: Harry Yu harryyu1994@gmail.com

@harryyu1994
Copy link
Contributor Author

@mpirvu Hi Marius, FYI the pull request for incorrect usage of TR::Options in optimizer/code generator is here. There is going to be one for OMR as well.

@harryyu1994
Copy link
Contributor Author

OMR side changes: eclipse-omr/omr#2715

Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -1116,7 +1116,7 @@ TR_ResolvedJ9MethodBase::isInlineable(TR::Compilation *comp)

static intptrj_t getInitialCountForMethod(TR_ResolvedMethod *m, TR::Compilation *comp)
{
TR::Options * options = comp->getOptions()->getCmdLineOptions();
TR::Options * options = comp->getOptions();
Copy link
Contributor

Choose a reason for hiding this comment

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

I am torn about this one: we are asking about the initial count for method m which is not the same as the method being compiled. It's true that asking for the global options is not correct either because the user could have provided specific options for that method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is that true 100% of the time? Are there cases where method m and method being compiled are the same method?

TR_ResolvedMethod *compMethod = comp->getCurrentMethod();
count = compMethod->getInvocationCount();
initialCount = getInitialCountForMethod(compMethod, comp);

^ this looks like they are the same method, no?

Copy link
Contributor Author

@harryyu1994 harryyu1994 Jun 28, 2018

Choose a reason for hiding this comment

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

So this is the call where method m and method being compiled could be different

 intptrj_t initialCount = getInitialCountForMethod(this, comp);

is there a way to get options from TR_ResolvedMethod *m.

@mpirvu
Copy link
Contributor

mpirvu commented Jun 28, 2018

jenkins test all

@harryyu1994
Copy link
Contributor Author

Please do another "jenkins test all".

@harryyu1994 harryyu1994 changed the title WIP: Fix incorrect usage of TR::Options Fix incorrect usage of TR::Options Jun 28, 2018
Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

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

LGTM

- during compilation, the per-method TR::Options should be used instead of the global one
- mostly happens at the Optimizer and Code Generation stage

Signed-off-by: Harry Yu <harryyu1994@gmail.com>
- comp()->getOptions()->getOption(TR_XXX) is equivalent to comp()->getOptions(TR_XXX)
- therefore simplify all similar instances

Signed-off-by: Harry Yu <harryyu1994@gmail.com>
@mpirvu
Copy link
Contributor

mpirvu commented Jul 9, 2018

jenkins test all

@harryyu1994
Copy link
Contributor Author

It does not look like the win test failures are related to this change. I think this is safe to merge (once the linux_390 test finishes).

@mpirvu
Copy link
Contributor

mpirvu commented Jul 10, 2018

Failures are not related to the commit, so I'll merge it

@mpirvu mpirvu merged commit be905b0 into eclipse-openj9:master Jul 10, 2018
@harryyu1994 harryyu1994 deleted the options branch March 13, 2019 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants