29 if (builder.
Count % 4 != 0)
38 return AddMethodBody(codeSize, maxStack, exceptionRegionCount, hasSmallExceptionRegions, localVariablesSignature, attributes, hasDynamicStackAllocation:
false);
47 if ((uint)maxStack > 65535u)
55 int bodyOffset =
SerializeHeader(codeSize, (ushort)maxStack, exceptionRegionCount, attributes, localVariablesSignature, hasDynamicStackAllocation);
58 return new MethodBody(bodyOffset, instructions, exceptionRegions);
63 return AddMethodBody(instructionEncoder, maxStack, localVariablesSignature, attributes, hasDynamicStackAllocation:
false);
68 if ((uint)maxStack > 65535u)
74 if (codeBuilder ==
null)
83 int result =
SerializeHeader(codeBuilder.
Count, (ushort)maxStack, exceptionRegionCount, attributes, localVariablesSignature, hasDynamicStackAllocation);
84 if (controlFlowBuilder !=
null && controlFlowBuilder.
BranchCount > 0)
100 if (codeSize < 64 && maxStack <= 8 && localVariablesSignature.
IsNil && (!hasDynamicStackAllocation || !flag) && exceptionRegionCount == 0)
110 if (exceptionRegionCount > 0)
112 num = (ushort)(num | 8u);
116 num = (ushort)(num | 0x10u);
static void ArgumentNull(string parameterName)
static void ArgumentOutOfRange(string parameterName)
static void BuilderArgumentNull()
static string TooManyExceptionRegions
static string BuilderMustAligned
ExceptionRegionEncoder ExceptionRegions
MethodBody(int bodyOffset, Blob instructions, ExceptionRegionEncoder exceptionRegions)
MethodBody AddMethodBody(int codeSize, int maxStack=8, int exceptionRegionCount=0, bool hasSmallExceptionRegions=true, StandaloneSignatureHandle localVariablesSignature=default(StandaloneSignatureHandle), MethodBodyAttributes attributes=MethodBodyAttributes.InitLocals, bool hasDynamicStackAllocation=false)
MethodBodyStreamEncoder(BlobBuilder builder)
int AddMethodBody(InstructionEncoder instructionEncoder, int maxStack, StandaloneSignatureHandle localVariablesSignature, MethodBodyAttributes attributes)
int SerializeHeader(int codeSize, ushort maxStack, int exceptionRegionCount, MethodBodyAttributes attributes, StandaloneSignatureHandle localVariablesSignature, bool hasDynamicStackAllocation)
int AddMethodBody(InstructionEncoder instructionEncoder, int maxStack=8, StandaloneSignatureHandle localVariablesSignature=default(StandaloneSignatureHandle), MethodBodyAttributes attributes=MethodBodyAttributes.InitLocals, bool hasDynamicStackAllocation=false)
MethodBody AddMethodBody(int codeSize, int maxStack, int exceptionRegionCount, bool hasSmallExceptionRegions, StandaloneSignatureHandle localVariablesSignature, MethodBodyAttributes attributes)