Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ LoadArgument()

void System.Reflection.Metadata.Ecma335.InstructionEncoder.LoadArgument ( int argumentIndex)
inline

Definition at line 236 of file InstructionEncoder.cs.

237 {
238 switch (argumentIndex)
239 {
240 case 0:
241 OpCode(ILOpCode.Ldarg_0);
242 return;
243 case 1:
244 OpCode(ILOpCode.Ldarg_1);
245 return;
246 case 2:
247 OpCode(ILOpCode.Ldarg_2);
248 return;
249 case 3:
250 OpCode(ILOpCode.Ldarg_3);
251 return;
252 }
253 if ((uint)argumentIndex <= 255u)
254 {
255 OpCode(ILOpCode.Ldarg_s);
256 CodeBuilder.WriteByte((byte)argumentIndex);
257 }
258 else if (argumentIndex > 0)
259 {
260 OpCode(ILOpCode.Ldarg);
261 CodeBuilder.WriteInt32(argumentIndex);
262 }
263 else
264 {
265 Throw.ArgumentOutOfRange("argumentIndex");
266 }
267 }

References System.Reflection.Throw.ArgumentOutOfRange(), System.Reflection.Metadata.Ecma335.InstructionEncoder.CodeBuilder, System.Reflection.Metadata.Ecma335.InstructionEncoder.OpCode(), System.Reflection.Metadata.BlobBuilder.WriteByte(), and System.Reflection.Metadata.BlobBuilder.WriteInt32().