Jurassic.Compiler.DynamicILGenerator.LoadAddressOfVariable C# (CSharp) Method

LoadAddressOfVariable() public method

Pushes the address of the given variable onto the stack.
public LoadAddressOfVariable ( ILLocalVariable variable ) : void
variable ILLocalVariable The variable whose address will be pushed.
return void
        public override void LoadAddressOfVariable(ILLocalVariable variable)
        {
            if (variable as DynamicILLocalVariable == null)
                throw new ArgumentNullException("variable");
            if (((DynamicILLocalVariable)variable).ILGenerator != this)
                throw new ArgumentException("The variable wasn't created by this generator.", "variable");

            if (variable.Index < 256)
            {
                // ldloca.s index = 12 <unsigned int8>
                Emit1ByteOpCodeInt8(0x12, 0, 1, variable.Index);
            }
            else if (variable.Index < 65535)
            {
                // ldloca index = FE 0D <unsigned int16>
                Emit2ByteOpCodeInt16(0xFE, 0x0D, 0, 1, variable.Index);
            }
            else
                throw new InvalidOperationException("Too many local variables.");

            PushStackOperand(VESType.ManagedPointer);
        }
DynamicILGenerator