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:
15
engine/Age.Engine/Vm/ExecFrame.cs
Normal file
15
engine/Age.Engine/Vm/ExecFrame.cs
Normal 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; }
|
||||
}
|
||||
Reference in New Issue
Block a user