Refactor VM to ExecFrame + tag emitted lines with source script (no behavior change)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-07-07 13:11:50 -04:00
parent 39e5fa544e
commit e724f41b12
6 changed files with 70 additions and 37 deletions

View File

@@ -0,0 +1,15 @@
using Age.Engine.Model;
namespace Age.Engine.Vm;
/// <summary>One script activation: the running script, its instruction cursor, its local slots,
/// its intra-script call/ret stack, and its per-script loop-guard map. Globals live on the VM and
/// are shared across frames; everything here is per-call and discarded on return.</summary>
internal sealed class ExecFrame
{
public readonly Script Script;
public int Pc; // entry instruction index
public readonly Frame Locals = new();
public readonly List<int> CallStack = new(); // intra-script `call` (op 0x8f) returns
public readonly Dictionary<int, int> EmitSeen = new();
public ExecFrame(Script script, int pc) { Script = script; Pc = pc; }
}