Skip to content

Commit 753a595

Browse files
committed
Don't add methodEntries for every method in a class
Method entries are now added on demand only when reachable (through a primary or a sub Range)
1 parent acfec7a commit 753a595

File tree

3 files changed

+0
-87
lines changed

3 files changed

+0
-87
lines changed

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/ClassEntry.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ public void addDebugInfo(DebugInfoBase debugInfoBase, DebugTypeInfo debugTypeInf
134134
debugInstanceTypeInfo.interfaces().forEach(interfaceName -> processInterface(interfaceName, debugInfoBase, debugContext));
135135
/* Add details of fields and field types */
136136
debugInstanceTypeInfo.fieldInfoProvider().forEach(debugFieldInfo -> this.processField(debugFieldInfo, debugInfoBase, debugContext));
137-
/* Add details of methods and method types */
138-
debugInstanceTypeInfo.methodInfoProvider().forEach(methodFieldInfo -> this.ensureMethodEntry(methodFieldInfo, debugInfoBase, debugContext));
139137
}
140138

141139
public void indexPrimary(Range primary, List<DebugFrameSizeChange> frameSizeInfos, int frameSize) {

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debuginfo/DebugInfoProvider.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ interface DebugInstanceTypeInfo extends DebugTypeInfo {
134134

135135
Stream<DebugFieldInfo> fieldInfoProvider();
136136

137-
Stream<DebugMethodInfo> methodInfoProvider();
138-
139137
String superName();
140138

141139
Stream<String> interfaces();

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageDebugInfoProvider.java

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,6 @@ public Stream<DebugFieldInfo> fieldInfoProvider() {
558558
}
559559
}
560560

561-
@Override
562-
public Stream<DebugMethodInfo> methodInfoProvider() {
563-
return Arrays.stream(hostedType.getAllDeclaredMethods()).map(this::createDebugMethodInfo);
564-
}
565-
566561
@Override
567562
public String superName() {
568563
HostedClass superClass = hostedType.getSuperclass();
@@ -590,10 +585,6 @@ protected NativeImageDebugFieldInfo createDebugStaticFieldInfo(ResolvedJavaField
590585
return new NativeImageDebugFieldInfo((HostedField) field);
591586
}
592587

593-
protected NativeImageDebugMethodInfo createDebugMethodInfo(HostedMethod method) {
594-
return new NativeImageDebugMethodInfo(method);
595-
}
596-
597588
protected class NativeImageDebugFieldInfo extends NativeImageDebugFileInfo implements DebugFieldInfo {
598589
private final HostedField field;
599590

@@ -654,80 +645,6 @@ private boolean isPrimitive() {
654645
}
655646
}
656647

657-
protected class NativeImageDebugMethodInfo extends NativeImageDebugFileInfo implements DebugMethodInfo {
658-
private final HostedMethod hostedMethod;
659-
660-
NativeImageDebugMethodInfo(HostedMethod hostedMethod) {
661-
super(hostedMethod);
662-
this.hostedMethod = hostedMethod;
663-
}
664-
665-
@Override
666-
public String name() {
667-
String name = hostedMethod.format("%n");
668-
if ("<init>".equals(name)) {
669-
name = getJavaType(hostedMethod, true).toJavaName();
670-
if (name.indexOf('.') >= 0) {
671-
name = name.substring(name.lastIndexOf('.') + 1);
672-
}
673-
if (name.indexOf('$') >= 0) {
674-
name = name.substring(name.lastIndexOf('$') + 1);
675-
}
676-
}
677-
return name;
678-
}
679-
680-
@Override
681-
public String ownerType() {
682-
return typeName();
683-
}
684-
685-
@Override
686-
public String valueType() {
687-
return hostedMethod.getSignature().getReturnType(null).toJavaName();
688-
}
689-
690-
@Override
691-
public String paramSignature() {
692-
return hostedMethod.format("%P");
693-
}
694-
695-
@Override
696-
public List<String> paramTypes() {
697-
LinkedList<String> paramTypes = new LinkedList<>();
698-
Signature signature = hostedMethod.getSignature();
699-
for (int i = 0; i < signature.getParameterCount(false); i++) {
700-
paramTypes.add(signature.getParameterType(i, null).toJavaName());
701-
}
702-
return paramTypes;
703-
}
704-
705-
@Override
706-
public List<String> paramNames() {
707-
/* Can only provide blank names for now. */
708-
LinkedList<String> paramNames = new LinkedList<>();
709-
Signature signature = hostedMethod.getSignature();
710-
for (int i = 0; i < signature.getParameterCount(false); i++) {
711-
paramNames.add("");
712-
}
713-
return paramNames;
714-
}
715-
716-
@Override
717-
public String symbolNameForMethod() {
718-
return NativeImage.localSymbolNameForMethod(hostedMethod);
719-
}
720-
721-
@Override
722-
public boolean isDeoptTarget() {
723-
return name().endsWith(HostedMethod.METHOD_NAME_DEOPT_SUFFIX);
724-
}
725-
726-
@Override
727-
public int modifiers() {
728-
return hostedMethod.getModifiers();
729-
}
730-
}
731648
}
732649

733650
private class NativeImageDebugInterfaceTypeInfo extends NativeImageDebugInstanceTypeInfo implements DebugInterfaceTypeInfo {

0 commit comments

Comments
 (0)