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

◆ LoadLocal()

void System.Reflection.Metadata.Ecma335.InstructionEncoder.LoadLocal ( int slotIndex)
inline

Definition at line 152 of file InstructionEncoder.cs.

153 {
154 switch (slotIndex)
155 {
156 case 0:
157 OpCode(ILOpCode.Ldloc_0);
158 return;
159 case 1:
160 OpCode(ILOpCode.Ldloc_1);
161 return;
162 case 2:
163 OpCode(ILOpCode.Ldloc_2);
164 return;
165 case 3:
166 OpCode(ILOpCode.Ldloc_3);
167 return;
168 }
169 if ((uint)slotIndex <= 255u)
170 {
171 OpCode(ILOpCode.Ldloc_s);
172 CodeBuilder.WriteByte((byte)slotIndex);
173 }
174 else if (slotIndex > 0)
175 {
176 OpCode(ILOpCode.Ldloc);
177 CodeBuilder.WriteInt32(slotIndex);
178 }
179 else
180 {
181 Throw.ArgumentOutOfRange("slotIndex");
182 }
183 }

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().