From 660f8ae4a3869129ed0a35b83a8a87ef2c042fdf Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 16 Dec 2023 22:14:06 +0000 Subject: Garbage collect on function exit --- src/test/java/org/shedlang/compiler/patio/PatioCodeGenResumeTests.java | 3 ++- src/test/java/org/shedlang/compiler/patio/PatioCodeGenReturnTests.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/test/java') diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenResumeTests.java b/src/test/java/org/shedlang/compiler/patio/PatioCodeGenResumeTests.java index b0a97f31..6ac0e4f7 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenResumeTests.java +++ b/src/test/java/org/shedlang/compiler/patio/PatioCodeGenResumeTests.java @@ -19,7 +19,8 @@ public class PatioCodeGenResumeTests { var context = PatioCodeGenContext.EMPTY .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")) - .stashEffectHandler(new PatioLocalRef("effect_handler")); + .stashEffectHandler(new PatioLocalRef("effect_handler")) + .stashGcRootStackIndex(new PatioLocalRef("gc_root_stack_index")); var result = PatioCodeGen.generateInstruction(shid, context); diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenReturnTests.java b/src/test/java/org/shedlang/compiler/patio/PatioCodeGenReturnTests.java index 9a7166c5..f2bf807e 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenReturnTests.java +++ b/src/test/java/org/shedlang/compiler/patio/PatioCodeGenReturnTests.java @@ -18,7 +18,8 @@ public class PatioCodeGenReturnTests { var shid = Shid.return_(); var context = PatioCodeGenContext.EMPTY .temporaryPush(new PatioLocalRef("a")) - .temporaryPush(new PatioLocalRef("b")); + .temporaryPush(new PatioLocalRef("b")) + .stashGcRootStackIndex(new PatioLocalRef("gc_root_stack_index"));; var result = PatioCodeGen.generateInstruction(shid, context); -- cgit v1.2.3