Skip to content

Commit

Permalink
Respond to review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
adinn committed Apr 14, 2023
1 parent 8428e0e commit d52edf9
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class ClassEntry extends StructureTypeEntry {
/**
* Details of the associated file.
*/
private FileEntry fileEntry;
private final FileEntry fileEntry;
/**
* Details of the associated loader.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ public class CompiledMethodEntry {
/**
* The primary range detailed by this object.
*/
private PrimaryRange primary;
private final PrimaryRange primary;
/**
* Details of the class owning this range.
*/
private ClassEntry classEntry;
private final ClassEntry classEntry;
/**
* Details of of compiled method frame size changes.
*/
private List<DebugFrameSizeChange> frameSizeInfos;
private final List<DebugFrameSizeChange> frameSizeInfos;
/**
* Size of compiled method frame.
*/
private int frameSize;
private final int frameSize;

public CompiledMethodEntry(PrimaryRange primary, List<DebugFrameSizeChange> frameSizeInfos, int frameSize, ClassEntry classEntry) {
this.primary = primary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -716,17 +716,6 @@ public boolean isHubClassEntry(ClassEntry classEntry) {
return classEntry.getTypeName().equals(DwarfDebugInfo.HUB_TYPE_NAME);
}

public int classLayoutAbbrevCode(ClassEntry classEntry) {
if (!useHeapBase & isHubClassEntry(classEntry)) {
/*
* This layout adds special logic to remove tag bits from indirect pointers to this
* type.
*/
return DwarfDebugInfo.DW_ABBREV_CODE_class_layout2;
}
return DwarfDebugInfo.DW_ABBREV_CODE_class_layout1;
}

public ClassEntry getHubClassEntry() {
return hubClassEntry;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
* into directory tables once only rather than once per file.
*/
public class DirEntry {
private Path path;
private int idx;
private final Path path;
private final int idx;

public DirEntry(Path path, int idx) {
this.path = path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
* Tracks debug info associated with a Java source file.
*/
public class FileEntry {
private String fileName;
private DirEntry dirEntry;
private int idx;
private final String fileName;
private final DirEntry dirEntry;
private final int idx;

public FileEntry(String fileName, DirEntry dirEntry, int idx) {
this.fileName = fileName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import java.util.stream.Stream;

public class InterfaceClassEntry extends ClassEntry {
private List<ClassEntry> implementors;
private final List<ClassEntry> implementors;

public InterfaceClassEntry(String className, FileEntry fileEntry, int size) {
super(className, fileEntry, size);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* need to be embedded in debug info that identifies class and method names.
*/
public class LoaderEntry {
String loaderId;
private final String loaderId;

public LoaderEntry(String id) {
loaderId = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
public abstract class MemberEntry {
protected FileEntry fileEntry;
protected int line;
protected final int line;
protected final String memberName;
protected final StructureTypeEntry ownerType;
protected final TypeEntry valueType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public class MethodEntry extends MemberEntry {
static final int INLINED = 1 << 2;
static final int IS_OVERRIDE = 1 << 3;
static final int IS_CONSTRUCTOR = 1 << 4;
int flags;
int vtableOffset = -1;
final String symbolName;
private int flags;
private final int vtableOffset;
private final String symbolName;

public MethodEntry(DebugInfoBase debugInfoBase, DebugMethodInfo debugMethodInfo,
FileEntry fileEntry, int line, String methodName, ClassEntry ownerType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
import static com.oracle.objectfile.debuginfo.DebugInfoProvider.DebugPrimitiveTypeInfo.FLAG_SIGNED;

public class PrimitiveTypeEntry extends TypeEntry {
char typeChar;
int flags;
int bitCount;
private char typeChar;
private int flags;
private int bitCount;

public PrimitiveTypeEntry(String typeName, int size) {
super(typeName, size);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* be located in the debug_string section and, if so, tracks the offset at which it gets written.
*/
public class StringEntry {
private String string;
private final String string;
private int offset;
private boolean addToStrSection;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public abstract class StructureTypeEntry extends TypeEntry {
/**
* Details of fields located in this instance.
*/
protected List<FieldEntry> fields;
protected final List<FieldEntry> fields;

public StructureTypeEntry(String typeName, int size) {
super(typeName, size);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public abstract class TypeEntry {
/**
* The name of this type.
*/
protected String typeName;
protected final String typeName;

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

protected TypeEntry(String typeName, int size) {
this.typeName = typeName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,22 +310,22 @@ public class DwarfDebugInfo extends DebugInfoBase {
*/
public static final String HUB_TYPE_NAME = "java.lang.Class";

private DwarfStrSectionImpl dwarfStrSection;
private DwarfAbbrevSectionImpl dwarfAbbrevSection;
private DwarfInfoSectionImpl dwarfInfoSection;
private DwarfLocSectionImpl dwarfLocSection;
private DwarfARangesSectionImpl dwarfARangesSection;
private DwarfLineSectionImpl dwarfLineSection;
private DwarfFrameSectionImpl dwarfFameSection;
private final DwarfStrSectionImpl dwarfStrSection;
private final DwarfAbbrevSectionImpl dwarfAbbrevSection;
private final DwarfInfoSectionImpl dwarfInfoSection;
private final DwarfLocSectionImpl dwarfLocSection;
private final DwarfARangesSectionImpl dwarfARangesSection;
private final DwarfLineSectionImpl dwarfLineSection;
private final DwarfFrameSectionImpl dwarfFameSection;
public final ELFMachine elfMachine;
/**
* Register used to hold the heap base.
*/
private byte heapbaseRegister;
private final byte heapbaseRegister;
/**
* Register used to hold the current thread.
*/
private byte threadRegister;
private final byte threadRegister;

/**
* A collection of properties associated with each generated type record indexed by type name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class DwarfInfoSectionImpl extends DwarfSectionImpl {
/**
* The name of a special DWARF struct type used to model an object header.
*/
public static final String OBJECT_HEADER_STRUCT_NAME = "_objhdr";
private static final String OBJECT_HEADER_STRUCT_NAME = "_objhdr";

/**
* An info header section always contains a fixed number of bytes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
public abstract class DwarfSectionImpl extends BasicProgbitsSectionImpl {
// auxiliary class used to track byte array positions
protected class Cursor {
int pos;
private int pos;

public Cursor() {
this(0);
Expand All @@ -90,7 +90,7 @@ public int get() {
}
}

protected DwarfDebugInfo dwarfSections;
protected final DwarfDebugInfo dwarfSections;
protected boolean debug = false;
protected long debugTextBase = 0;
protected long debugAddress = 0;
Expand Down

0 comments on commit d52edf9

Please sign in to comment.