Skip to content

Commit bfdd4a8

Browse files
authored
Merge pull request #23064 from mpirvu/knot-fix-cleanup
Code cleanup after knownObjectTable caching
2 parents 5bfd48a + 02115ba commit bfdd4a8

File tree

7 files changed

+0
-83
lines changed

7 files changed

+0
-83
lines changed

runtime/compiler/control/JITClientCompilationThread.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -632,16 +632,6 @@ handleResponse(JITServer::MessageType response, JITServer::ClientStream *client,
632632
client->write(response, result, isJL);
633633
}
634634
break;
635-
case MessageType::VM_getObjectClassInfoFromObjectReferenceLocation:
636-
{
637-
auto recv = client->getRecvData<uintptr_t>();
638-
uintptr_t objectReferenceLocation = std::get<0>(recv);
639-
auto ci = fe->getObjectClassInfoFromObjectReferenceLocation(comp, objectReferenceLocation);
640-
client->write(response,
641-
ci,
642-
knot->getPointerLocation(ci.knownObjectIndex));
643-
}
644-
break;
645635
case MessageType::VM_getObjectClassInfoFromKnotIndex:
646636
{
647637
auto recv = client->getRecvData<TR::KnownObjectTable::Index>();

runtime/compiler/env/VMJ9.cpp

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,47 +1253,6 @@ TR_J9VMBase::getStaticReferenceFieldAtAddress(uintptr_t fieldAddress)
12531253
return (uintptr_t)J9STATIC_OBJECT_LOAD(vmThread(), NULL, fieldAddress);
12541254
}
12551255

1256-
TR_J9VMBase::ObjectClassInfo
1257-
TR_J9VMBase::getObjectClassInfoFromObjectReferenceLocation(TR::Compilation *comp,
1258-
uintptr_t objectReferenceLocation)
1259-
{
1260-
// The objectReferenceLocation is required to have come from
1261-
// KnownObjectTable::getPointerLocation().
1262-
TR::KnownObjectTable *knot = comp->getKnownObjectTable();
1263-
TR_ASSERT_FATAL(knot != NULL, "missing known object table");
1264-
1265-
TR::KnownObjectTable::Index knownObjectIndex =
1266-
knot->getExistingIndexAt((uintptr_t*)objectReferenceLocation);
1267-
1268-
TR_ASSERT_FATAL(
1269-
knownObjectIndex != TR::KnownObjectTable::UNKNOWN,
1270-
"objectReferenceLocation must originate from the known object table");
1271-
1272-
TR_J9VMBase::ObjectClassInfo ci = {};
1273-
TR::VMAccessCriticalSection vmAccess(comp);
1274-
1275-
uintptr_t objectReference = knot->getPointer(knownObjectIndex);
1276-
ci.clazz = getObjectClass(objectReference);
1277-
ci.isString = isString(ci.clazz);
1278-
ci.jlClass = getClassClassPointer(ci.clazz);
1279-
ci.isFixedJavaLangClass = (ci.jlClass == ci.clazz);
1280-
if (ci.isFixedJavaLangClass)
1281-
{
1282-
// A FixedClass constraint means something different
1283-
// when the class happens to be java/lang/Class.
1284-
// Must add constraints pertaining to the class that
1285-
// the java/lang/Class object represents.
1286-
ci.clazz = getClassFromJavaLangClass(objectReference);
1287-
}
1288-
1289-
ci.knownObjectIndex = knownObjectIndex;
1290-
1291-
J9::ConstProvenanceGraph *cpg = comp->constProvenanceGraph();
1292-
cpg->addEdge(cpg->knownObject(knownObjectIndex), ci.clazz);
1293-
1294-
return ci;
1295-
}
1296-
12971256
TR::KnownObjectTable::ObjectInfo
12981257
TR_J9VMBase::getObjClassInfoFromKnotIndexNoCaching(TR::Compilation *comp, TR::KnownObjectTable::Index knotIndex)
12991258
{

runtime/compiler/env/VMJ9.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -653,19 +653,6 @@ class TR_J9VMBase : public TR_FrontEnd
653653
virtual uintptr_t getStaticReferenceFieldAtAddress(uintptr_t fieldAddress);
654654
virtual int32_t getInt32FieldAt(uintptr_t objectPointer, uintptr_t fieldOffset);
655655

656-
/* Used to contain all information needed for getObjectClassInfoFromObjectReferenceLocation
657-
* to create a VPKnownObject constraint.
658-
*/
659-
struct ObjectClassInfo
660-
{
661-
TR_OpaqueClassBlock *clazz;
662-
TR_OpaqueClassBlock *jlClass;
663-
bool isFixedJavaLangClass;
664-
bool isString;
665-
TR::KnownObjectTable::Index knownObjectIndex;
666-
};
667-
virtual ObjectClassInfo getObjectClassInfoFromObjectReferenceLocation
668-
(TR::Compilation *comp, uintptr_t objectReferenceLocation);
669656
virtual TR::KnownObjectTable::ObjectInfo getObjClassInfoFromKnotIndexNoCaching(TR::Compilation *comp, TR::KnownObjectTable::Index knotIndex);
670657
TR::KnownObjectTable::ObjectInfo getObjClassInfoFromKnotIndex(TR::Compilation *comp, TR::KnownObjectTable::Index knotIndex);
671658

runtime/compiler/env/VMJ9Server.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -963,19 +963,6 @@ TR_J9ServerVM::getStaticReferenceFieldAtAddress(uintptr_t fieldAddress)
963963
TR_ASSERT_FATAL(false, "getStaticReferenceFieldAtAddress() should not be called by JITServer");
964964
}
965965

966-
TR_J9VMBase::ObjectClassInfo
967-
TR_J9ServerVM::getObjectClassInfoFromObjectReferenceLocation(TR::Compilation *comp, uintptr_t objectReferenceLocation)
968-
{
969-
JITServer::ServerStream *stream = _compInfoPT->getMethodBeingCompiled()->_stream;
970-
stream->write(JITServer::MessageType::VM_getObjectClassInfoFromObjectReferenceLocation,
971-
objectReferenceLocation);
972-
auto recv = stream->read<TR_J9VMBase::ObjectClassInfo, uintptr_t *>();
973-
TR_J9VMBase::ObjectClassInfo result = std::get<0>(recv);
974-
uintptr_t *objectReferenceLocationClient = std::get<1>(recv);
975-
comp->getKnownObjectTable()->updateKnownObjectTableAtServer(result.knownObjectIndex, objectReferenceLocationClient);
976-
return result;
977-
}
978-
979966
TR::KnownObjectTable::ObjectInfo
980967
TR_J9ServerVM::getObjClassInfoFromKnotIndexNoCaching(TR::Compilation *comp, TR::KnownObjectTable::Index knotIndex)
981968
{

runtime/compiler/env/VMJ9Server.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,7 @@ class TR_J9ServerVM: public TR_J9VM
113113
virtual TR_OpaqueClassBlock *getObjectClassFromKnownObjectIndex(TR::Compilation *comp, TR::KnownObjectTable::Index idx) override;
114114
virtual TR_OpaqueClassBlock *getObjectClassFromKnownObjectIndex(TR::Compilation *comp, TR::KnownObjectTable::Index idx, bool *isJavaLangClass) override;
115115
virtual uintptr_t getStaticReferenceFieldAtAddress(uintptr_t fieldAddress) override;
116-
117-
virtual ObjectClassInfo getObjectClassInfoFromObjectReferenceLocation
118-
(TR::Compilation *comp, uintptr_t objectReferenceLocation) override;
119116
virtual TR::KnownObjectTable::ObjectInfo getObjClassInfoFromKnotIndexNoCaching(TR::Compilation *comp, TR::KnownObjectTable::Index knotIndex) override;
120-
121117
virtual bool stackWalkerMaySkipFrames(TR_OpaqueMethodBlock *method, TR_OpaqueClassBlock *clazz) override;
122118
virtual bool hasFinalFieldsInClass(TR_OpaqueClassBlock *clazz) override;
123119
virtual const char *sampleSignature(TR_OpaqueMethodBlock * aMethod, char *buf, int32_t bufLen, TR_Memory *memory) override;

runtime/compiler/net/MessageTypes.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ const char *messageNames[] =
119119
"VM_getObjectClassAt",
120120
"VM_getObjectClassFromKnownObjectIndex",
121121
"VM_getObjectClassFromKnownObjectIndexJLClass",
122-
"VM_getObjectClassInfoFromObjectReferenceLocation",
123122
"VM_stackWalkerMaySkipFrames",
124123
"VM_classInitIsFinished",
125124
"VM_getClassFromNewArrayType",

runtime/compiler/net/MessageTypes.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ enum MessageType : uint16_t
130130
VM_getObjectClassAt,
131131
VM_getObjectClassFromKnownObjectIndex,
132132
VM_getObjectClassFromKnownObjectIndexJLClass,
133-
VM_getObjectClassInfoFromObjectReferenceLocation,
134133
VM_stackWalkerMaySkipFrames,
135134
VM_classInitIsFinished,
136135
VM_getClassFromNewArrayType,

0 commit comments

Comments
 (0)