Skip to content

Commit

Permalink
Merge pull request #3162 from liqunl/vhfieldfolding
Browse files Browse the repository at this point in the history
Fold static final fields that are VarHandle
  • Loading branch information
andrewcraik authored Oct 9, 2018
2 parents 436de15 + 6b95a95 commit 60f29e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/compiler/compile/J9SymbolReferenceTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ J9::SymbolReferenceTable::findOrCreateStaticSymbol(TR::ResolvedMethodSymbol * ow
TR_OpaqueClassBlock *declaringClass = owningMethod->getDeclaringClassFromFieldOrStatic(comp(), cpIndex);
if (declaringClass && fej9->isClassInitialized(declaringClass))
{
static const char *foldVarHandle = feGetEnv("TR_FoldVarHandle");
static const char *dontFoldVarHandle = feGetEnv("TR_DontFoldVarHandle");
int32_t clazzNameLength = 0;
char *clazzName = fej9->getClassNameChars(declaringClass, clazzNameLength);
bool createKnownObject = false;
Expand All @@ -1387,7 +1387,7 @@ J9::SymbolReferenceTable::findOrCreateStaticSymbol(TR::ResolvedMethodSymbol * ow
{
createKnownObject = true;
}
else if ((foldVarHandle || comp()->getOption(TR_AggressiveOpts))
else if (!dontFoldVarHandle
&& (clazzNameLength != 16 || strncmp(clazzName, "java/lang/System", 16)))
{
TR_OpaqueClassBlock *varHandleClass = fej9->getSystemClassFromClassName("java/lang/invoke/VarHandle", 26);
Expand Down

0 comments on commit 60f29e8

Please sign in to comment.