public override object ConvertParameter(CompilerMethodContext context, ILOperation operation) { List <string> refList = new List <string>(); bool isInstance = !context.Method.IsStatic; for (int i = 0; i < context.Method.GetParameters().Length; i++) { if (context.Method.GetParameters()[i].ParameterType.IsReferenceCounted()) { refList.Add(context.GetParameterReferencePosition(i + (isInstance ? 1 : 0)).ToString()); } } var body = context.Method.GetMethodBody(); var variables = body.LocalVariables; for (int i = 0; i < variables.Count; i++) { if (variables[i].LocalType.IsReferenceCounted()) { refList.Add(context.GetLocalVariableReferencePosition(i).ToString()); } } return($"{context.GetLocalStackSize()}, [{string.Join(',', refList)}]"); }
public override object ConvertParameter(CompilerMethodContext context, ILOperation operation) { var body = context.Method.GetMethodBody(); var variables = body.LocalVariables; var index = context.GetLocalVariableReferencePosition((int)operation.RawParameter); var isRef = variables[(int)operation.RawParameter].LocalType.IsReferenceCounted() ? "1" : "0"; return($"{index}, {isRef}"); }
public override object ConvertParameter(CompilerMethodContext context, ILOperation operation) { var refPos = context.GetLocalVariableReferencePosition(_varIndex); return($"{refPos}, {_value}"); }
public override object ConvertParameter(CompilerMethodContext context, ILOperation operation) { int relPos = context.GetLocalVariableReferencePosition((int)operation.RawParameter); return($"{relPos}"); }