diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-12-16 15:39:47 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-12-16 15:40:05 +0000 |
| commit | 877fbb4c5b2f1a2f62e8ba2731bae60a86a9ff22 (patch) | |
| tree | a8eebad047d6087fa4975d0097a54cc4bd7dbec8 | |
| parent | 7171b9c14ed8b4d6c2ea363c5be1f08a151d7688 (diff) | |
Make vars a GC object
4 files changed, 12 insertions, 11 deletions
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenVarLoadTests]/[method:canGenerateCodeForVarLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenVarLoadTests]/[method:canGenerateCodeForVarLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 0d838ce0..ef53a77c 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenVarLoadTests]/[method:canGenerateCodeForVarLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenVarLoadTests]/[method:canGenerateCodeForVarLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -12,8 +12,8 @@ Instructions: memory-load (local "varValue__x__0") pointer=(local "local__x") - layout=int - offset=() + layout=(struct ((struct (data-ptr int int int)) int)) + offset=(1) ) ) diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenVarStoreTests]/[method:canGenerateCodeForVarStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenVarStoreTests]/[method:canGenerateCodeForVarStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 7b23df0f..902cd13f 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenVarStoreTests]/[method:canGenerateCodeForVarStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenVarStoreTests]/[method:canGenerateCodeForVarStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -10,8 +10,8 @@ Instructions: ( memory-store pointer=(local "local__x") - layout=int - offset=() + layout=(struct ((struct (data-ptr int int int)) int)) + offset=(1) value=(local "b") ) ) diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenVarStoreTests]/[method:canStoreIntoVarMultipleTimes(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenVarStoreTests]/[method:canStoreIntoVarMultipleTimes(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index d299f1ae..b49f2c88 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenVarStoreTests]/[method:canStoreIntoVarMultipleTimes(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenVarStoreTests]/[method:canStoreIntoVarMultipleTimes(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -10,15 +10,15 @@ Instructions: ( memory-store pointer=(local "local__x") - layout=int - offset=() + layout=(struct ((struct (data-ptr int int int)) int)) + offset=(1) value=(local "b") ) ( memory-store pointer=(local "local__x") - layout=int - offset=() + layout=(struct ((struct (data-ptr int int int)) int)) + offset=(1) value=(local "a") ) ) diff --git a/src/main/java/org/shedlang/compiler/patio/PatioCodeGenVars.java b/src/main/java/org/shedlang/compiler/patio/PatioCodeGenVars.java index 6058529d..e06b283e 100644 --- a/src/main/java/org/shedlang/compiler/patio/PatioCodeGenVars.java +++ b/src/main/java/org/shedlang/compiler/patio/PatioCodeGenVars.java @@ -16,9 +16,10 @@ public class PatioCodeGenVars { private PatioCodeGenVars() { } - private static final PatioDataLayout VAR_DATA_LAYOUT - = PatioDataLayouts.fromType(PatioCodeGenTypes.VALUE_TYPE); - private static final List<Integer> VALUE_OFFSET = List.of(); + private static final PatioDataLayout VAR_DATA_LAYOUT = + PatioCodeGenGc.gcObjectDataLayout(PatioDataLayouts.fromType(PatioCodeGenTypes.VALUE_TYPE)); + + private static final List<Integer> VALUE_OFFSET = PatioCodeGenGc.gcObjectOffset(List.of()); public static PatioCodeGenContext alloc( String shidName, |
