Skip to content

Commit 6d0b2d8

Browse files
committed
Annotate the type of HiddenKey values
* Makes it easy to check which ones can contain objects or not.
1 parent 31b6d32 commit 6d0b2d8

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/main/java/org/truffleruby/Layouts.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ public abstract class Layouts {
9898
// These must appear before the generated layout list so the identifiers have been initialized by the time
9999
// the layout singletons are created.
100100

101-
public static final HiddenKey OBJECT_ID_IDENTIFIER = new HiddenKey("object_id");
102-
public static final HiddenKey TAINTED_IDENTIFIER = new HiddenKey("tainted?");
103-
public static final HiddenKey FROZEN_IDENTIFIER = new HiddenKey("frozen?");
104-
public static final HiddenKey ASSOCIATED_IDENTIFIER = new HiddenKey("associated");
105-
public static final HiddenKey FINALIZER_REF_IDENTIFIER = new HiddenKey("finalizerRef");
106-
public static final HiddenKey MARKED_OBJECTS_IDENTIFIER = new HiddenKey("marked_objects");
107-
public static final HiddenKey VALUE_WRAPPER_IDENTIFIER = new HiddenKey("value_wrapper");
101+
public static final HiddenKey OBJECT_ID_IDENTIFIER = new HiddenKey("object_id"); // long
102+
public static final HiddenKey TAINTED_IDENTIFIER = new HiddenKey("tainted?"); // boolean
103+
public static final HiddenKey FROZEN_IDENTIFIER = new HiddenKey("frozen?"); // boolean
104+
public static final HiddenKey ASSOCIATED_IDENTIFIER = new HiddenKey("associated"); // Pointer[]
105+
public static final HiddenKey FINALIZER_REF_IDENTIFIER = new HiddenKey("finalizerRef"); // FinalizerReference
106+
public static final HiddenKey MARKED_OBJECTS_IDENTIFIER = new HiddenKey("marked_objects"); // Object[]
107+
public static final HiddenKey VALUE_WRAPPER_IDENTIFIER = new HiddenKey("value_wrapper"); // ValueWrapper
108108

109109
// Generated layouts
110110

src/main/java/org/truffleruby/core/format/unpack/UnpackRootNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public Object execute(VirtualFrame frame) {
4444
frame.setInt(FormatFrameDescriptor.SOURCE_LENGTH_SLOT, (int) arguments[1]);
4545
frame.setInt(FormatFrameDescriptor.SOURCE_POSITION_SLOT, 0);
4646
frame.setBoolean(FormatFrameDescriptor.SOURCE_TAINTED_SLOT, (boolean) arguments[2]);
47-
frame.setObject(FormatFrameDescriptor.SOURCE_ASSOCIATED_SLOT, frame.getArguments()[3]);
47+
frame.setObject(FormatFrameDescriptor.SOURCE_ASSOCIATED_SLOT, arguments[3]);
4848
frame.setObject(FormatFrameDescriptor.OUTPUT_SLOT, new Object[expectedLength]);
4949
frame.setInt(FormatFrameDescriptor.OUTPUT_POSITION_SLOT, 0);
5050
frame.setBoolean(FormatFrameDescriptor.TAINT_SLOT, false);

0 commit comments

Comments
 (0)