From 355a31d207a28d66a03351498fefe33b4c358c95 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 16 Dec 2023 13:47:43 +0000 Subject: Make structs GC objects --- .../org/shedlang/compiler/patio/PatioCodeGenStructs.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/shedlang/compiler/patio/PatioCodeGenStructs.java b/src/main/java/org/shedlang/compiler/patio/PatioCodeGenStructs.java index 67461ff6..36274023 100644 --- a/src/main/java/org/shedlang/compiler/patio/PatioCodeGenStructs.java +++ b/src/main/java/org/shedlang/compiler/patio/PatioCodeGenStructs.java @@ -166,9 +166,9 @@ public class PatioCodeGenStructs { } private static PatioDataLayout unknownStructDataLayout() { - return PatioDataLayouts.struct(List.of( + return PatioCodeGenGc.gcObjectDataLayout(PatioDataLayouts.struct(List.of( PatioDataLayouts.INT - )); + ))); } private static PatioDataLayout structDataLayout( @@ -177,18 +177,19 @@ public class PatioCodeGenStructs { ) { var structTypeInfo = context.structTypeInfo(type); - return PatioDataLayouts.struct(List.of( + return PatioCodeGenGc.gcObjectDataLayout(PatioDataLayouts.struct(List.of( PatioDataLayouts.INT, PatioDataLayouts.struct(Lists.repeat( PatioDataLayouts.INT, structTypeInfo.fieldCount() )) - )); + ))); } - private static final List TAG_OFFSET = List.of(0); + private static final List TAG_OFFSET + = PatioCodeGenGc.gcObjectOffset(List.of(0)); private static List fieldOffset(int fieldIndex) { - return List.of(1, fieldIndex); + return PatioCodeGenGc.gcObjectOffset(List.of(1, fieldIndex)); } } -- cgit v1.2.3