Skip to content

Commit 55503f9

Browse files
committed
Remove redundant lookup for fileEntry ClassEntry.makePrimaryRange(...)
1 parent be96642 commit 55503f9

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed

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

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -337,25 +337,11 @@ public ClassEntry getSuperClass() {
337337
return superClass;
338338
}
339339

340-
public Range makePrimaryRange(String methodName, String symbolName, String paramSignature, String returnTypeName, StringTable stringTable, MethodEntry method, int lo,
341-
int hi, int primaryLine) {
340+
public Range makePrimaryRange(String symbolName, StringTable stringTable, MethodEntry method, int lo, int hi, int primaryLine) {
342341
FileEntry fileEntryToUse = method.fileEntry;
343342
if (fileEntryToUse == null) {
344-
/*
345-
* Search for a matching method to supply the file entry or failing that use the one
346-
* from this class.
347-
*/
348-
for (MethodEntry methodEntry : methods) {
349-
if (methodEntry.match(methodName, paramSignature, returnTypeName)) {
350-
/* maybe the method's file entry */
351-
fileEntryToUse = methodEntry.getFileEntry();
352-
break;
353-
}
354-
}
355-
if (fileEntryToUse == null) {
356-
/* Last chance is the class's file entry. */
357-
fileEntryToUse = this.fileEntry;
358-
}
343+
/* Last chance is the class's file entry. */
344+
fileEntryToUse = this.fileEntry;
359345
}
360346
return new Range(symbolName, stringTable, method, fileEntryToUse, lo, hi, primaryLine);
361347
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public void installDebugInfo(DebugInfoProvider debugInfoProvider) {
248248
/* Search for a method defining this primary range. */
249249
ClassEntry classEntry = ensureClassEntry(className);
250250
MethodEntry methodEntry = classEntry.ensureMethodEntry(debugCodeInfo, this, debugContext);
251-
Range primaryRange = classEntry.makePrimaryRange(methodName, symbolName, paramSignature, returnTypeName, stringTable, methodEntry, lo, hi, primaryLine);
251+
Range primaryRange = classEntry.makePrimaryRange(symbolName, stringTable, methodEntry, lo, hi, primaryLine);
252252
debugContext.log(DebugContext.INFO_LEVEL, "PrimaryRange %s.%s %s %s:%d [0x%x, 0x%x]", className, methodName, filePath, fileName, primaryLine, lo, hi);
253253
classEntry.indexPrimary(primaryRange, debugCodeInfo.getFrameSizeChanges(), debugCodeInfo.getFrameSize());
254254
debugCodeInfo.lineInfoProvider().forEach(debugLineInfo -> {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public Range(String symbolName, StringTable stringTable, MethodEntry methodEntry
6565
*/
6666
private Range(String symbolName, StringTable stringTable, MethodEntry methodEntry, FileEntry fileEntry, int lo, int hi, int line,
6767
Range primary) {
68-
this.fileEntry = fileEntry; // TODO remove and use fileEntry from MethodEntry
68+
this.fileEntry = fileEntry;
6969
if (fileEntry != null) {
7070
stringTable.uniqueDebugString(fileEntry.getFileName());
7171
stringTable.uniqueDebugString(fileEntry.getPathName());

0 commit comments

Comments
 (0)