Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EnterFinallyInstruction.cs
Go to the documentation of this file.
2
4{
5 private static readonly EnterFinallyInstruction[] s_cache = new EnterFinallyInstruction[32];
6
7 public override string InstructionName => "EnterFinally";
8
9 public override int ProducedStack => 2;
10
11 public override int ConsumedContinuations => 1;
12
13 private EnterFinallyInstruction(int labelIndex)
14 : base(labelIndex)
15 {
16 }
17
18 internal static EnterFinallyInstruction Create(int labelIndex)
19 {
20 if (labelIndex < 32)
21 {
22 return s_cache[labelIndex] ?? (s_cache[labelIndex] = new EnterFinallyInstruction(labelIndex));
23 }
24 return new EnterFinallyInstruction(labelIndex);
25 }
26
27 public override int Run(InterpretedFrame frame)
28 {
29 if (!frame.IsJumpHappened())
30 {
31 frame.SetStackDepth(GetLabel(frame).StackDepth);
32 }
34 frame.RemoveContinuation();
35 return 1;
36 }
37}
static EnterFinallyInstruction Create(int labelIndex)