Skip to content

Commit 5975f9f

Browse files
[GR-71886] Partial implementation of CremaPartialType.sameRuntimePackage
PullRequest: graal/22808
2 parents ce63100 + 869ed01 commit 5975f9f

File tree

2 files changed

+8
-2
lines changed
  • espresso-shared/src/com.oracle.truffle.espresso.classfile/src/com/oracle/truffle/espresso/classfile/descriptors
  • substratevm/src/com.oracle.svm.interpreter/src/com/oracle/svm/interpreter

2 files changed

+8
-2
lines changed

espresso-shared/src/com.oracle.truffle.espresso.classfile/src/com/oracle/truffle/espresso/classfile/descriptors/TypeSymbols.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,11 @@ public static Symbol<Name> toClassNameEntry(Symbol<Type> type, ParserConstantPoo
454454
return symbolify.apply(className);
455455
}
456456

457-
public static ByteSequence getRuntimePackage(ByteSequence symbol) {
457+
public static ByteSequence getRuntimePackage(Symbol<Type> symbol) {
458+
return TypeSymbols.getRuntimePackage((ByteSequence) symbol);
459+
}
460+
461+
private static ByteSequence getRuntimePackage(ByteSequence symbol) {
458462
if (symbol.byteAt(0) == '[') {
459463
int arrayDimensions = getArrayDimensions(symbol);
460464
return getRuntimePackage(symbol.subSequence(arrayDimensions));

substratevm/src/com.oracle.svm.interpreter/src/com/oracle/svm/interpreter/CremaSupportImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,9 @@ public List<CremaPartialMethod> getDeclaredMethodsList() {
746746
@Override
747747
public boolean sameRuntimePackage(InterpreterResolvedJavaType otherType) {
748748
// GR-62339 runtime packages
749-
return false;
749+
ByteSequence thisRuntimePackage = TypeSymbols.getRuntimePackage(parserKlass.getType());
750+
Symbol<Name> thatRuntimePackage = otherType.getSymbolicRuntimePackage();
751+
return thisRuntimePackage.equals(thatRuntimePackage);
750752
}
751753

752754
@Override

0 commit comments

Comments
 (0)