Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
LeaveExceptionHandlerInstruction.cs
Go to the documentation of this file.
1
namespace
System.Linq.Expressions.Interpreter
;
2
3
internal
sealed
class
LeaveExceptionHandlerInstruction
:
IndexedBranchInstruction
4
{
5
private
static
readonly
LeaveExceptionHandlerInstruction
[]
s_cache
=
new
LeaveExceptionHandlerInstruction
[64];
6
7
private
readonly
bool
_hasValue
;
8
9
public
override
string
InstructionName
=>
"LeaveExceptionHandler"
;
10
11
public
override
int
ConsumedStack
12
{
13
get
14
{
15
if
(!
_hasValue
)
16
{
17
return
0;
18
}
19
return
1;
20
}
21
}
22
23
public
override
int
ProducedStack
24
{
25
get
26
{
27
if
(!
_hasValue
)
28
{
29
return
0;
30
}
31
return
1;
32
}
33
}
34
35
private
LeaveExceptionHandlerInstruction
(
int
labelIndex,
bool
hasValue)
36
: base(labelIndex)
37
{
38
_hasValue
= hasValue;
39
}
40
41
internal
static
LeaveExceptionHandlerInstruction
Create
(
int
labelIndex,
bool
hasValue)
42
{
43
if
(labelIndex < 32)
44
{
45
int
num = (2 * labelIndex) | (hasValue ? 1 : 0);
46
return
s_cache
[num] ?? (
s_cache
[num] =
new
LeaveExceptionHandlerInstruction
(labelIndex, hasValue));
47
}
48
return
new
LeaveExceptionHandlerInstruction
(labelIndex, hasValue);
49
}
50
51
public
override
int
Run
(
InterpretedFrame
frame)
52
{
53
return
GetLabel
(frame).
Index
- frame.
InstructionIndex
;
54
}
55
}
System.Linq.Expressions.Interpreter.IndexedBranchInstruction.GetLabel
RuntimeLabel GetLabel(InterpretedFrame frame)
Definition
IndexedBranchInstruction.cs:14
System.Linq.Expressions.Interpreter.IndexedBranchInstruction
Definition
IndexedBranchInstruction.cs:6
System.Linq.Expressions.Interpreter.InterpretedFrame.InstructionIndex
int InstructionIndex
Definition
InterpretedFrame.cs:29
System.Linq.Expressions.Interpreter.InterpretedFrame
Definition
InterpretedFrame.cs:7
System.Linq.Expressions.Interpreter.LeaveExceptionHandlerInstruction.LeaveExceptionHandlerInstruction
LeaveExceptionHandlerInstruction(int labelIndex, bool hasValue)
Definition
LeaveExceptionHandlerInstruction.cs:35
System.Linq.Expressions.Interpreter.LeaveExceptionHandlerInstruction._hasValue
readonly bool _hasValue
Definition
LeaveExceptionHandlerInstruction.cs:7
System.Linq.Expressions.Interpreter.LeaveExceptionHandlerInstruction.Create
static LeaveExceptionHandlerInstruction Create(int labelIndex, bool hasValue)
Definition
LeaveExceptionHandlerInstruction.cs:41
System.Linq.Expressions.Interpreter.LeaveExceptionHandlerInstruction.ConsumedStack
override int ConsumedStack
Definition
LeaveExceptionHandlerInstruction.cs:12
System.Linq.Expressions.Interpreter.LeaveExceptionHandlerInstruction.ProducedStack
override int ProducedStack
Definition
LeaveExceptionHandlerInstruction.cs:24
System.Linq.Expressions.Interpreter.LeaveExceptionHandlerInstruction.Run
override int Run(InterpretedFrame frame)
Definition
LeaveExceptionHandlerInstruction.cs:51
System.Linq.Expressions.Interpreter.LeaveExceptionHandlerInstruction.s_cache
static readonly LeaveExceptionHandlerInstruction[] s_cache
Definition
LeaveExceptionHandlerInstruction.cs:5
System.Linq.Expressions.Interpreter.LeaveExceptionHandlerInstruction.InstructionName
override string InstructionName
Definition
LeaveExceptionHandlerInstruction.cs:9
System.Linq.Expressions.Interpreter.LeaveExceptionHandlerInstruction
Definition
LeaveExceptionHandlerInstruction.cs:4
System.Linq.Expressions.Interpreter
Definition
ActionCallInstruction.cs:3
System.Linq.Expressions.Interpreter.RuntimeLabel.Index
readonly int Index
Definition
RuntimeLabel.cs:8
source
System.Linq.Expressions
System.Linq.Expressions.Interpreter
LeaveExceptionHandlerInstruction.cs
Generated by
1.10.0