Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Interpreter.cs
Go to the documentation of this file.
3
5
6internal sealed class Interpreter
7{
8 internal static readonly object NoValue = new object();
9
11
12 internal readonly object[] _objects;
13
14 internal readonly RuntimeLabel[] _labels;
15
16 internal readonly DebugInfo[] _debugInfos;
17
18 internal string Name { get; }
19
20 internal int LocalCount { get; }
21
22 internal int ClosureSize => ClosureVariables?.Count ?? 0;
23
25
27
29 {
30 Name = name;
31 LocalCount = locals.LocalCount;
32 ClosureVariables = locals.ClosureVariables;
34 _objects = instructions.Objects;
35 _labels = instructions.Labels;
37 }
38
39 [MethodImpl(MethodImplOptions.NoInlining)]
40 public void Run(InterpretedFrame frame)
41 {
43 for (int num = frame.InstructionIndex; num < instructions.Length; num = (frame.InstructionIndex = num + instructions[num].Run(frame)))
44 {
45 }
46 }
47}
Interpreter(string name, LocalVariables locals, InstructionArray instructions, DebugInfo[] debugInfos)
Dictionary< ParameterExpression, LocalVariable > ClosureVariables