Skip to content

Commit d52edf9

Browse files
committed
Respond to review feedback
1 parent 8428e0e commit d52edf9

16 files changed

+35
-46
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class ClassEntry extends StructureTypeEntry {
6262
/**
6363
* Details of the associated file.
6464
*/
65-
private FileEntry fileEntry;
65+
private final FileEntry fileEntry;
6666
/**
6767
* Details of the associated loader.
6868
*/

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ public class CompiledMethodEntry {
4141
/**
4242
* The primary range detailed by this object.
4343
*/
44-
private PrimaryRange primary;
44+
private final PrimaryRange primary;
4545
/**
4646
* Details of the class owning this range.
4747
*/
48-
private ClassEntry classEntry;
48+
private final ClassEntry classEntry;
4949
/**
5050
* Details of of compiled method frame size changes.
5151
*/
52-
private List<DebugFrameSizeChange> frameSizeInfos;
52+
private final List<DebugFrameSizeChange> frameSizeInfos;
5353
/**
5454
* Size of compiled method frame.
5555
*/
56-
private int frameSize;
56+
private final int frameSize;
5757

5858
public CompiledMethodEntry(PrimaryRange primary, List<DebugFrameSizeChange> frameSizeInfos, int frameSize, ClassEntry classEntry) {
5959
this.primary = primary;

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -716,17 +716,6 @@ public boolean isHubClassEntry(ClassEntry classEntry) {
716716
return classEntry.getTypeName().equals(DwarfDebugInfo.HUB_TYPE_NAME);
717717
}
718718

719-
public int classLayoutAbbrevCode(ClassEntry classEntry) {
720-
if (!useHeapBase & isHubClassEntry(classEntry)) {
721-
/*
722-
* This layout adds special logic to remove tag bits from indirect pointers to this
723-
* type.
724-
*/
725-
return DwarfDebugInfo.DW_ABBREV_CODE_class_layout2;
726-
}
727-
return DwarfDebugInfo.DW_ABBREV_CODE_class_layout1;
728-
}
729-
730719
public ClassEntry getHubClassEntry() {
731720
return hubClassEntry;
732721
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
* into directory tables once only rather than once per file.
3737
*/
3838
public class DirEntry {
39-
private Path path;
40-
private int idx;
39+
private final Path path;
40+
private final int idx;
4141

4242
public DirEntry(Path path, int idx) {
4343
this.path = path;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
* Tracks debug info associated with a Java source file.
3131
*/
3232
public class FileEntry {
33-
private String fileName;
34-
private DirEntry dirEntry;
35-
private int idx;
33+
private final String fileName;
34+
private final DirEntry dirEntry;
35+
private final int idx;
3636

3737
public FileEntry(String fileName, DirEntry dirEntry, int idx) {
3838
this.fileName = fileName;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import java.util.stream.Stream;
3737

3838
public class InterfaceClassEntry extends ClassEntry {
39-
private List<ClassEntry> implementors;
39+
private final List<ClassEntry> implementors;
4040

4141
public InterfaceClassEntry(String className, FileEntry fileEntry, int size) {
4242
super(className, fileEntry, size);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* need to be embedded in debug info that identifies class and method names.
3333
*/
3434
public class LoaderEntry {
35-
String loaderId;
35+
private final String loaderId;
3636

3737
public LoaderEntry(String id) {
3838
loaderId = id;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
*/
3333
public abstract class MemberEntry {
3434
protected FileEntry fileEntry;
35-
protected int line;
35+
protected final int line;
3636
protected final String memberName;
3737
protected final StructureTypeEntry ownerType;
3838
protected final TypeEntry valueType;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public class MethodEntry extends MemberEntry {
5151
static final int INLINED = 1 << 2;
5252
static final int IS_OVERRIDE = 1 << 3;
5353
static final int IS_CONSTRUCTOR = 1 << 4;
54-
int flags;
55-
int vtableOffset = -1;
56-
final String symbolName;
54+
private int flags;
55+
private final int vtableOffset;
56+
private final String symbolName;
5757

5858
public MethodEntry(DebugInfoBase debugInfoBase, DebugMethodInfo debugMethodInfo,
5959
FileEntry fileEntry, int line, String methodName, ClassEntry ownerType,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
import static com.oracle.objectfile.debuginfo.DebugInfoProvider.DebugPrimitiveTypeInfo.FLAG_SIGNED;
3737

3838
public class PrimitiveTypeEntry extends TypeEntry {
39-
char typeChar;
40-
int flags;
41-
int bitCount;
39+
private char typeChar;
40+
private int flags;
41+
private int bitCount;
4242

4343
public PrimitiveTypeEntry(String typeName, int size) {
4444
super(typeName, size);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* be located in the debug_string section and, if so, tracks the offset at which it gets written.
3232
*/
3333
public class StringEntry {
34-
private String string;
34+
private final String string;
3535
private int offset;
3636
private boolean addToStrSection;
3737

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public abstract class StructureTypeEntry extends TypeEntry {
4343
/**
4444
* Details of fields located in this instance.
4545
*/
46-
protected List<FieldEntry> fields;
46+
protected final List<FieldEntry> fields;
4747

4848
public StructureTypeEntry(String typeName, int size) {
4949
super(typeName, size);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public abstract class TypeEntry {
4141
/**
4242
* The name of this type.
4343
*/
44-
protected String typeName;
44+
protected final String typeName;
4545

4646
/**
4747
* The offset of the java.lang.Class instance for this class in the image heap or -1 if no such
@@ -52,7 +52,7 @@ public abstract class TypeEntry {
5252
/**
5353
* The size of an occurrence of this type in bytes.
5454
*/
55-
protected int size;
55+
protected final int size;
5656

5757
protected TypeEntry(String typeName, int size) {
5858
this.typeName = typeName;

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfDebugInfo.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -310,22 +310,22 @@ public class DwarfDebugInfo extends DebugInfoBase {
310310
*/
311311
public static final String HUB_TYPE_NAME = "java.lang.Class";
312312

313-
private DwarfStrSectionImpl dwarfStrSection;
314-
private DwarfAbbrevSectionImpl dwarfAbbrevSection;
315-
private DwarfInfoSectionImpl dwarfInfoSection;
316-
private DwarfLocSectionImpl dwarfLocSection;
317-
private DwarfARangesSectionImpl dwarfARangesSection;
318-
private DwarfLineSectionImpl dwarfLineSection;
319-
private DwarfFrameSectionImpl dwarfFameSection;
313+
private final DwarfStrSectionImpl dwarfStrSection;
314+
private final DwarfAbbrevSectionImpl dwarfAbbrevSection;
315+
private final DwarfInfoSectionImpl dwarfInfoSection;
316+
private final DwarfLocSectionImpl dwarfLocSection;
317+
private final DwarfARangesSectionImpl dwarfARangesSection;
318+
private final DwarfLineSectionImpl dwarfLineSection;
319+
private final DwarfFrameSectionImpl dwarfFameSection;
320320
public final ELFMachine elfMachine;
321321
/**
322322
* Register used to hold the heap base.
323323
*/
324-
private byte heapbaseRegister;
324+
private final byte heapbaseRegister;
325325
/**
326326
* Register used to hold the current thread.
327327
*/
328-
private byte threadRegister;
328+
private final byte threadRegister;
329329

330330
/**
331331
* A collection of properties associated with each generated type record indexed by type name.

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfInfoSectionImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public class DwarfInfoSectionImpl extends DwarfSectionImpl {
6363
/**
6464
* The name of a special DWARF struct type used to model an object header.
6565
*/
66-
public static final String OBJECT_HEADER_STRUCT_NAME = "_objhdr";
66+
private static final String OBJECT_HEADER_STRUCT_NAME = "_objhdr";
6767

6868
/**
6969
* An info header section always contains a fixed number of bytes.

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfSectionImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
public abstract class DwarfSectionImpl extends BasicProgbitsSectionImpl {
6464
// auxiliary class used to track byte array positions
6565
protected class Cursor {
66-
int pos;
66+
private int pos;
6767

6868
public Cursor() {
6969
this(0);
@@ -90,7 +90,7 @@ public int get() {
9090
}
9191
}
9292

93-
protected DwarfDebugInfo dwarfSections;
93+
protected final DwarfDebugInfo dwarfSections;
9494
protected boolean debug = false;
9595
protected long debugTextBase = 0;
9696
protected long debugAddress = 0;

0 commit comments

Comments
 (0)