Пример #1
0
        /// <summary>
        /// See base class documentation.
        /// </summary>
        /// <param name="theOp">See base class documentation.</param>
        /// <param name="conversionState">See base class documentation.</param>
        /// <returns>See base class documentation.</returns>
        public override void Convert(ILConversionState conversionState, ILOp theOp)
        {   
            StackItem theItem = conversionState.CurrentStackFrame.Stack.Pop();

            if (theItem.isNewGCObject)
            {
                //Decrement ref count

                //Get the ID of method to call as it will be labeled in the output ASM.
                Types.MethodInfo anInfo = conversionState.GetDecrementRefCountMethodInfo();
                string methodID = anInfo.ID;
                conversionState.AddExternalLabel(anInfo.ID);
                //Append the actual call
                conversionState.Append(new ASMOps.Call() { Target = methodID });
            }

            conversionState.Append(new ASMOps.Add() { Src1 = "$sp", Src2 = theItem.sizeOnStackInBytes.ToString(), Dest = "$sp" });
        }