Skip to content

Commit

Permalink
Simplify -Xaggressive code
Browse files Browse the repository at this point in the history
One of the effects of the `-Xaggressive` option is to enable static final field
folding for the JCL classes. Static final field folding is already enabled
under OSR (which is on by default) so this code is now obsolete and will be
deleted in this commit.
For the cases where OSR is disabled we can still enable static final field
folding for JCL classes with the `TR_EnableJCLStaticFinalFieldFolding`
environment variable.

Signed-off-by: Marius Pirvu <[email protected]>
  • Loading branch information
mpirvu committed Feb 21, 2022
1 parent 934d656 commit 3e8aa20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/compiler/optimizer/J9TransformUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ bool J9::TransformUtil::foldFinalFieldsIn(TR_OpaqueClassBlock *clazz, const char
return false;

static char *enableJCLFolding = feGetEnv("TR_EnableJCLStaticFinalFieldFolding");
if ((enableJCLFolding || comp->getOption(TR_AggressiveOpts))
if (enableJCLFolding
&& isStatic
&& comp->fej9()->isClassLibraryClass(clazz)
&& comp->fej9()->isClassInitialized(clazz))
Expand Down

0 comments on commit 3e8aa20

Please sign in to comment.