public override void EmitGet(InstructionWriter writer, IStackFragment sigBlock, int sigIndex, bool keepSig) { Debug.Assert(_isVararg); if (sigIndex > 255 || sigBlock.Offset > 255) { throw new NotImplementedException(); } writer.WriteUUU(keepSig ? Opcodes.VARG : Opcodes.VARGC, sigIndex, sigBlock.Offset, 0); }
public override void EmitGet(InstructionWriter writer, IStackFragment sigBlock, StackSignature sigType, int sigIndex, bool keepSig) { Debug.Assert(_isVararg); if (sigIndex > 255 || sigBlock.Offset > 255 | sigType.FixedSize > 127) { throw new NotImplementedException(); } //Note that for VARG/VARGC, we are using a different version of R1-R3. See OpCodes doc for details. Debug.Assert(_funcVarargSig.FixedSize == 0); if (_funcVarargSig.IsCompatibleWith(sigType)) { writer.WriteUUS(keepSig ? OpCodes.VARG : OpCodes.VARGC, sigBlock.Offset, sigIndex, sigType.FixedSize); } else { writer.WriteUUS(keepSig ? OpCodes.VARG : OpCodes.VARGC, sigBlock.Offset, sigIndex, -1); } }
//For vararg expr: calculate the value and write to stack at sigblock's location, with the given sig index. //The sigIndex is the index into proto's signature list. This should be the out signature of function calls. //sigType is the instance at sig index. It is needed by the new sig adjustment method. //EmitPrep will be called before this. public virtual void EmitGet(InstructionWriter writer, IStackFragment sigBlock, StackSignature sigType, int sigIndex, bool keepSig) { throw new NotSupportedException(); }