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 #2715

Merged
merged 1 commit into from
Jul 5, 2018

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), they are equivalent
  • switch _options usage to options in OMRCompilation constructor

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

@harryyu1994 harryyu1994 changed the title Fix incorrect usage of TR::Options WIP: 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.

I would like some small changes to the Compilation constructor. The code looks good otherwise.

@@ -326,13 +326,13 @@ OMR::Compilation::Compilation(
// while the PersistentMethodInfo is allocated during codegen creation
// Access to this list must be performed with assumptionTableMutex in hand
//
if (!TR::Options::getCmdLineOptions()->getOption(TR_DisableFastAssumptionReclamation))
if (!_options->getOption(TR_DisableFastAssumptionReclamation))
Copy link
Contributor

Choose a reason for hiding this comment

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

The parameter options is the same thing here.

_metadataAssumptionList = new (m->trPersistentMemory()) TR::SentinelRuntimeAssumption();
#endif

//Random fields must be set before allocating codegen
_primaryRandom = new (m->trHeapMemory()) TR_RandomGenerator(options.getRandomSeed());
_adhocRandom = new (m->trHeapMemory()) TR_RandomGenerator(options.getRandomSeed());
_primaryRandom = new (m->trHeapMemory()) TR_RandomGenerator(_options->getRandomSeed());
Copy link
Contributor

Choose a reason for hiding this comment

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

The code was good as it was because options is the per compilation Options object

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I changed it because I saw many more instances of _options than options so I changed everything to _options to avoid confusion. Do you prefer using options or just want this part of the code unchanged?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I would prefer to use the parameter options

@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
- simplify comp()->getOptions()->getOption(TR_XXX) to comp()->getOptions(TR_XXX), they are equivalent
- switch _options usage to options in OMRCompilation ctor

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

Hi @vijaysun-omr, could you help merge this change as well as eclipse-openj9/openj9#2290, I think they are ready to go in, thanks a lot.

@vijaysun-omr
Copy link
Contributor

@genie-omr build all

@vijaysun-omr vijaysun-omr merged commit a311903 into eclipse-omr:master Jul 5, 2018
@harryyu1994 harryyu1994 deleted the options branch July 6, 2018 04:48
cathyzhyi pushed a commit to cathyzhyi/omr that referenced this pull request Jul 30, 2018
Internal pointers are never actually disabled for <= warm level until
recent refactoring in OMR changed it to use the correct API and disbled
it for real. Disabling internal pointers for <= warm opt level would
hurt performance so we need to enable it.

pr: eclipse-omr#2715

Signed-off-by: Yi Zhang <yizhang@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants