Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
BranchInstruction.cs
Go to the documentation of this file.
1
namespace
System.Linq.Expressions.Interpreter
;
2
3
internal
sealed
class
BranchInstruction
:
OffsetInstruction
4
{
5
private
static
Instruction
[][][]
s_caches
;
6
7
internal
readonly
bool
_hasResult
;
8
9
internal
readonly
bool
_hasValue
;
10
11
public
override
Instruction
[] Cache
12
{
13
get
14
{
15
if
(
s_caches
==
null
)
16
{
17
s_caches
=
new
Instruction
[2][][]
18
{
19
new
Instruction
[2][],
20
new
Instruction
[2][]
21
};
22
}
23
return
s_caches
[
ConsumedStack
][
ProducedStack
] ?? (
s_caches
[
ConsumedStack
][
ProducedStack
] =
new
Instruction
[32]);
24
}
25
}
26
27
public
override
string
InstructionName
=>
"Branch"
;
28
29
public
override
int
ConsumedStack
30
{
31
get
32
{
33
if
(!
_hasValue
)
34
{
35
return
0;
36
}
37
return
1;
38
}
39
}
40
41
public
override
int
ProducedStack
42
{
43
get
44
{
45
if
(!
_hasResult
)
46
{
47
return
0;
48
}
49
return
1;
50
}
51
}
52
53
internal
BranchInstruction
()
54
: this(hasResult: false, hasValue: false)
55
{
56
}
57
58
public
BranchInstruction
(
bool
hasResult,
bool
hasValue)
59
{
60
_hasResult
= hasResult;
61
_hasValue
= hasValue;
62
}
63
64
public
override
int
Run
(
InterpretedFrame
frame)
65
{
66
return
_offset
;
67
}
68
}
System.Linq.Expressions.Interpreter.BranchInstruction.ProducedStack
override int ProducedStack
Definition
BranchInstruction.cs:42
System.Linq.Expressions.Interpreter.BranchInstruction.ConsumedStack
override int ConsumedStack
Definition
BranchInstruction.cs:30
System.Linq.Expressions.Interpreter.BranchInstruction.BranchInstruction
BranchInstruction()
Definition
BranchInstruction.cs:53
System.Linq.Expressions.Interpreter.BranchInstruction._hasResult
readonly bool _hasResult
Definition
BranchInstruction.cs:7
System.Linq.Expressions.Interpreter.BranchInstruction._hasValue
readonly bool _hasValue
Definition
BranchInstruction.cs:9
System.Linq.Expressions.Interpreter.BranchInstruction.BranchInstruction
BranchInstruction(bool hasResult, bool hasValue)
Definition
BranchInstruction.cs:58
System.Linq.Expressions.Interpreter.BranchInstruction.Run
override int Run(InterpretedFrame frame)
Definition
BranchInstruction.cs:64
System.Linq.Expressions.Interpreter.BranchInstruction.s_caches
static Instruction[][][] s_caches
Definition
BranchInstruction.cs:5
System.Linq.Expressions.Interpreter.BranchInstruction.InstructionName
override string InstructionName
Definition
BranchInstruction.cs:27
System.Linq.Expressions.Interpreter.BranchInstruction
Definition
BranchInstruction.cs:4
System.Linq.Expressions.Interpreter.Instruction
Definition
Instruction.cs:6
System.Linq.Expressions.Interpreter.InterpretedFrame
Definition
InterpretedFrame.cs:7
System.Linq.Expressions.Interpreter.OffsetInstruction._offset
int _offset
Definition
OffsetInstruction.cs:7
System.Linq.Expressions.Interpreter.OffsetInstruction
Definition
OffsetInstruction.cs:6
System.Linq.Expressions.Interpreter
Definition
ActionCallInstruction.cs:3
source
System.Linq.Expressions
System.Linq.Expressions.Interpreter
BranchInstruction.cs
Generated by
1.10.0