Skip to content

Commit

Permalink
Merge pull request #6922 from dchopra001/romToRamClass
Browse files Browse the repository at this point in the history
Don't access ROM class from RAM class directly
  • Loading branch information
mpirvu authored Sep 4, 2019
2 parents a7dbfa6 + eb2649c commit ec5d412
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions runtime/compiler/codegen/J9TreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ uint32_t J9::TreeEvaluator::calculateInstanceOfOrCheckCastSequences(TR::Node *in

TR::StaticSymbol *castClassSym = castClassSymRef->getSymbol()->getStaticSymbol();
TR_OpaqueClassBlock *castClass = (TR_OpaqueClassBlock *)castClassSym->getStaticAddress();
J9UTF8 *castClassName = J9ROMCLASS_CLASSNAME(((J9Class *)castClass)->romClass);
J9UTF8 *castClassName = J9ROMCLASS_CLASSNAME(TR::Compiler->cls.romClassOf((TR_OpaqueClassBlock *) castClass));
// Cast class is a primitive (implies this is an instanceof, since you can't cast an object to a primitive).
// Usually removed by the optimizer, but in case they're not we know they'll always fail, no object can be of a primitive type.
// We don't even need to do a null test unless it's a checkcastAndNULLCHK node.
Expand Down Expand Up @@ -834,7 +834,7 @@ uint32_t J9::TreeEvaluator::calculateInstanceOfOrCheckCastSequences(TR::Node *in
{
for (int i=0; i<numProfiledClasses; i++)
{
J9UTF8 *profiledClassName = J9ROMCLASS_CLASSNAME(((J9Class *)profiledClassList[i].profiledClass)->romClass);
J9UTF8 *profiledClassName = J9ROMCLASS_CLASSNAME(TR::Compiler->cls.romClassOf((TR_OpaqueClassBlock *) profiledClassList[i].profiledClass));
traceMsg(cg->comp(), "%s:Interpreter profiling instance class: [" POINTER_PRINTF_FORMAT "] %.*s, probability=%.1f\n",
instanceOfOrCheckCastNode->getOpCode().getName(), profiledClassList[i].profiledClass, J9UTF8_LENGTH(profiledClassName), J9UTF8_DATA(profiledClassName), profiledClassList[i].frequency);
}
Expand All @@ -858,7 +858,7 @@ uint32_t J9::TreeEvaluator::calculateInstanceOfOrCheckCastSequences(TR::Node *in
{
if (singleImplementerClass)
{
J9UTF8 *singleImplementerClassName = J9ROMCLASS_CLASSNAME(((J9Class *)singleImplementerClass)->romClass);
J9UTF8 *singleImplementerClassName = J9ROMCLASS_CLASSNAME(TR::Compiler->cls.romClassOf((TR_OpaqueClassBlock *) singleImplementerClass));
traceMsg(cg->comp(), "%s: Single implementer for interface/abstract class: [" POINTER_PRINTF_FORMAT "] %.*s\n",
instanceOfOrCheckCastNode->getOpCode().getName(), singleImplementerClass, J9UTF8_LENGTH(singleImplementerClassName), J9UTF8_DATA(singleImplementerClassName));
}
Expand Down

0 comments on commit ec5d412

Please sign in to comment.