Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
NewArrayInstruction.cs
Go to the documentation of this file.
1
namespace
System.Linq.Expressions.Interpreter
;
2
3
internal
sealed
class
NewArrayInstruction
:
Instruction
4
{
5
private
readonly
Type
_elementType
;
6
7
public
override
int
ConsumedStack
=> 1;
8
9
public
override
int
ProducedStack
=> 1;
10
11
public
override
string
InstructionName
=>
"NewArray"
;
12
13
internal
NewArrayInstruction
(
Type
elementType
)
14
{
15
_elementType
=
elementType
;
16
}
17
18
public
override
int
Run
(
InterpretedFrame
frame)
19
{
20
int
num =
ConvertHelper
.
ToInt32NoNull
(frame.
Pop
());
21
frame.
Push
((num < 0) ?
new
int
[num] :
Array
.
CreateInstance
(
_elementType
, num));
22
return
1;
23
}
24
}
System.Array.CreateInstance
static unsafe Array CreateInstance(Type elementType, int length)
Definition
Array.cs:473
System.Array
Definition
Array.cs:16
System.Linq.Expressions.Interpreter.ConvertHelper.ToInt32NoNull
static int ToInt32NoNull(object val)
Definition
ConvertHelper.cs:5
System.Linq.Expressions.Interpreter.ConvertHelper
Definition
ConvertHelper.cs:4
System.Linq.Expressions.Interpreter.Instruction
Definition
Instruction.cs:6
System.Linq.Expressions.Interpreter.InterpretedFrame.Pop
object Pop()
Definition
InterpretedFrame.cs:90
System.Linq.Expressions.Interpreter.InterpretedFrame.Push
void Push(object value)
Definition
InterpretedFrame.cs:55
System.Linq.Expressions.Interpreter.InterpretedFrame
Definition
InterpretedFrame.cs:7
System.Linq.Expressions.Interpreter.NewArrayInstruction.InstructionName
override string InstructionName
Definition
NewArrayInstruction.cs:11
System.Linq.Expressions.Interpreter.NewArrayInstruction.ConsumedStack
override int ConsumedStack
Definition
NewArrayInstruction.cs:7
System.Linq.Expressions.Interpreter.NewArrayInstruction.NewArrayInstruction
NewArrayInstruction(Type elementType)
Definition
NewArrayInstruction.cs:13
System.Linq.Expressions.Interpreter.NewArrayInstruction.Run
override int Run(InterpretedFrame frame)
Definition
NewArrayInstruction.cs:18
System.Linq.Expressions.Interpreter.NewArrayInstruction.ProducedStack
override int ProducedStack
Definition
NewArrayInstruction.cs:9
System.Linq.Expressions.Interpreter.NewArrayInstruction._elementType
readonly Type _elementType
Definition
NewArrayInstruction.cs:5
System.Linq.Expressions.Interpreter.NewArrayInstruction
Definition
NewArrayInstruction.cs:4
System.Type
Definition
Type.cs:14
System.Linq.Expressions.Interpreter
Definition
ActionCallInstruction.cs:3
System.ExceptionArgument.elementType
@ elementType
source
System.Linq.Expressions
System.Linq.Expressions.Interpreter
NewArrayInstruction.cs
Generated by
1.10.0