Skip to content

Commit

Permalink
Merge pull request #8307 from klangman/PR142037
Browse files Browse the repository at this point in the history
Add option to disable aliasing of primitive box class final fields
  • Loading branch information
andrewcraik committed Jan 23, 2020
2 parents 5fcc8ec + 7be683f commit d1fe7a3
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions runtime/compiler/compile/J9SymbolReferenceTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1959,15 +1959,18 @@ J9::SymbolReferenceTable::checkImmutable(TR::SymbolReference *symRef)
"java/lang/String"
};

TR_ASSERT(sizeof(names)/sizeof(char *) == _numImmutableClasses,"Size of names array is not correct\n");
int32_t i;
for (i = 0; i < _numImmutableClasses; i++)
if (!comp()->getOption(TR_DisableImmutableFieldAliasing))
{
if (strcmp(names[i].name, name) == 0)
TR_ASSERT(sizeof(names)/sizeof(char *) == _numImmutableClasses,"Size of names array is not correct\n");
int32_t i;
for (i = 0; i < _numImmutableClasses; i++)
{
_hasImmutable = true;
_immutableSymRefNumbers[i]->set(symRef->getReferenceNumber());
break;
if (strcmp(names[i].name, name) == 0)
{
_hasImmutable = true;
_immutableSymRefNumbers[i]->set(symRef->getReferenceNumber());
break;
}
}
}

Expand Down

0 comments on commit d1fe7a3

Please sign in to comment.