1 write to _builder
Microsoft.CodeAnalysis.CSharp (1)
CodeGen\CodeGenerator.cs (1)
101
_builder
= builder;
517 references to _builder
Microsoft.CodeAnalysis.CSharp (517)
CodeGen\CodeGenerator.cs (24)
179
result =
_builder
.LocalSlotManager.DeclareLocal(
227
asyncCatchHandlerOffset = _diagnostics.HasAnyErrors() ? -1 :
_builder
.GetILOffsetFromMarker(_asyncCatchHandlerOffset);
246
int yieldOffset =
_builder
.GetILOffsetFromMarker(yieldPoints[i]);
247
int resumeOffset =
_builder
.GetILOffsetFromMarker(resumePoints[i]);
275
_builder
.DefineInitialHiddenSequencePoint();
292
_builder
.Realize();
309
_builder
.MarkLabel(s_returnLabel);
328
_builder
.EmitLocalLoad(LazyReturnTemp);
329
_builder
.EmitRet(false);
333
_builder
.EmitRet(true);
341
_builder
.EmitToken(symbol, syntaxNode, _diagnostics.DiagnosticBag);
352
_builder
.EmitToken(methodRef, syntaxNode, _diagnostics.DiagnosticBag, encodeAsRawDefinitionToken ? Cci.MetadataWriter.RawTokenEncoding.RowId : 0);
358
_builder
.EmitToken(fieldRef, syntaxNode, _diagnostics.DiagnosticBag);
363
_builder
.EmitToken(_module.Translate(symbol).Signature, syntaxNode, _diagnostics.DiagnosticBag);
392
_builder
.EmitOpCode(ILOpCode.Nop);
415
_builder
.EmitOpCode(ILOpCode.Nop);
424
ArrayBuilder<RawSequencePoint> sequencePoints =
_builder
.SeqPointsOpt;
463
_builder
.EmitConstantValue(ConstantValue.Create(true));
464
_builder
.EmitBranch(ILOpCode.Brtrue, label);
466
_builder
.EmitOpCode(ILOpCode.Nop);
467
_builder
.MarkLabel(label);
481
_builder
.SetInitialDebugDocument(_methodBodySyntaxOpt.SyntaxTree);
488
_builder
.DefineHiddenSequencePoint();
501
_builder
.DefineSequencePoint(syntaxTree, span);
CodeGen\EmitAddress.cs (27)
76
_builder
.EmitLoadArgumentOpcode(0);
80
_builder
.EmitLoadArgumentAddrOpcode(0);
137
_builder
.EmitLocalAddress(temp); // ldloca temp
138
_builder
.EmitOpCode(ILOpCode.Dup); // dup
139
_builder
.EmitOpCode(ILOpCode.Initobj); // initobj <type>
223
_builder
.EmitBranch(ILOpCode.Br, doneLabel);
226
_builder
.AdjustStack(-1);
228
_builder
.MarkLabel(consequenceLabel);
231
_builder
.MarkLabel(doneLabel);
246
_builder
.EmitBranch(ILOpCode.Brtrue, whenValueTypeLabel);
250
_builder
.EmitBranch(ILOpCode.Br, doneLabel);
251
_builder
.AdjustStack(-1);
253
_builder
.MarkLabel(whenValueTypeLabel);
257
_builder
.MarkLabel(doneLabel);
287
_builder
.EmitLocalAddress(GetLocal(localAccess));
303
_builder
.EmitOpCode(ILOpCode.Dup);
317
_builder
.EmitOpCode(ILOpCode.Refanyval);
332
_builder
.EmitLocalStore(value);
333
_builder
.EmitLocalAddress(value);
400
_builder
.EmitOpCode(ILOpCode.Readonly);
405
_builder
.EmitOpCode(ILOpCode.Ldelema);
411
_builder
.EmitArrayElementAddress(_module.Translate((ArrayTypeSymbol)arrayAccess.Expression.Type),
458
_builder
.EmitOpCode(ILOpCode.Ldsflda);
482
_builder
.EmitLoadArgumentAddrOpcode(slot);
486
_builder
.EmitLoadArgumentOpcode(slot);
558
_builder
.EmitOpCode(field.RefKind == RefKind.None ? ILOpCode.Ldflda : ILOpCode.Ldfld);
581
_builder
.EmitOpCode(ILOpCode.Ldflda);
CodeGen\EmitArrayInitializer.cs (43)
58
_builder
.EmitArrayBlockInitializer(data, inits.Syntax, _diagnostics.DiagnosticBag);
90
_builder
.EmitOpCode(ILOpCode.Dup);
91
_builder
.EmitIntConstant(i);
193
_builder
.EmitOpCode(ILOpCode.Dup);
200
_builder
.EmitIntConstant(row.Index);
204
_builder
.EmitIntConstant(i);
557
var field =
_builder
.module.GetFieldForData(data, alignment: 1, wrappedExpression.Syntax, _diagnostics.DiagnosticBag);
558
_builder
.EmitOpCode(ILOpCode.Ldsflda);
559
_builder
.EmitToken(field, wrappedExpression.Syntax, _diagnostics.DiagnosticBag);
561
_builder
.EmitIntConstant(lengthForConstructor);
566
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment: -3);
572
_builder
.EmitOpCode(ILOpCode.Newobj, stackAdjustment: -1);
618
var field =
_builder
.module.GetFieldForData(data, alignment: (ushort)specialElementType.SizeInBytes(), wrappedExpression.Syntax, _diagnostics.DiagnosticBag);
619
_builder
.EmitOpCode(ILOpCode.Ldtoken);
620
_builder
.EmitToken(field, wrappedExpression.Syntax, _diagnostics.DiagnosticBag);
621
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment: 0);
651
var cachingField =
_builder
.module.GetArrayCachingFieldForData(data, _module.Translate(arrayType), wrappedExpression.Syntax, _diagnostics.DiagnosticBag);
656
_builder
.EmitOpCode(ILOpCode.Ldsfld);
657
_builder
.EmitToken(cachingField, wrappedExpression.Syntax, _diagnostics.DiagnosticBag);
658
_builder
.EmitOpCode(ILOpCode.Dup);
659
_builder
.EmitBranch(ILOpCode.Brtrue, arrayNotNullLabel);
664
_builder
.EmitOpCode(ILOpCode.Pop);
665
_builder
.EmitIntConstant(elementCount);
666
_builder
.EmitOpCode(ILOpCode.Newarr);
668
_builder
.EmitArrayBlockInitializer(data, wrappedExpression.Syntax, _diagnostics.DiagnosticBag);
669
_builder
.EmitOpCode(ILOpCode.Dup);
670
_builder
.EmitOpCode(ILOpCode.Stsfld);
671
_builder
.EmitToken(cachingField, wrappedExpression.Syntax, _diagnostics.DiagnosticBag);
675
_builder
.MarkLabel(arrayNotNullLabel);
676
_builder
.EmitOpCode(ILOpCode.Newobj, 0);
709
Cci.IFieldReference cachingField =
_builder
.module.GetArrayCachingFieldForConstants(constants, _module.Translate(arrayType),
716
_builder
.EmitOpCode(ILOpCode.Ldsfld);
717
_builder
.EmitToken(cachingField, arrayCreation.Syntax, _diagnostics.DiagnosticBag);
718
_builder
.EmitOpCode(ILOpCode.Dup);
719
_builder
.EmitBranch(ILOpCode.Brtrue, arrayNotNullLabel);
723
_builder
.EmitOpCode(ILOpCode.Pop);
725
_builder
.EmitOpCode(ILOpCode.Dup);
726
_builder
.EmitOpCode(ILOpCode.Stsfld);
727
_builder
.EmitToken(cachingField, arrayCreation.Syntax, _diagnostics.DiagnosticBag);
731
_builder
.MarkLabel(arrayNotNullLabel);
736
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment: -2);
742
_builder
.EmitOpCode(ILOpCode.Newobj, stackAdjustment: 0);
762
_builder
.EmitOpCode(ILOpCode.Initobj);
CodeGen\EmitConversion.cs (16)
48
_builder
.EmitIntConstant(0);
49
_builder
.EmitOpCode(ILOpCode.Conv_u);
85
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment: 0);
165
_builder
.EmitNumericConversion(fromPredefTypeKind, toPredefTypeKind, conversion.Checked);
171
_builder
.EmitOpCode(ILOpCode.Conv_u);
222
_builder
.EmitNumericConversion(fromPredefTypeKind, toPredefTypeKind, conversion.Checked);
242
_builder
.EmitOpCode(ILOpCode.Unbox_any);
274
_builder
.EmitOpCode(ILOpCode.Castclass);
279
_builder
.EmitOpCode(ILOpCode.Unbox_any);
308
_builder
.EmitNumericConversion(fromPredefTypeKind, toPredefTypeKind, conversion.Checked);
327
_builder
.EmitNullConstant();
336
_builder
.EmitOpCode(ILOpCode.Constrained);
357
_builder
.EmitOpCode(ILOpCode.Dup);
358
_builder
.EmitOpCode(ILOpCode.Ldvirtftn);
365
_builder
.EmitOpCode(ILOpCode.Ldftn);
371
_builder
.EmitOpCode(ILOpCode.Newobj, -1); // pop 2 args and push delegate object
CodeGen\EmitExpression.cs (190)
180
_builder
.EmitOpCode(ILOpCode.Ldarg_0);
389
_builder
.EmitBranch(ILOpCode.Brtrue, whenValueTypeLabel);
392
_builder
.EmitBranch(ILOpCode.Br, doneLabel);
396
_builder
.AdjustStack(-1);
399
_builder
.MarkLabel(whenValueTypeLabel);
402
_builder
.MarkLabel(doneLabel);
473
_builder
.EmitBranch(ILOpCode.Brtrue, whenNotNullLabel);
477
_builder
.EmitLocalStore(cloneTemp);
478
_builder
.EmitLocalAddress(cloneTemp);
479
_builder
.EmitLocalLoad(cloneTemp);
490
_builder
.EmitOpCode(ILOpCode.Dup);
502
_builder
.EmitOpCode(ILOpCode.Dup);
523
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment: 0);
527
_builder
.EmitBranch(ILOpCode.Brtrue, whenNotNullLabel);
539
_builder
.EmitOpCode(ILOpCode.Pop);
552
_builder
.EmitBranch(ILOpCode.Br, doneLabel);
560
_builder
.AdjustStack(+1);
568
_builder
.AdjustStack(-1);
571
_builder
.MarkLabel(whenNotNullLabel);
584
_builder
.MarkLabel(doneLabel);
679
_builder
.EmitOpCode(ILOpCode.Mkrefany);
691
_builder
.EmitOpCode(ILOpCode.Refanytype);
692
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment: 0);
701
_builder
.EmitOpCode(ILOpCode.Arglist);
760
_builder
.EmitOpCode(ILOpCode.Conv_u);
784
_builder
.EmitOpCode(ILOpCode.Dup);
789
_builder
.EmitOpCode(ILOpCode.Dup);
811
_builder
.EmitOpCode(ILOpCode.Ldarg_0);
876
_builder
.OpenLocalScope();
891
_builder
.CloseLocalScope();
910
_builder
.OpenLocalScope();
931
_builder
.CloseLocalScope();
1026
_builder
.EmitOpCode(ILOpCode.Ldelem_i1);
1031
_builder
.EmitOpCode(ILOpCode.Ldelem_u1);
1035
_builder
.EmitOpCode(ILOpCode.Ldelem_i2);
1040
_builder
.EmitOpCode(ILOpCode.Ldelem_u2);
1044
_builder
.EmitOpCode(ILOpCode.Ldelem_i4);
1048
_builder
.EmitOpCode(ILOpCode.Ldelem_u4);
1053
_builder
.EmitOpCode(ILOpCode.Ldelem_i8);
1060
_builder
.EmitOpCode(ILOpCode.Ldelem_i);
1064
_builder
.EmitOpCode(ILOpCode.Ldelem_r4);
1068
_builder
.EmitOpCode(ILOpCode.Ldelem_r8);
1074
_builder
.EmitOpCode(ILOpCode.Ldelem_ref);
1080
_builder
.EmitOpCode(ILOpCode.Ldelem);
1088
_builder
.EmitOpCode(ILOpCode.Readonly);
1091
_builder
.EmitOpCode(ILOpCode.Ldelema);
1101
_builder
.EmitArrayElementLoad(_module.Translate((ArrayTypeSymbol)arrayAccess.Expression.Type), arrayAccess.Expression.Syntax, _diagnostics.DiagnosticBag);
1115
_builder
.EmitOpCode(ILOpCode.Pop);
1162
_builder
.EmitOpCode(ILOpCode.Volatile);
1164
_builder
.EmitOpCode(ILOpCode.Ldsfld);
1188
_builder
.EmitOpCode(ILOpCode.Volatile);
1191
_builder
.EmitOpCode(ILOpCode.Ldfld);
1237
_builder
.EmitOpCode(ILOpCode.Unbox);
1251
_builder
.EmitOpCode(ILOpCode.Ldflda);
1403
_builder
.EmitLocalLoad(definition);
1422
_builder
.EmitLoadArgumentOpcode(slot);
1442
_builder
.EmitOpCode(ILOpCode.Ldind_i1);
1447
_builder
.EmitOpCode(ILOpCode.Ldind_u1);
1451
_builder
.EmitOpCode(ILOpCode.Ldind_i2);
1456
_builder
.EmitOpCode(ILOpCode.Ldind_u2);
1460
_builder
.EmitOpCode(ILOpCode.Ldind_i4);
1464
_builder
.EmitOpCode(ILOpCode.Ldind_u4);
1469
_builder
.EmitOpCode(ILOpCode.Ldind_i8);
1476
_builder
.EmitOpCode(ILOpCode.Ldind_i);
1480
_builder
.EmitOpCode(ILOpCode.Ldind_r4);
1484
_builder
.EmitOpCode(ILOpCode.Ldind_r8);
1490
_builder
.EmitOpCode(ILOpCode.Ldind_ref);
1494
_builder
.EmitOpCode(ILOpCode.Ldobj);
1649
_builder
.EmitOpCode(ILOpCode.Initobj); // initobj <MyStruct>
1673
_builder
.EmitOpCode(ILOpCode.Constrained);
1677
_builder
.EmitOpCode(ILOpCode.Call, stackBehavior);
1793
_builder
.EmitLocalStore(tempOpt);
1794
_builder
.EmitLocalAddress(tempOpt);
1999
_builder
.EmitOpCode(ILOpCode.Call, stackBehavior);
2003
_builder
.EmitOpCode(ILOpCode.Callvirt, stackBehavior);
2007
_builder
.EmitOpCode(ILOpCode.Constrained);
2009
_builder
.EmitOpCode(ILOpCode.Callvirt, stackBehavior);
2054
_builder
.EmitBranch(ILOpCode.Brtrue, whenNotNullLabel);
2061
_builder
.EmitLocalStore(tempOpt);
2062
_builder
.EmitLocalAddress(tempOpt);
2066
_builder
.MarkLabel(whenNotNullLabel);
2330
_builder
.EmitOpCode(ILOpCode.Conv_ovf_i);
2334
_builder
.EmitOpCode(ILOpCode.Conv_ovf_i_un);
2353
_builder
.EmitOpCode(ILOpCode.Ldlen);
2367
_builder
.EmitNumericConversion(typeFrom, typeTo, @checked: false);
2380
_builder
.EmitOpCode(ILOpCode.Newarr);
2385
_builder
.EmitArrayCreation(_module.Translate(arrayType), expression.Syntax, _diagnostics.DiagnosticBag);
2452
_builder
.EmitOpCode(ILOpCode.Newobj, stackAdjustment);
2677
_builder
.EmitOpCode(ILOpCode.Initobj); // initobj <MyStruct>
2710
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment);
2733
if (local != null && !
_builder
.PossiblyDefinedOutsideOfTry(GetLocal(local)))
2803
_builder
.EmitLoadArgumentOpcode(ParameterSlot(left));
2837
_builder
.EmitLocalLoad(localDefinition);
3027
_builder
.EmitOpCode(ILOpCode.Dup);
3053
_builder
.EmitLocalStore(temp);
3090
_builder
.EmitLocalStore(GetLocal(local));
3172
_builder
.EmitLocalAddress(temp);
3176
_builder
.EmitLocalLoad(temp);
3191
_builder
.EmitOpCode(ILOpCode.Stobj);
3203
_builder
.EmitArrayElementStore(_module.Translate(arrayType), syntaxNode, _diagnostics.DiagnosticBag);
3225
_builder
.EmitOpCode(ILOpCode.Stelem_i1);
3231
_builder
.EmitOpCode(ILOpCode.Stelem_i2);
3236
_builder
.EmitOpCode(ILOpCode.Stelem_i4);
3241
_builder
.EmitOpCode(ILOpCode.Stelem_i8);
3248
_builder
.EmitOpCode(ILOpCode.Stelem_i);
3252
_builder
.EmitOpCode(ILOpCode.Stelem_r4);
3256
_builder
.EmitOpCode(ILOpCode.Stelem_r8);
3262
_builder
.EmitOpCode(ILOpCode.Stelem_ref);
3266
_builder
.EmitOpCode(ILOpCode.Stelem);
3279
_builder
.EmitOpCode(ILOpCode.Volatile);
3290
_builder
.EmitOpCode(field.IsStatic ? ILOpCode.Stsfld : ILOpCode.Stfld);
3306
_builder
.EmitStoreArgumentOpcode(slot);
3323
_builder
.EmitOpCode(ILOpCode.Stind_i1);
3329
_builder
.EmitOpCode(ILOpCode.Stind_i2);
3334
_builder
.EmitOpCode(ILOpCode.Stind_i4);
3339
_builder
.EmitOpCode(ILOpCode.Stind_i8);
3346
_builder
.EmitOpCode(ILOpCode.Stind_i);
3350
_builder
.EmitOpCode(ILOpCode.Stind_r4);
3354
_builder
.EmitOpCode(ILOpCode.Stind_r8);
3360
_builder
.EmitOpCode(ILOpCode.Stind_ref);
3364
_builder
.EmitOpCode(ILOpCode.Stobj);
3375
_builder
.EmitOpCode(ILOpCode.Pop);
3391
_builder
.EmitOpCode(ILOpCode.Isinst);
3396
_builder
.EmitOpCode(ILOpCode.Ldnull);
3397
_builder
.EmitOpCode(ILOpCode.Cgt_un);
3420
_builder
.EmitOpCode(ILOpCode.Isinst);
3425
_builder
.EmitOpCode(ILOpCode.Unbox_any);
3441
_builder
.EmitConstantValue(constantValue);
3449
_builder
.EmitOpCode(ILOpCode.Ldc_i4_0);
3450
_builder
.EmitOpCode(ILOpCode.Conv_u);
3454
_builder
.EmitOpCode(ILOpCode.Ldc_i4_0);
3455
_builder
.EmitOpCode(ILOpCode.Conv_i);
3486
_builder
.EmitConstantValue(constantValue);
3496
_builder
.EmitLocalAddress(temp); // ldloca temp
3497
_builder
.EmitOpCode(ILOpCode.Initobj); // initobj <MyStruct>
3499
_builder
.EmitLocalLoad(temp); // ldloc temp
3506
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment: 0); //argument off, return value on
3515
_builder
.EmitOpCode(ILOpCode.Ldtoken);
3523
_builder
.EmitOpCode(ILOpCode.Sizeof);
3531
_builder
.EmitOpCode(ILOpCode.Ldtoken);
3551
_builder
.EmitIntConstant(GetLocal(node.Local).SlotIndex);
3565
_builder
.EmitIntConstant(node.Parameter.Ordinal);
3578
_builder
.EmitOpCode(ILOpCode.Ldtoken);
3579
_builder
.EmitToken(fieldRef, syntax, _diagnostics.DiagnosticBag, Cci.MetadataWriter.RawTokenEncoding.LiftedVariableId);
3585
_builder
.EmitOpCode(ILOpCode.Ldtoken);
3586
_builder
.EmitGreatestMethodToken();
3591
_builder
.EmitOpCode(ILOpCode.Ldsfld);
3597
_builder
.EmitOpCode(ILOpCode.Stsfld);
3603
_builder
.EmitToken(
3613
_builder
.EmitOpCode(ILOpCode.Ldsflda);
3614
_builder
.EmitToken(
3624
_builder
.EmitOpCode(ILOpCode.Call, -1);
3625
_builder
.EmitToken(
3635
_builder
.EmitOpCode(ILOpCode.Ldsfld);
3636
_builder
.EmitToken(
3644
_builder
.EmitOpCode(ILOpCode.Ldstr);
3645
_builder
.EmitModuleVersionIdStringToken();
3650
_builder
.EmitOpCode(ILOpCode.Ldsfld);
3656
_builder
.EmitOpCode(ILOpCode.Stsfld);
3662
_builder
.EmitToken(_module.GetInstrumentationPayloadRoot(node.AnalysisKind, _module.Translate(node.Type, node.Syntax, _diagnostics.DiagnosticBag), node.Syntax, _diagnostics.DiagnosticBag), node.Syntax, _diagnostics.DiagnosticBag);
3668
_builder
.EmitOpCode(ILOpCode.Ldtoken);
3669
_builder
.EmitSourceDocumentIndexToken(node.Document);
3674
_builder
.EmitOpCode(ILOpCode.Ldtoken);
3682
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment: 0); //argument off, return value on
3687
_builder
.EmitOpCode(ILOpCode.Ldtoken);
3689
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment: -1); //2 arguments off, return value on
3695
_builder
.EmitOpCode(ILOpCode.Castclass);
3702
_builder
.EmitOpCode(ILOpCode.Ldtoken);
3709
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment: 0); //argument off, return value on
3714
_builder
.EmitOpCode(ILOpCode.Ldtoken);
3716
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment: -1); //2 arguments off, return value on
3722
_builder
.EmitOpCode(ILOpCode.Castclass);
3755
_builder
.EmitNumericConversion(Cci.PrimitiveTypeCode.Int32, toType, @checked: false);
3799
_builder
.EmitBranch(ILOpCode.Br, doneLabel);
3803
_builder
.AdjustStack(-1);
3806
_builder
.MarkLabel(consequenceLabel);
3823
_builder
.MarkLabel(doneLabel);
3859
_builder
.EmitOpCode(ILOpCode.Dup);
3868
_builder
.EmitBranch(ILOpCode.Brtrue, ifLeftNotNullLabel);
3872
_builder
.EmitOpCode(ILOpCode.Pop);
3886
_builder
.MarkLabel(ifLeftNotNullLabel);
4001
_builder
.EmitLocalStore(temp);
4002
_builder
.EmitLocalLoad(temp);
4010
_builder
.EmitOpCode(ILOpCode.Box);
4026
_builder
.EmitLocalStore(temp);
4035
_builder
.EmitLocalLoad(temp);
4039
_builder
.EmitOpCode(ILOpCode.Calli, stackBehavior);
4085
_builder
.EmitOpCode(ILOpCode.Nop);
4111
_builder
.EmitOpCode(ILOpCode.Constrained);
4115
_builder
.EmitOpCode(ILOpCode.Ldftn);
CodeGen\EmitOperators.cs (55)
43
_builder
.EmitOpCode(ILOpCode.Neg);
47
_builder
.EmitOpCode(ILOpCode.Not);
180
_builder
.EmitOpCode(ILOpCode.Mul);
184
_builder
.EmitOpCode(ILOpCode.Add);
188
_builder
.EmitOpCode(ILOpCode.Sub);
194
_builder
.EmitOpCode(ILOpCode.Div_un);
198
_builder
.EmitOpCode(ILOpCode.Div);
205
_builder
.EmitOpCode(ILOpCode.Rem_un);
209
_builder
.EmitOpCode(ILOpCode.Rem);
214
_builder
.EmitOpCode(ILOpCode.Shl);
220
_builder
.EmitOpCode(ILOpCode.Shr_un);
224
_builder
.EmitOpCode(ILOpCode.Shr);
229
_builder
.EmitOpCode(ILOpCode.Shr_un);
233
_builder
.EmitOpCode(ILOpCode.And);
237
_builder
.EmitOpCode(ILOpCode.Xor);
241
_builder
.EmitOpCode(ILOpCode.Or);
277
_builder
.EmitBranch(ILOpCode.Br, labEnd);
280
_builder
.AdjustStack(-1);
282
_builder
.MarkLabel(lazyFallThrough);
283
_builder
.EmitBoolConstant(stopValue);
284
_builder
.MarkLabel(labEnd);
384
_builder
.EmitBranch(sense ? ILOpCode.Brtrue_s : ILOpCode.Brfalse_s, falseLabel);
385
_builder
.EmitBoolConstant(true);
386
_builder
.EmitBranch(ILOpCode.Br, endLabel);
388
_builder
.AdjustStack(-1);
389
_builder
.MarkLabel(falseLabel);
390
_builder
.EmitBoolConstant(false);
391
_builder
.MarkLabel(endLabel);
464
_builder
.EmitConstantValue(nullOrZero);
465
_builder
.EmitOpCode(ILOpCode.Cgt_un);
478
_builder
.EmitConstantValue(nullOrZero);
479
_builder
.EmitOpCode(ILOpCode.Ceq);
486
_builder
.EmitOpCode(opCode);
503
_builder
.EmitBoolConstant(constant == sense);
536
_builder
.EmitBoolConstant(constantValue.BooleanValue == sense);
554
_builder
.EmitOpCode(ILOpCode.Ldnull);
555
_builder
.EmitOpCode(sense ? ILOpCode.Cgt_un : ILOpCode.Ceq);
563
_builder
.EmitOpCode(ILOpCode.Ldc_i4_0);
564
_builder
.EmitOpCode(sense ? ILOpCode.Cgt_un : ILOpCode.Ceq);
603
_builder
.EmitOpCode(ILOpCode.Ldc_i4_0);
607
_builder
.EmitOpCode(ILOpCode.Conv_i8);
611
_builder
.EmitOpCode(ILOpCode.Conv_i);
615
_builder
.EmitOpCode(ILOpCode.Sub_ovf);
682
_builder
.EmitNumericConversion(Microsoft.Cci.PrimitiveTypeCode.Int32, Microsoft.Cci.PrimitiveTypeCode.UInt8, @checked);
685
_builder
.EmitNumericConversion(Microsoft.Cci.PrimitiveTypeCode.Int32, Microsoft.Cci.PrimitiveTypeCode.Int8, @checked);
688
_builder
.EmitNumericConversion(Microsoft.Cci.PrimitiveTypeCode.Int32, Microsoft.Cci.PrimitiveTypeCode.Int16, @checked);
691
_builder
.EmitNumericConversion(Microsoft.Cci.PrimitiveTypeCode.Int32, Microsoft.Cci.PrimitiveTypeCode.UInt16, @checked);
705
_builder
.EmitOpCode(ILOpCode.Mul_ovf_un);
709
_builder
.EmitOpCode(ILOpCode.Mul_ovf);
716
_builder
.EmitOpCode(ILOpCode.Add_ovf_un);
720
_builder
.EmitOpCode(ILOpCode.Add_ovf);
727
_builder
.EmitOpCode(ILOpCode.Sub_ovf_un);
731
_builder
.EmitOpCode(ILOpCode.Sub_ovf);
758
_builder
.EmitOpCode(ILOpCode.Ldc_i4_0);
759
_builder
.EmitOpCode(ILOpCode.Ceq);
CodeGen\EmitStackAllocInitializer.cs (35)
51
_builder
.EmitOpCode(ILOpCode.Dup);
52
_builder
.EmitIntConstant(data[0]);
53
_builder
.EmitIntConstant(data.Length);
54
_builder
.EmitOpCode(ILOpCode.Initblk, -3);
59
var field =
_builder
.module.GetFieldForData(data, alignment: 1, inits.Syntax, _diagnostics.DiagnosticBag);
60
_builder
.EmitOpCode(ILOpCode.Dup);
61
_builder
.EmitOpCode(ILOpCode.Ldsflda);
62
_builder
.EmitToken(field, inits.Syntax, _diagnostics.DiagnosticBag);
63
_builder
.EmitIntConstant(data.Length);
64
_builder
.EmitUnaligned(alignment: 1);
65
_builder
.EmitOpCode(ILOpCode.Cpblk, -3);
78
_builder
.EmitOpCode(ILOpCode.Dup);
82
var field =
_builder
.module.GetFieldForData(data, alignment: (ushort)sizeInBytes, syntaxNode, _diagnostics.DiagnosticBag);
83
_builder
.EmitOpCode(ILOpCode.Ldtoken);
84
_builder
.EmitToken(field, syntaxNode, _diagnostics.DiagnosticBag);
85
_builder
.EmitOpCode(ILOpCode.Call, 0);
87
_builder
.EmitToken(createSpanHelperReference, syntaxNode, _diagnostics.DiagnosticBag);
90
_builder
.EmitLocalStore(temp);
91
_builder
.EmitLocalAddress(temp);
94
_builder
.EmitIntConstant(0);
95
_builder
.EmitOpCode(ILOpCode.Call, -1);
98
_builder
.EmitIntConstant(data.Length);
101
_builder
.EmitUnaligned((sbyte)sizeInBytes);
103
_builder
.EmitOpCode(ILOpCode.Cpblk, -3);
125
_builder
.EmitOpCode(ILOpCode.Localloc);
190
_builder
.EmitOpCode(ILOpCode.Dup);
209
_builder
.EmitIntConstant(index);
210
_builder
.EmitOpCode(ILOpCode.Add);
215
_builder
.EmitOpCode(ILOpCode.Add);
219
_builder
.EmitIntConstant(index);
220
_builder
.EmitOpCode(ILOpCode.Conv_i);
222
_builder
.EmitOpCode(ILOpCode.Mul);
223
_builder
.EmitOpCode(ILOpCode.Add);
231
_builder
.EmitOpCode(ILOpCode.Sizeof);
236
_builder
.EmitIntConstant(elementTypeSizeInBytes);
CodeGen\EmitStatement.cs (127)
111
_builder
.AssertStackEmpty();
120
int n =
_builder
.InstructionsEmitted;
122
return
_builder
.InstructionsEmitted - n;
140
_builder
.EmitOpCode(ILOpCode.Nop);
152
_asyncYieldPoints.Add(
_builder
.AllocateILMarker());
158
_asyncResumePoints.Add(
_builder
.AllocateILMarker());
186
_builder
.EmitThrow(isRethrow: thrown == null);
406
_builder
.EmitBranch(ILOpCode.Br, dest);
440
_builder
.MarkLabel(fallThrough);
518
_builder
.EmitBranch(ilcode, dest, revOpCode);
559
_builder
.MarkLabel(fallThrough);
595
_builder
.EmitOpCode(ILOpCode.Isinst);
599
_builder
.EmitBranch(ilcode, dest);
618
_builder
.EmitBranch(ilcode, dest);
635
_builder
.MarkLabel(boundLabelStatement.Label);
640
_builder
.EmitBranch(ILOpCode.Br, boundGotoStatement.Label);
682
_builder
.OpenLocalScope();
700
_builder
.AssertStackEmpty();
704
_builder
.OpenLocalScope(ScopeType.TryCatchFinally);
706
_builder
.OpenLocalScope(ScopeType.Try);
709
_builder
.CloseLocalScope(); // try
711
_builder
.OpenLocalScope(ScopeType.Finally);
719
_builder
.CloseLocalScope(); // finally
721
_builder
.CloseLocalScope(); // try-finally
735
_builder
.CloseLocalScope();
745
_builder
.OpenLocalScope();
765
_builder
.EmitBranch(ILOpCode.Br, s_returnLabel);
780
_builder
.CloseLocalScope();
796
_builder
.OpenLocalScope();
805
_builder
.AddLocalToScope(
_builder
.LocalSlotManager.GetLocal(local));
811
_builder
.CloseLocalScope();
816
_builder
.OpenLocalScope(ScopeType.StateMachineVariable);
821
_builder
.DefineUserDefinedStateMachineHoistedLocal(field.SlotIndex);
826
_builder
.CloseLocalScope();
848
_builder
.InExceptionHandler;
859
!
_builder
.InExceptionHandler;
881
_builder
.EmitLocalStore(LazyReturnTemp);
890
_builder
.EmitBranch(ILOpCode.Br, s_returnLabel);
904
_builder
.EmitLocalStore(LazyReturnTemp);
917
_builder
.EmitRet(expressionOpt == null);
927
_builder
.AssertStackEmpty();
936
_builder
.OpenLocalScope(ScopeType.TryCatchFinally);
938
_builder
.OpenLocalScope(ScopeType.Try);
955
_builder
.CloseLocalScope();
967
_builder
.OpenLocalScope(statement.PreferFaultHandler ? ScopeType.Fault : ScopeType.Finally);
971
_builder
.CloseLocalScope();
974
_builder
.CloseLocalScope();
995
_builder
.CloseLocalScope();
1041
_builder
.AdjustStack(1); // Account for exception on the stack.
1052
_builder
.OpenLocalScope(ScopeType.Catch, exceptionType);
1085
_builder
.OpenLocalScope(ScopeType.Filter);
1098
_builder
.EmitOpCode(ILOpCode.Isinst);
1099
_builder
.EmitToken(exceptionType, catchBlock.Syntax, _diagnostics.DiagnosticBag);
1100
_builder
.EmitOpCode(ILOpCode.Dup);
1101
_builder
.EmitBranch(ILOpCode.Brtrue, typeCheckPassedLabel);
1102
_builder
.EmitOpCode(ILOpCode.Pop);
1103
_builder
.EmitIntConstant(0);
1104
_builder
.EmitBranch(ILOpCode.Br, typeCheckFailedLabel);
1111
_builder
.MarkLabel(typeCheckPassedLabel);
1130
_builder
.EmitOpCode(ILOpCode.Unbox_any);
1150
_builder
.EmitLocalStore(GetLocal(exceptionSourceLocal));
1164
_builder
.DefineUserDefinedStateMachineHoistedLocal(stateMachineField.SlotIndex);
1170
_builder
.EmitLocalStore(temp);
1175
_builder
.EmitLocalLoad(temp);
1187
_builder
.EmitOpCode(ILOpCode.Pop);
1192
Debug.Assert(
_builder
.IsStackEmpty);
1203
_builder
.EmitIntConstant(0);
1204
_builder
.EmitOpCode(ILOpCode.Cgt_un);
1205
_builder
.MarkLabel(typeCheckFailedLabel);
1208
_builder
.MarkFilterConditionEnd();
1212
_builder
.EmitOpCode(ILOpCode.Pop);
1217
_builder
.CloseLocalScope();
1225
_asyncCatchHandlerOffset =
_builder
.AllocateILMarker();
1302
_builder
.EmitLocalStore(temp);
1324
_builder
.EmitIntegerSwitchJumpTable(switchCaseLabels, fallThroughLabel, key, expression.Type.EnumUnderlyingTypeOrSelf().PrimitiveTypeCode);
1388
_builder
.EmitLoad(keyTemp);
1389
_builder
.EmitBranch(ILOpCode.Brfalse, lengthBasedSwitchInfo.LengthBasedJumpTable.NullCaseLabel ?? fallThroughLabel, ILOpCode.Brtrue);
1397
_builder
.EmitLoadAddress(keyTemp);
1401
_builder
.EmitLoad(keyTemp);
1403
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment: 0);
1405
_builder
.EmitLocalStore(stringLength);
1409
_builder
.EmitIntegerSwitchJumpTable(
1424
_builder
.MarkLabel(charJumpTable.Label);
1429
_builder
.EmitLoadAddress(keyTemp);
1433
_builder
.EmitLoad(keyTemp);
1435
_builder
.EmitIntConstant(charJumpTable.SelectedCharPosition);
1436
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment: -1);
1440
_builder
.EmitOpCode(ILOpCode.Ldind_u2);
1442
_builder
.EmitLocalStore(charTemp);
1446
_builder
.EmitIntegerSwitchJumpTable(
1459
_builder
.MarkLabel(stringJumpTable.Label);
1472
_builder
.EmitToken(lengthMethodRef, syntaxNode: null, diag);
1514
_builder
.EmitLoad(key);
1515
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment: 0);
1516
_builder
.EmitToken(stringHashMethodRef, syntaxNode, _diagnostics.DiagnosticBag);
1521
_builder
.EmitLocalStore(keyHash);
1564
_builder
.EmitLoad(keyArg);
1565
_builder
.EmitBranch(ILOpCode.Brfalse, targetLabel, ILOpCode.Brtrue);
1576
_builder
.EmitLoadAddress(keyArg);
1580
_builder
.EmitLoad(keyArg);
1581
_builder
.EmitBranch(ILOpCode.Brfalse, skipToNext, ILOpCode.Brtrue);
1583
_builder
.EmitLoad(keyArg);
1587
_builder
.EmitOpCode(ILOpCode.Call, 0);
1589
_builder
.EmitToken(lengthMethodRef, null, diag);
1593
_builder
.EmitBranch(ILOpCode.Brfalse, targetLabel, ILOpCode.Brtrue);
1594
_builder
.MarkLabel(skipToNext);
1609
_builder
.EmitStringSwitchJumpTable(
1704
_builder
.EmitLoad(key);
1705
_builder
.EmitConstantValue(stringConstant);
1706
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment: -1);
1707
_builder
.EmitToken(stringEqualityMethodRef, syntaxNode, _diagnostics.DiagnosticBag);
1710
_builder
.EmitBranch(ILOpCode.Brtrue, targetLabel, ILOpCode.Brfalse);
1731
_builder
.EmitLoad(key);
1732
_builder
.EmitConstantValue(stringConstant);
1733
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment: 0);
1734
_builder
.EmitToken(asSpanRef, syntaxNode, _diagnostics.DiagnosticBag);
1735
_builder
.EmitOpCode(ILOpCode.Call, stackAdjustment: -1);
1736
_builder
.EmitToken(sequenceEqualsRef, syntaxNode, _diagnostics.DiagnosticBag);
1739
_builder
.EmitBranch(ILOpCode.Brtrue, targetLabel, ILOpCode.Brfalse);
1753
return
_builder
.LocalSlotManager.GetLocal(symbol);
1775
_builder
.AddLocalConstantToScope(localConstantDef);
1816
var localDef =
_builder
.LocalSlotManager.DeclareLocal(
1834
_builder
.AddLocalToScope(localDef);
1893
_builder
.LocalSlotManager.FreeLocal(local);
1902
return
_builder
.LocalSlotManager.AllocateSlot(
1912
_builder
.LocalSlotManager.FreeSlot(temp);