diff --git a/src/vm/block.cs b/src/vm/block.cs index 59f2bbda..69c3d745 100644 --- a/src/vm/block.cs +++ b/src/vm/block.cs @@ -16,11 +16,6 @@ public enum BlockType DOWHILE = 10, } -public interface IDeferSupport -{ - void RegisterDefer(DeferBlock cb); -} - public struct DeferBlock { public VM.Frame frm; @@ -82,7 +77,7 @@ public override string ToString() } } -public class SeqBlock : Coroutine, IDeferSupport, IInspectableCoroutine +public class SeqBlock : Coroutine, IInspectableCoroutine { public VM.ExecState exec = new VM.ExecState(); public List defers = new List(2); @@ -136,14 +131,9 @@ public static void ExitScope(VM.Frame frm, VM.ExecState exec, List d DeferBlock.ExitScope(defers, exec); } - - public void RegisterDefer(DeferBlock dfb) - { - defers.Add(dfb); - } } -public class ParalBranchBlock : Coroutine, IDeferSupport, IInspectableCoroutine +public class ParalBranchBlock : Coroutine, IInspectableCoroutine { public int min_ip; public int max_ip; @@ -199,14 +189,9 @@ public override void Cleanup(VM.Frame frm, VM.ExecState _) } stack.Clear(); } - - public void RegisterDefer(DeferBlock dfb) - { - defers.Add(dfb); - } } -public class ParalBlock : Coroutine, IBranchyCoroutine, IDeferSupport, IInspectableCoroutine +public class ParalBlock : Coroutine, IBranchyCoroutine, IInspectableCoroutine { public int min_ip; public int max_ip; @@ -270,14 +255,9 @@ public void Attach(ICoroutine coro) { branches.Add((Coroutine)coro); } - - public void RegisterDefer(DeferBlock dfb) - { - defers.Add(dfb); - } } -public class ParalAllBlock : Coroutine, IBranchyCoroutine, IDeferSupport, IInspectableCoroutine +public class ParalAllBlock : Coroutine, IBranchyCoroutine, IInspectableCoroutine { public int min_ip; public int max_ip; diff --git a/src/vm/vm.frame.cs b/src/vm/vm.frame.cs index fc984648..3c42945c 100644 --- a/src/vm/vm.frame.cs +++ b/src/vm/vm.frame.cs @@ -6,7 +6,7 @@ namespace bhl { public partial class VM : INamedResolver { - public class Frame : IDeferSupport + public class Frame { public const int MAX_LOCALS = 64; public const int MAX_STACK = 32; @@ -132,11 +132,6 @@ internal void Clear() defers.Clear(); } - public void RegisterDefer(DeferBlock dfb) - { - defers.Add(dfb); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public void ExitScope(VM.Frame _, ExecState exec) {