Skip to content

Commit

Permalink
Set declared class in shadow with new query
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Despres <[email protected]>
  • Loading branch information
cjjdespres committed Nov 27, 2024
1 parent 287cf40 commit 427a956
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions runtime/compiler/compile/J9SymbolReferenceTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -826,30 +826,8 @@ J9::SymbolReferenceTable::findOrFabricateShadowSymbol(
qualifiedFieldName,
TR::Symbol::UnknownField);

// As yet JITServer does not support getClassFromSignature() based directly
// on J9ConstantPool*, but it does support it using TR_OpaqueMethodBlock*.
// Find an arbitrary method (if there is one) defined by the same class that
// declares the field, and use that method to getClassFromSignature(), since
// it will have the desired constant pool.
//
// The class containing the field is highly likely to declare at least a
// constructor, and if it doesn't, then it seems that it's not possible to
// instantiate it in the usual way (new, dup, invokespecial <init>), so the
// performance of accesses to its instance fields is especially unlikely to
// matter.
//
TR_J9VM *fej9 = reinterpret_cast<TR_J9VM *>(fe());
if (fej9->getNumMethods(containingClass) > 0)
{
auto *firstMethod =
static_cast<TR_OpaqueMethodBlock*>(fej9->getMethods(containingClass));

TR_OpaqueClassBlock *declaredClass = fej9->getClassFromSignature(
signature, (int32_t)strlen(signature), firstMethod);

if (declaredClass != NULL)
sym->setDeclaredClass(declaredClass);
}
TR_OpaqueClassBlock *declaredClass = fej9->getClassFromSignature(signature, (int32_t)strlen(signature), containingClass);

mcount_t methodIndex = mcount_t::valueOf(0);
int32_t cpIndex = -1;
Expand Down

0 comments on commit 427a956

Please sign in to comment.