Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
LightCompiler.cs
Go to the documentation of this file.
6
8
9internal sealed class LightCompiler
10{
11 private sealed class QuoteVisitor : ExpressionVisitor
12 {
14
16
18 {
20 {
22 }
23 return node;
24 }
25
26 protected internal override Expression VisitBlock(BlockExpression node)
27 {
28 PushParameters(node.Variables);
29 base.VisitBlock(node);
30 PopParameters(node.Variables);
31 return node;
32 }
33
35 {
36 if (node.Variable != null)
37 {
38 PushParameters(new ParameterExpression[1] { node.Variable });
39 }
40 Visit(node.Body);
41 Visit(node.Filter);
42 if (node.Variable != null)
43 {
44 PopParameters(new ParameterExpression[1] { node.Variable });
45 }
46 return node;
47 }
48
49 protected internal override Expression VisitLambda<T>(Expression<T> node)
50 {
52 int parameterCount = node.ParameterCount;
53 if (parameterCount > 0)
54 {
56 for (int i = 0; i < parameterCount; i++)
57 {
58 list.Add(node.GetParameter(i));
59 }
60 parameters = list;
61 }
62 PushParameters(parameters);
63 base.VisitLambda(node);
64 PopParameters(parameters);
65 return node;
66 }
67
69 {
70 foreach (ParameterExpression parameter in parameters)
71 {
73 {
75 }
76 else
77 {
79 }
80 }
81 }
82
84 {
85 foreach (ParameterExpression parameter in parameters)
86 {
88 if (num == 0)
89 {
91 }
92 else
93 {
95 }
96 }
97 }
98 }
99
101
102 private readonly LocalVariables _locals = new LocalVariables();
103
105
107
109
111
112 private readonly LightCompiler _parent;
113
114 private readonly StackGuard _guard = new StackGuard();
115
116 private static readonly LocalDefinition[] s_emptyLocals = Array.Empty<LocalDefinition>();
117
119
121 {
123 }
124
126 : this()
127 {
128 _parent = parent;
129 }
130
132 {
133 node.ValidateArgumentCount();
134 int i = 0;
135 for (int parameterCount = node.ParameterCount; i < parameterCount; i++)
136 {
137 ParameterExpression parameter = node.GetParameter(i);
140 }
141 Compile(node.Body);
142 if (node.Body.Type != typeof(void) && node.ReturnType == typeof(void))
143 {
145 }
147 }
148
150 {
151 DebugInfo[] debugInfos = _debugInfos.ToArray();
153 {
154 treeLabel.Value.ValidateFinish();
155 }
157 }
158
164
166 {
168 }
169
171 {
172 if (!(type != typeof(void)))
173 {
174 return;
175 }
176 if (type.IsNullableOrReferenceType())
177 {
179 return;
180 }
182 if (primitiveDefaultValue != null)
183 {
185 }
186 else
187 {
189 }
190 }
191
193 {
195 {
196 if (!local.InClosure && !local.IsBoxed)
197 {
199 }
200 return local;
201 }
202 if (_parent != null)
203 {
205 return _locals.AddClosureVariable(expr);
206 }
207 throw new InvalidOperationException("unbound variable: " + expr);
208 }
209
218
224
232
234 {
236 if (localVariable.InClosure)
237 {
239 }
240 else if (localVariable.IsBoxed)
241 {
243 }
244 else
245 {
247 }
248 }
249
251 {
252 if (type.IsValueType && !type.IsEnum)
253 {
254 return !type.IsPrimitive;
255 }
256 return false;
257 }
258
271
273 {
275 if (localVariable.InClosure)
276 {
277 if (isVoid)
278 {
280 }
281 else
282 {
284 }
285 }
286 else if (localVariable.IsBoxed)
287 {
288 if (isVoid)
289 {
291 }
292 else
293 {
295 }
296 }
297 else if (isVoid)
298 {
300 }
301 else
302 {
304 }
305 }
306
312
313 private void CompileBlockExpression(Expression expr, bool asVoid)
314 {
316 if (blockExpression.ExpressionCount != 0)
317 {
319 Expression expr2 = blockExpression.Expressions[blockExpression.Expressions.Count - 1];
322 }
323 }
324
326 {
330 if (variables.Count != 0)
331 {
333 int num = 0;
335 {
337 array[num++] = localDefinition;
339 }
340 }
341 else
342 {
344 }
345 for (int i = 0; i < node.Expressions.Count - 1; i++)
346 {
347 CompileAsVoid(node.Expressions[i]);
348 }
349 return array;
350 }
351
359
361 {
363 if (indexExpression.Object != null)
364 {
366 }
367 int i = 0;
368 for (int argumentCount = indexExpression.ArgumentCount; i < argumentCount; i++)
369 {
370 Compile(indexExpression.GetArgument(i));
371 }
373 }
374
376 {
377 if (index.Indexer != null)
378 {
379 _instructions.EmitCall(index.Indexer.GetGetMethod(nonPublic: true));
380 }
381 else if (index.ArgumentCount != 1)
382 {
384 }
385 else
386 {
388 }
389 }
390
392 {
394 if (indexExpression.Object != null)
395 {
397 }
398 int i = 0;
399 for (int argumentCount = indexExpression.ArgumentCount; i < argumentCount; i++)
400 {
401 Compile(indexExpression.GetArgument(i));
402 }
403 Compile(node.Right);
405 if (!asVoid)
406 {
409 }
410 if (indexExpression.Indexer != null)
411 {
412 _instructions.EmitCall(indexExpression.Indexer.GetSetMethod(nonPublic: true));
413 }
414 else if (indexExpression.ArgumentCount != 1)
415 {
417 }
418 else
419 {
421 }
422 if (!asVoid)
423 {
426 }
427 }
428
439
489
496
498 {
500 switch (binaryExpression.Left.NodeType)
501 {
502 case ExpressionType.Index:
504 break;
505 case ExpressionType.MemberAccess:
507 break;
508 case ExpressionType.Parameter:
509 case ExpressionType.Extension:
511 break;
512 default:
513 throw Error.InvalidLvalue(binaryExpression.Left.NodeType);
514 }
515 }
516
518 {
520 if (binaryExpression.Method != null)
521 {
522 if (binaryExpression.IsLifted)
523 {
531 ExpressionType nodeType = binaryExpression.NodeType;
532 if ((nodeType == ExpressionType.Equal || nodeType == ExpressionType.NotEqual) && !binaryExpression.IsLiftedToNull)
533 {
537 _instructions.EmitLoad(null, typeof(object));
541 _instructions.EmitLoad(null, typeof(object));
542 if (binaryExpression.NodeType == ExpressionType.Equal)
543 {
545 }
546 else
547 {
549 }
550 _instructions.EmitBranch(label, hasResult: false, hasValue: true);
553 _instructions.EmitLoad(null, typeof(object));
556 _instructions.EmitLoad((binaryExpression.NodeType == ExpressionType.Equal) ? Utils.BoxedFalse : Utils.BoxedTrue, typeof(bool));
557 _instructions.EmitBranch(label, hasResult: false, hasValue: true);
562 }
563 else
564 {
566 if (binaryExpression.Left.Type.IsNullableOrReferenceType())
567 {
569 _instructions.EmitLoad(null, typeof(object));
572 }
573 if (binaryExpression.Right.Type.IsNullableOrReferenceType())
574 {
576 _instructions.EmitLoad(null, typeof(object));
579 }
583 _instructions.EmitBranch(label, hasResult: false, hasValue: true);
586 if (((uint)(nodeType2 - 15) <= 1u || (uint)(nodeType2 - 20) <= 1u) && !binaryExpression.IsLiftedToNull)
587 {
589 }
590 else
591 {
592 _instructions.EmitLoad(null, typeof(object));
593 }
594 }
598 }
599 else
600 {
604 }
605 }
606 else
607 {
608 switch (binaryExpression.NodeType)
609 {
610 case ExpressionType.ArrayIndex:
614 break;
615 case ExpressionType.Add:
616 case ExpressionType.AddChecked:
617 case ExpressionType.Divide:
618 case ExpressionType.Modulo:
619 case ExpressionType.Multiply:
620 case ExpressionType.MultiplyChecked:
621 case ExpressionType.Subtract:
622 case ExpressionType.SubtractChecked:
624 break;
625 case ExpressionType.ExclusiveOr:
629 break;
630 case ExpressionType.Or:
634 break;
635 case ExpressionType.And:
639 break;
640 case ExpressionType.Equal:
642 break;
643 case ExpressionType.NotEqual:
645 break;
646 case ExpressionType.GreaterThan:
647 case ExpressionType.GreaterThanOrEqual:
648 case ExpressionType.LessThan:
649 case ExpressionType.LessThanOrEqual:
651 break;
652 case ExpressionType.LeftShift:
656 break;
657 case ExpressionType.RightShift:
661 break;
662 default:
664 }
665 }
666 }
667
668 private void CompileEqual(Expression left, Expression right, bool liftedToNull)
669 {
670 Compile(left);
671 Compile(right);
673 }
674
675 private void CompileNotEqual(Expression left, Expression right, bool liftedToNull)
676 {
677 Compile(left);
678 Compile(right);
680 }
681
683 {
684 Expression left = node.Left;
685 Expression right = node.Right;
686 Compile(left);
687 Compile(right);
688 switch (node.NodeType)
689 {
690 case ExpressionType.LessThan:
691 _instructions.EmitLessThan(left.Type, node.IsLiftedToNull);
692 break;
693 case ExpressionType.LessThanOrEqual:
694 _instructions.EmitLessThanOrEqual(left.Type, node.IsLiftedToNull);
695 break;
696 case ExpressionType.GreaterThan:
697 _instructions.EmitGreaterThan(left.Type, node.IsLiftedToNull);
698 break;
699 case ExpressionType.GreaterThanOrEqual:
700 _instructions.EmitGreaterThanOrEqual(left.Type, node.IsLiftedToNull);
701 break;
702 default:
704 }
705 }
706
707 private void CompileArithmetic(ExpressionType nodeType, Expression left, Expression right)
708 {
709 Compile(left);
710 Compile(right);
711 switch (nodeType)
712 {
713 case ExpressionType.Add:
714 _instructions.EmitAdd(left.Type, @checked: false);
715 break;
716 case ExpressionType.AddChecked:
717 _instructions.EmitAdd(left.Type, @checked: true);
718 break;
719 case ExpressionType.Subtract:
720 _instructions.EmitSub(left.Type, @checked: false);
721 break;
722 case ExpressionType.SubtractChecked:
723 _instructions.EmitSub(left.Type, @checked: true);
724 break;
725 case ExpressionType.Multiply:
726 _instructions.EmitMul(left.Type, @checked: false);
727 break;
728 case ExpressionType.MultiplyChecked:
729 _instructions.EmitMul(left.Type, @checked: true);
730 break;
731 case ExpressionType.Divide:
733 break;
734 case ExpressionType.Modulo:
736 break;
737 default:
739 }
740 }
741
743 {
745 if (unaryExpression.Method != null)
746 {
750 ParameterInfo[] parametersCached = method.GetParametersCached();
753 Type type = operand.Type;
756 Type type2 = parameterInfo.ParameterType;
757 if (type2.IsByRef)
758 {
759 if (unaryExpression.IsLifted)
760 {
761 Compile(unaryExpression.Operand);
762 }
763 else
764 {
766 type2 = type2.GetElementType();
767 }
768 }
769 else
770 {
771 Compile(unaryExpression.Operand);
772 }
774 if (!type.IsValueType || (type.IsNullableType() && unaryExpression.IsLiftedToNull))
775 {
777 _instructions.EmitLoad(null, typeof(object));
780 }
782 if (type.IsNullableType() && type2.Equals(type.GetNonNullableType()))
783 {
785 }
786 if (byRefUpdater == null)
787 {
789 }
790 else
791 {
793 byRefUpdater.UndefineTemps(_instructions, _locals);
794 }
795 _instructions.EmitBranch(label, hasResult: false, hasValue: true);
797 _instructions.EmitLoad(null, typeof(object));
800 }
801 else if (unaryExpression.Type == typeof(void))
802 {
804 }
805 else
806 {
807 Compile(unaryExpression.Operand);
808 CompileConvertToType(unaryExpression.Operand.Type, unaryExpression.Type, unaryExpression.NodeType == ExpressionType.ConvertChecked, unaryExpression.IsLiftedToNull);
809 }
810 }
811
813 {
814 if (typeTo.Equals(typeFrom) || (typeFrom.IsValueType && typeTo.IsNullableType() && typeTo.GetNonNullableType().Equals(typeFrom)))
815 {
816 return;
817 }
818 if (typeTo.IsValueType && typeFrom.IsNullableType() && typeFrom.GetNonNullableType().Equals(typeTo))
819 {
821 return;
822 }
823 Type type = typeFrom.GetNonNullableType();
824 Type type2 = typeTo.GetNonNullableType();
825 if ((type.IsNumericOrBool() || type.IsEnum) && (type2.IsNumericOrBool() || type2.IsEnum || type2 == typeof(decimal)))
826 {
827 Type type3 = null;
828 if (type.IsEnum)
829 {
831 }
832 if (type2.IsEnum)
833 {
834 type3 = type2;
836 }
837 TypeCode typeCode = type.GetTypeCode();
838 TypeCode typeCode2 = type2.GetTypeCode();
839 if (typeCode == typeCode2)
840 {
841 if ((object)type3 != null)
842 {
843 if (typeFrom.IsNullableType() && !typeTo.IsNullableType())
844 {
846 }
847 }
848 else
849 {
851 }
852 }
853 else if (isChecked)
854 {
856 }
857 else
858 {
860 }
861 if ((object)type3 != null)
862 {
864 }
865 }
866 else if (typeTo.IsEnum)
867 {
870 }
871 else if (!(typeTo == typeof(object)) && !typeTo.IsAssignableFrom(typeFrom))
872 {
874 }
875 }
876
878 {
879 Compile(node.Operand);
880 _instructions.EmitNot(node.Operand.Type);
881 }
882
884 {
886 if (unaryExpression.Method != null)
887 {
889 return;
890 }
891 switch (unaryExpression.NodeType)
892 {
893 case ExpressionType.Not:
894 case ExpressionType.OnesComplement:
896 break;
897 case ExpressionType.TypeAs:
899 break;
900 case ExpressionType.ArrayLength:
901 Compile(unaryExpression.Operand);
903 break;
904 case ExpressionType.NegateChecked:
905 Compile(unaryExpression.Operand);
907 break;
908 case ExpressionType.Negate:
909 Compile(unaryExpression.Operand);
911 break;
912 case ExpressionType.Increment:
913 Compile(unaryExpression.Operand);
915 break;
916 case ExpressionType.Decrement:
917 Compile(unaryExpression.Operand);
919 break;
920 case ExpressionType.UnaryPlus:
921 Compile(unaryExpression.Operand);
922 break;
923 case ExpressionType.IsTrue:
924 case ExpressionType.IsFalse:
926 break;
927 default:
929 }
930 }
931
950
971
976
981
983 {
984 if (b.Method != null && !b.IsLiftedLogical)
985 {
987 }
988 else if (b.Left.Type == typeof(bool?))
989 {
991 }
992 else if (b.IsLiftedLogical)
993 {
994 Compile(b.ReduceUserdefinedLifted());
995 }
996 else
997 {
999 }
1000 }
1001
1014
1016 {
1023 Compile(node.Left);
1026 _instructions.EmitLoad(null, typeof(object));
1030 if (andAlso)
1031 {
1033 }
1034 else
1035 {
1037 }
1040 Compile(node.Right);
1043 _instructions.EmitLoad(null, typeof(object));
1047 if (andAlso)
1048 {
1050 }
1051 else
1052 {
1054 }
1056 _instructions.EmitLoad(null, typeof(object));
1067 _instructions.EmitLoad(null, typeof(object));
1074 }
1075
1095
1124
1126 {
1128 PushLabelBlock(LabelScopeKind.Statement);
1131 _instructions.MarkLabel(labelInfo2.GetLabel(this));
1133 _instructions.EmitBranch(labelInfo2.GetLabel(this), loopExpression.Type != typeof(void), hasValue: false);
1134 _instructions.MarkLabel(labelInfo.GetLabel(this));
1135 PopLabelBlock(LabelScopeKind.Statement);
1136 }
1137
1139 {
1141 if (switchExpression.Cases.All((SwitchCase c) => c.TestValues.All((Expression t) => t is ConstantExpression)))
1142 {
1143 if (switchExpression.Cases.Count == 0)
1144 {
1145 CompileAsVoid(switchExpression.SwitchValue);
1146 if (switchExpression.DefaultBody != null)
1147 {
1148 Compile(switchExpression.DefaultBody);
1149 }
1150 return;
1151 }
1152 TypeCode typeCode = switchExpression.SwitchValue.Type.GetTypeCode();
1153 if (switchExpression.Comparison == null)
1154 {
1155 switch (typeCode)
1156 {
1157 case TypeCode.Int32:
1159 return;
1160 case TypeCode.SByte:
1161 case TypeCode.Byte:
1162 case TypeCode.Int16:
1163 case TypeCode.UInt16:
1164 case TypeCode.UInt32:
1165 case TypeCode.Int64:
1166 case TypeCode.UInt64:
1168 return;
1169 }
1170 }
1171 if (typeCode == TypeCode.String)
1172 {
1174 if (methodInfo != null && !methodInfo.IsStatic)
1175 {
1176 methodInfo = null;
1177 }
1178 if (object.Equals(switchExpression.Comparison, methodInfo))
1179 {
1181 return;
1182 }
1183 }
1184 }
1186 Compile(switchExpression.SwitchValue);
1188 LabelTarget target = Expression.Label(switchExpression.Type, "done");
1189 foreach (SwitchCase @case in switchExpression.Cases)
1190 {
1191 foreach (Expression testValue in @case.TestValues)
1192 {
1194 }
1195 }
1198 }
1199
1201 {
1203 bool flag = node.Type != typeof(void);
1204 Compile(node.SwitchValue);
1207 _instructions.EmitIntSwitch(dictionary);
1208 if (node.DefaultBody != null)
1209 {
1210 Compile(node.DefaultBody, !flag);
1211 }
1212 _instructions.EmitBranch(labelInfo.GetLabel(this), hasResult: false, flag);
1213 for (int i = 0; i < node.Cases.Count; i++)
1214 {
1215 SwitchCase switchCase = node.Cases[i];
1216 int value = _instructions.Count - count;
1217 foreach (ConstantExpression testValue in switchCase.TestValues)
1218 {
1219 T key = (T)testValue.Value;
1220 dictionary.TryAdd(key, value);
1221 }
1222 Compile(switchCase.Body, !flag);
1223 if (i < node.Cases.Count - 1)
1224 {
1225 _instructions.EmitBranch(labelInfo.GetLabel(this), hasResult: false, flag);
1226 }
1227 }
1228 _instructions.MarkLabel(labelInfo.GetLabel(this));
1229 }
1230
1232 {
1234 bool flag = node.Type != typeof(void);
1235 Compile(node.SwitchValue);
1240 if (node.DefaultBody != null)
1241 {
1242 Compile(node.DefaultBody, !flag);
1243 }
1244 _instructions.EmitBranch(labelInfo.GetLabel(this), hasResult: false, flag);
1245 for (int i = 0; i < node.Cases.Count; i++)
1246 {
1247 SwitchCase switchCase = node.Cases[i];
1248 int value = _instructions.Count - count;
1249 foreach (ConstantExpression testValue in switchCase.TestValues)
1250 {
1251 string text = (string)testValue.Value;
1252 if (text == null)
1253 {
1254 if (strongBox.Value == 1)
1255 {
1256 strongBox.Value = value;
1257 }
1258 }
1259 else
1260 {
1261 dictionary.TryAdd(text, value);
1262 }
1263 }
1264 Compile(switchCase.Body, !flag);
1265 if (i < node.Cases.Count - 1)
1266 {
1267 _instructions.EmitBranch(labelInfo.GetLabel(this), hasResult: false, flag);
1268 }
1269 }
1270 _instructions.MarkLabel(labelInfo.GetLabel(this));
1271 }
1272
1274 {
1276 LabelInfo info = null;
1277 if (_labelBlock.Kind == LabelScopeKind.Block)
1278 {
1280 if (info == null && _labelBlock.Parent.Kind == LabelScopeKind.Switch)
1281 {
1283 }
1284 }
1285 if (info == null)
1286 {
1288 }
1289 if (labelExpression.DefaultValue != null)
1290 {
1291 if (labelExpression.Target.Type == typeof(void))
1292 {
1293 CompileAsVoid(labelExpression.DefaultValue);
1294 }
1295 else
1296 {
1297 Compile(labelExpression.DefaultValue);
1298 }
1299 }
1300 _instructions.MarkLabel(info.GetLabel(this));
1301 }
1302
1304 {
1307 if (gotoExpression.Value != null)
1308 {
1309 Compile(gotoExpression.Value);
1310 }
1311 _instructions.EmitGoto(labelInfo.GetLabel(this), gotoExpression.Type != typeof(void), gotoExpression.Value != null && gotoExpression.Value.Type != typeof(void), gotoExpression.Target.Type != typeof(void));
1312 }
1313
1318
1320 {
1322 }
1323
1325 {
1327 {
1328 value = (_treeLabels[node] = new LabelInfo(node));
1329 }
1330 return value;
1331 }
1332
1334 {
1336 labelInfo.Reference(_labelBlock);
1337 return labelInfo;
1338 }
1339
1341 {
1342 if (node == null)
1343 {
1344 return new LabelInfo(null);
1345 }
1347 labelInfo.Define(_labelBlock);
1348 return labelInfo;
1349 }
1350
1352 {
1353 switch (node.NodeType)
1354 {
1355 default:
1356 if (_labelBlock.Kind != LabelScopeKind.Expression)
1357 {
1358 PushLabelBlock(LabelScopeKind.Expression);
1359 return true;
1360 }
1361 return false;
1362 case ExpressionType.Label:
1363 if (_labelBlock.Kind == LabelScopeKind.Block)
1364 {
1365 LabelTarget target = ((LabelExpression)node).Target;
1366 if (_labelBlock.ContainsTarget(target))
1367 {
1368 return false;
1369 }
1371 {
1372 return false;
1373 }
1374 }
1375 PushLabelBlock(LabelScopeKind.Statement);
1376 return true;
1377 case ExpressionType.Block:
1379 if (_labelBlock.Parent.Kind != LabelScopeKind.Switch)
1380 {
1382 }
1383 return true;
1384 case ExpressionType.Switch:
1385 {
1388 foreach (SwitchCase @case in switchExpression.Cases)
1389 {
1390 DefineBlockLabels(@case.Body);
1391 }
1393 return true;
1394 }
1395 case ExpressionType.Convert:
1396 if (!(node.Type != typeof(void)))
1397 {
1398 PushLabelBlock(LabelScopeKind.Statement);
1399 return true;
1400 }
1401 goto default;
1402 case ExpressionType.Conditional:
1403 case ExpressionType.Goto:
1404 case ExpressionType.Loop:
1405 PushLabelBlock(LabelScopeKind.Statement);
1406 return true;
1407 }
1408 }
1409
1411 {
1413 {
1414 return;
1415 }
1416 int i = 0;
1417 for (int count = blockExpression.Expressions.Count; i < count; i++)
1418 {
1419 Expression expression = blockExpression.Expressions[i];
1421 {
1423 }
1424 }
1425 }
1426
1427 private void CheckRethrow()
1428 {
1430 {
1431 if (labelScopeInfo.Kind == LabelScopeKind.Catch)
1432 {
1433 return;
1434 }
1435 if (labelScopeInfo.Kind == LabelScopeKind.Finally)
1436 {
1437 break;
1438 }
1439 }
1441 }
1442
1444 {
1446 if (unaryExpression.Operand == null)
1447 {
1448 CheckRethrow();
1450 if (asVoid)
1451 {
1453 }
1454 else
1455 {
1457 }
1458 }
1459 else
1460 {
1461 Compile(unaryExpression.Operand);
1462 if (asVoid)
1463 {
1465 }
1466 else
1467 {
1469 }
1470 }
1471 }
1472
1474 {
1476 if (tryExpression.Fault != null)
1477 {
1479 return;
1480 }
1485 if (tryExpression.Finally != null)
1486 {
1489 }
1490 else
1491 {
1493 }
1497 bool flag = tryExpression.Type != typeof(void);
1498 Compile(tryExpression.Body, !flag);
1501 _instructions.EmitGoto(label, flag, flag, flag);
1502 if (tryExpression.Handlers.Count > 0)
1503 {
1505 foreach (CatchBlock handler in tryExpression.Handlers)
1506 {
1507 ParameterExpression parameterExpression = handler.Variable ?? Expression.Parameter(handler.Test);
1510 ExceptionFilter filter = null;
1511 if (handler.Filter != null)
1512 {
1518 Compile(handler.Filter);
1523 }
1525 if (flag)
1526 {
1528 }
1529 else
1530 {
1532 }
1536 Compile(handler.Body, !flag);
1542 }
1543 }
1544 if (tryExpression.Finally != null)
1545 {
1551 enterTryCatchFinallyInstruction.SetTryHandler(new TryCatchFinallyHandler(count, count2, branchLabel.TargetIndex, branchLabel2.TargetIndex, _instructions.Count, list?.ToArray()));
1553 }
1554 else
1555 {
1556 enterTryCatchFinallyInstruction.SetTryHandler(new TryCatchFinallyHandler(count, count2, branchLabel.TargetIndex, list.ToArray()));
1557 }
1560 }
1561
1583
1589
1591 {
1592 ParameterInfo[] parametersCached = method.GetParametersCached();
1593 List<ByRefUpdater> list = null;
1594 if (!method.IsStatic)
1595 {
1597 if (byRefUpdater != null)
1598 {
1600 }
1601 }
1602 int i = 0;
1603 for (int argumentCount = arguments.ArgumentCount; i < argumentCount; i++)
1604 {
1605 Expression argument = arguments.GetArgument(i);
1606 if (parametersCached[i].ParameterType.IsByRef)
1607 {
1609 if (byRefUpdater2 != null)
1610 {
1611 if (list == null)
1612 {
1613 list = new List<ByRefUpdater>();
1614 }
1615 list.Add(byRefUpdater2);
1616 }
1617 }
1618 else
1619 {
1621 }
1622 }
1623 if (!method.IsStatic && @object.Type.IsNullableType())
1624 {
1626 return;
1627 }
1628 if (list == null)
1629 {
1631 return;
1632 }
1634 foreach (ByRefUpdater item in list)
1635 {
1636 item.UndefineTemps(_instructions, _locals);
1637 }
1638 }
1639
1653
1655 {
1656 CompileAddress(node, -1);
1657 }
1658
1660 {
1661 if (node.Type.IsValueType)
1662 {
1663 switch (node.NodeType)
1664 {
1665 case ExpressionType.ArrayIndex:
1666 case ExpressionType.Call:
1667 case ExpressionType.Parameter:
1668 return true;
1669 case ExpressionType.Index:
1670 return ((IndexExpression)node).Object.Type.IsArray;
1671 case ExpressionType.MemberAccess:
1672 return ((MemberExpression)node).Member is FieldInfo;
1673 }
1674 }
1675 return false;
1676 }
1677
1679 {
1680 if (index != -1 || ShouldWritebackNode(node))
1681 {
1682 switch (node.NodeType)
1683 {
1684 case ExpressionType.Parameter:
1687 case ExpressionType.ArrayIndex:
1688 {
1691 }
1692 case ExpressionType.Index:
1693 {
1695 if (indexExpression.Indexer != null)
1696 {
1697 LocalDefinition? obj = null;
1698 if (indexExpression.Object != null)
1699 {
1703 _instructions.EmitStoreLocal(obj.GetValueOrDefault().Index);
1704 }
1705 int argumentCount = indexExpression.ArgumentCount;
1707 for (int i = 0; i < argumentCount; i++)
1708 {
1709 Expression argument = indexExpression.GetArgument(i);
1715 }
1717 return new IndexMethodByRefUpdater(obj, array, indexExpression.Indexer.GetSetMethod(), index);
1718 }
1719 if (indexExpression.ArgumentCount == 1)
1720 {
1721 return CompileArrayIndexAddress(indexExpression.Object, indexExpression.GetArgument(0), index);
1722 }
1724 }
1725 case ExpressionType.MemberAccess:
1726 {
1728 LocalDefinition? obj2 = null;
1729 if (memberExpression.Expression != null)
1730 {
1734 _instructions.EmitStoreLocal(obj2.GetValueOrDefault().Index);
1735 }
1736 FieldInfo fieldInfo = memberExpression.Member as FieldInfo;
1737 if (fieldInfo != null)
1738 {
1740 if (!fieldInfo.IsLiteral && !fieldInfo.IsInitOnly)
1741 {
1742 return new FieldByRefUpdater(obj2, fieldInfo, index);
1743 }
1744 return null;
1745 }
1746 PropertyInfo propertyInfo = (PropertyInfo)memberExpression.Member;
1747 _instructions.EmitCall(propertyInfo.GetGetMethod(nonPublic: true));
1748 if (propertyInfo.CanWrite)
1749 {
1750 return new PropertyByRefUpdater(obj2, propertyInfo, index);
1751 }
1752 return null;
1753 }
1754 case ExpressionType.Call:
1755 {
1757 if (!methodCallExpression.Method.IsStatic && methodCallExpression.Object.Type.IsArray && methodCallExpression.Method == TypeUtils.GetArrayGetMethod(methodCallExpression.Object.Type))
1758 {
1760 }
1761 break;
1762 }
1763 }
1764 }
1765 Compile(node);
1766 return null;
1767 }
1768
1789
1791 {
1793 if (newExpression.Constructor != null)
1794 {
1795 if (newExpression.Constructor.DeclaringType.IsAbstract)
1796 {
1798 }
1799 ParameterInfo[] parametersCached = newExpression.Constructor.GetParametersCached();
1800 List<ByRefUpdater> list = null;
1801 for (int i = 0; i < parametersCached.Length; i++)
1802 {
1803 Expression argument = newExpression.GetArgument(i);
1804 if (parametersCached[i].ParameterType.IsByRef)
1805 {
1807 if (byRefUpdater != null)
1808 {
1809 if (list == null)
1810 {
1811 list = new List<ByRefUpdater>();
1812 }
1813 list.Add(byRefUpdater);
1814 }
1815 }
1816 else
1817 {
1819 }
1820 }
1821 if (list != null)
1822 {
1824 }
1825 else
1826 {
1828 }
1829 }
1830 else
1831 {
1832 Type type = newExpression.Type;
1833 if (type.IsNullableType())
1834 {
1835 _instructions.EmitLoad(null);
1836 }
1837 else
1838 {
1840 }
1841 }
1842 }
1843
1849
1851 {
1852 if (member is FieldInfo fieldInfo)
1853 {
1854 if (fieldInfo.IsLiteral)
1855 {
1856 _instructions.EmitLoad(fieldInfo.GetValue(null), fieldInfo.FieldType);
1857 }
1858 else if (fieldInfo.IsStatic)
1859 {
1860 if (forBinding)
1861 {
1862 throw Error.InvalidProgram();
1863 }
1864 if (fieldInfo.IsInitOnly)
1865 {
1866 _instructions.EmitLoad(fieldInfo.GetValue(null), fieldInfo.FieldType);
1867 }
1868 else
1869 {
1871 }
1872 }
1873 else
1874 {
1875 if (from != null)
1876 {
1878 }
1880 }
1881 return;
1882 }
1883 PropertyInfo propertyInfo = (PropertyInfo)member;
1884 if (propertyInfo != null)
1885 {
1886 MethodInfo getMethod = propertyInfo.GetGetMethod(nonPublic: true);
1887 if (forBinding && getMethod.IsStatic)
1888 {
1889 throw Error.InvalidProgram();
1890 }
1891 if (from != null)
1892 {
1894 }
1895 if (!getMethod.IsStatic && from != null && from.Type.IsNullableType())
1896 {
1898 }
1899 else
1900 {
1902 }
1903 }
1904 }
1905
1907 {
1909 foreach (Expression expression in newArrayExpression.Expressions)
1910 {
1912 }
1913 Type elementType = newArrayExpression.Type.GetElementType();
1914 int count = newArrayExpression.Expressions.Count;
1915 if (newArrayExpression.NodeType == ExpressionType.NewArrayInit)
1916 {
1918 }
1919 else if (count == 1)
1920 {
1922 }
1923 else
1924 {
1926 }
1927 }
1928
1930 {
1934 {
1935 Index = count,
1936 FileName = debugInfoExpression.Document.FileName,
1937 StartLine = debugInfoExpression.StartLine,
1938 EndLine = debugInfoExpression.EndLine,
1939 IsClear = debugInfoExpression.IsClear
1940 };
1942 }
1943
1954
1956 {
1960 if (lightCompiler._locals.ClosureVariables != null)
1961 {
1962 foreach (ParameterExpression key in lightCompiler._locals.ClosureVariables.Keys)
1963 {
1966 }
1967 }
1969 }
1970
1972 {
1974 bool flag = binaryExpression.Conversion != null;
1975 bool flag2 = false;
1976 if (!flag && binaryExpression.Left.Type.IsNullableType())
1977 {
1978 Type type = binaryExpression.Left.Type;
1979 if (!binaryExpression.Type.IsNullableType())
1980 {
1981 type = type.GetNonNullableType();
1982 }
1984 {
1985 flag2 = true;
1986 flag = true;
1987 }
1988 }
1990 BranchLabel label = null;
1995 if (flag)
1996 {
1999 }
2000 else if (binaryExpression.Right.Type.IsValueType && !TypeUtils.AreEquivalent(binaryExpression.Type, binaryExpression.Right.Type))
2001 {
2002 CompileConvertToType(binaryExpression.Right.Type, binaryExpression.Type, isChecked: true, binaryExpression.Type.IsNullableType());
2003 }
2005 if (binaryExpression.Conversion != null)
2006 {
2011 MethodInfo invokeMethod = binaryExpression.Conversion.Type.GetInvokeMethod();
2015 }
2016 else if (flag2)
2017 {
2018 Type nonNullableType = binaryExpression.Left.Type.GetNonNullableType();
2020 }
2021 if (flag)
2022 {
2024 }
2025 }
2026
2028 {
2030 if (typeof(LambdaExpression).IsAssignableFrom(invocationExpression.Expression.Type))
2031 {
2034 }
2035 else
2036 {
2037 CompileMethodCallExpression(invocationExpression.Expression, invocationExpression.Expression.Type.GetInvokeMethod(), invocationExpression);
2038 }
2039 }
2040
2048
2050 {
2051 for (int i = 0; i < initializers.Count; i++)
2052 {
2055 foreach (Expression argument in elementInit.Arguments)
2056 {
2058 }
2059 MethodInfo addMethod = elementInit.AddMethod;
2061 if (addMethod.ReturnType != typeof(void))
2062 {
2064 }
2065 }
2066 }
2067
2074
2076 {
2077 foreach (MemberBinding binding in bindings)
2078 {
2079 switch (binding.BindingType)
2080 {
2081 case MemberBindingType.Assignment:
2084 break;
2085 case MemberBindingType.ListBinding:
2086 {
2089 CompileMember(null, memberListBinding.Member, forBinding: true);
2090 CompileListInit(memberListBinding.Initializers);
2092 break;
2093 }
2094 case MemberBindingType.MemberBinding:
2095 {
2099 if (memberMemberBinding.Member is PropertyInfo && memberType.IsValueType)
2100 {
2102 }
2103 CompileMember(null, memberMemberBinding.Member, forBinding: true);
2106 break;
2107 }
2108 }
2109 }
2110 }
2111
2112 private static Type GetMemberType(MemberInfo member)
2113 {
2115 if (fieldInfo != null)
2116 {
2117 return fieldInfo.FieldType;
2118 }
2119 PropertyInfo propertyInfo = member as PropertyInfo;
2120 if (propertyInfo != null)
2121 {
2122 return propertyInfo.PropertyType;
2123 }
2124 throw new InvalidOperationException("MemberNotFieldOrProperty");
2125 }
2126
2140
2142 {
2144 Compile(unaryExpression.Operand);
2145 if (unaryExpression.Type.IsValueType && !unaryExpression.Type.IsNullableType())
2146 {
2148 }
2149 }
2150
2152 {
2154 Compile(typeBinaryExpression.Expression);
2155 if (typeBinaryExpression.Expression.Type == typeof(void))
2156 {
2157 _instructions.EmitLoad(typeBinaryExpression.TypeOperand == typeof(void), typeof(bool));
2158 return;
2159 }
2160 _instructions.EmitLoad(typeBinaryExpression.TypeOperand.GetNonNullableType());
2162 }
2163
2165 {
2166 Compile(node.Operand);
2168 }
2169
2171 {
2174 Compile(typeBinaryExpression.Expression);
2175 switch (analyzeTypeIsResult)
2176 {
2177 case AnalyzeTypeIsResult.KnownFalse:
2178 case AnalyzeTypeIsResult.KnownTrue:
2179 if (typeBinaryExpression.Expression.Type != typeof(void))
2180 {
2182 }
2184 break;
2185 case AnalyzeTypeIsResult.KnownAssignable:
2186 _instructions.EmitLoad(null);
2188 break;
2189 default:
2190 if (typeBinaryExpression.TypeOperand.IsValueType)
2191 {
2192 _instructions.EmitLoad(typeBinaryExpression.TypeOperand.GetNonNullableType());
2194 }
2195 else
2196 {
2198 }
2199 break;
2200 }
2201 }
2202
2203 private void Compile(Expression expr, bool asVoid)
2204 {
2205 if (asVoid)
2206 {
2207 CompileAsVoid(expr);
2208 }
2209 else
2210 {
2211 Compile(expr);
2212 }
2213 }
2214
2215 private void CompileAsVoid(Expression expr)
2216 {
2217 bool flag = TryPushLabelBlock(expr);
2219 switch (expr.NodeType)
2220 {
2221 case ExpressionType.Assign:
2223 break;
2224 case ExpressionType.Block:
2225 CompileBlockExpression(expr, asVoid: true);
2226 break;
2227 case ExpressionType.Throw:
2229 break;
2230 default:
2231 CompileNoLabelPush(expr);
2232 if (expr.Type != typeof(void))
2233 {
2235 }
2236 break;
2237 case ExpressionType.Constant:
2238 case ExpressionType.Parameter:
2239 case ExpressionType.Default:
2240 break;
2241 }
2242 if (flag)
2243 {
2245 }
2246 }
2247
2249 {
2251 {
2252 _guard.RunOnEmptyStack(delegate(LightCompiler @this, Expression e)
2253 {
2254 @this.CompileNoLabelPush(e);
2255 }, this, expr);
2256 return;
2257 }
2259 switch (expr.NodeType)
2260 {
2261 case ExpressionType.Add:
2262 case ExpressionType.AddChecked:
2263 case ExpressionType.And:
2264 case ExpressionType.ArrayIndex:
2265 case ExpressionType.Divide:
2266 case ExpressionType.Equal:
2267 case ExpressionType.ExclusiveOr:
2268 case ExpressionType.GreaterThan:
2269 case ExpressionType.GreaterThanOrEqual:
2270 case ExpressionType.LeftShift:
2271 case ExpressionType.LessThan:
2272 case ExpressionType.LessThanOrEqual:
2273 case ExpressionType.Modulo:
2274 case ExpressionType.Multiply:
2275 case ExpressionType.MultiplyChecked:
2276 case ExpressionType.NotEqual:
2277 case ExpressionType.Or:
2278 case ExpressionType.Power:
2279 case ExpressionType.RightShift:
2280 case ExpressionType.Subtract:
2281 case ExpressionType.SubtractChecked:
2283 break;
2284 case ExpressionType.AndAlso:
2286 break;
2287 case ExpressionType.OrElse:
2289 break;
2290 case ExpressionType.Coalesce:
2292 break;
2293 case ExpressionType.ArrayLength:
2294 case ExpressionType.Negate:
2295 case ExpressionType.UnaryPlus:
2296 case ExpressionType.NegateChecked:
2297 case ExpressionType.Not:
2298 case ExpressionType.TypeAs:
2299 case ExpressionType.Decrement:
2300 case ExpressionType.Increment:
2301 case ExpressionType.OnesComplement:
2302 case ExpressionType.IsTrue:
2303 case ExpressionType.IsFalse:
2305 break;
2306 case ExpressionType.Convert:
2307 case ExpressionType.ConvertChecked:
2309 break;
2310 case ExpressionType.Quote:
2312 break;
2313 case ExpressionType.Throw:
2314 CompileThrowUnaryExpression(expr, expr.Type == typeof(void));
2315 break;
2316 case ExpressionType.Unbox:
2318 break;
2319 case ExpressionType.Call:
2321 break;
2322 case ExpressionType.Conditional:
2323 CompileConditionalExpression(expr, expr.Type == typeof(void));
2324 break;
2325 case ExpressionType.Constant:
2327 break;
2328 case ExpressionType.Invoke:
2330 break;
2331 case ExpressionType.Lambda:
2333 break;
2334 case ExpressionType.ListInit:
2336 break;
2337 case ExpressionType.MemberAccess:
2339 break;
2340 case ExpressionType.MemberInit:
2342 break;
2343 case ExpressionType.New:
2345 break;
2346 case ExpressionType.NewArrayInit:
2347 case ExpressionType.NewArrayBounds:
2349 break;
2350 case ExpressionType.Parameter:
2352 break;
2353 case ExpressionType.TypeIs:
2355 break;
2356 case ExpressionType.TypeEqual:
2358 break;
2359 case ExpressionType.Assign:
2360 CompileAssignBinaryExpression(expr, expr.Type == typeof(void));
2361 break;
2362 case ExpressionType.Block:
2363 CompileBlockExpression(expr, expr.Type == typeof(void));
2364 break;
2365 case ExpressionType.DebugInfo:
2367 break;
2368 case ExpressionType.Default:
2370 break;
2371 case ExpressionType.Goto:
2373 break;
2374 case ExpressionType.Index:
2376 break;
2377 case ExpressionType.Label:
2379 break;
2380 case ExpressionType.RuntimeVariables:
2382 break;
2383 case ExpressionType.Loop:
2385 break;
2386 case ExpressionType.Switch:
2388 break;
2389 case ExpressionType.Try:
2391 break;
2392 default:
2393 Compile(expr.ReduceAndCheck());
2394 break;
2395 }
2396 }
2397
2398 private void Compile(Expression expr)
2399 {
2400 bool flag = TryPushLabelBlock(expr);
2401 CompileNoLabelPush(expr);
2402 if (flag)
2403 {
2405 }
2406 }
2407}
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
static MethodInfo GetArrayGetMethod(Type arrayType)
Definition TypeUtils.cs:769
static bool AreEquivalent(Type t1, Type t2)
Definition TypeUtils.cs:664
static MethodInfo GetBooleanOperator(Type type, string name)
Definition TypeUtils.cs:640
static MethodInfo GetArraySetMethod(Type arrayType)
Definition TypeUtils.cs:775
static Type GetUnderlyingType(Type enumType)
Definition Enum.cs:309
static AnalyzeTypeIsResult AnalyzeTypeIs(TypeBinaryExpression typeIs)
static Exception NonAbstractConstructorRequired()
Definition Error.cs:833
static Exception NotSupported()
Definition Error.cs:823
static Exception InvalidProgram()
Definition Error.cs:838
static Exception RethrowRequiresCatch()
Definition Error.cs:773
static Exception InvalidLvalue(ExpressionType p0)
Definition Error.cs:753
static Exception CannotAutoInitializeValueTypeMemberThroughProperty(object p0)
Definition Error.cs:413
virtual ? Expression Visit(Expression? node)
static MethodCallExpression Call(MethodInfo method)
static ParameterExpression Parameter(Type type)
virtual ExpressionType NodeType
static LabelExpression Label(LabelTarget target)
static ConditionalExpression Condition(Expression test, Expression ifTrue, Expression ifFalse)
static BinaryExpression Equal(Expression left, Expression right)
static GotoExpression Goto(LabelTarget target)
void EmitGreaterThanOrEqual(Type type, bool liftedToNull)
EnterTryFaultInstruction EmitEnterTryFault(BranchLabel tryEnd)
void EmitNewArrayBounds(Type elementType, int rank)
void EmitNew(ConstructorInfo constructorInfo, ParameterInfo[] parameters)
void EmitEnterTryFinally(BranchLabel finallyStartLabel)
void EmitStringSwitch(Dictionary< string, int > cases, StrongBox< int > nullCase)
void EmitGoto(BranchLabel label, bool hasResult, bool hasValue, bool labelTargetGetsValue)
void EmitEqual(Type type, bool liftedToNull=false)
void EmitCreateDelegate(LightDelegateCreator creator)
void EmitLessThanOrEqual(Type type, bool liftedToNull)
void EmitByRefCall(MethodInfo method, ParameterInfo[] parameters, ByRefUpdater[] byrefArgs)
void EmitNewArrayInit(Type elementType, int elementCount)
void EmitLessThan(Type type, bool liftedToNull)
void EmitNullableCall(MethodInfo method, ParameterInfo[] parameters)
void EmitNumericConvertChecked(TypeCode from, TypeCode to, bool isLiftedToNull)
void EmitLeaveExceptionHandler(bool hasValue, BranchLabel tryExpressionEndLabel)
void EmitNotEqual(Type type, bool liftedToNull=false)
void EmitConvertToUnderlying(TypeCode to, bool isLiftedToNull)
void EmitGreaterThan(Type type, bool liftedToNull)
void EmitEnterFinally(BranchLabel finallyStartLabel)
void EmitBranch(OffsetInstruction instruction, BranchLabel label)
void EmitNumericConvertUnchecked(TypeCode from, TypeCode to, bool isLiftedToNull)
void EmitByRefNew(ConstructorInfo constructorInfo, ParameterInfo[] parameters, ByRefUpdater[] updaters)
void EmitEnterFault(BranchLabel faultStartLabel)
bool TryGetLabelInfo(LabelTarget target, [NotNullWhen(true)] out LabelInfo info)
readonly HashSet< ParameterExpression > _hoistedParameters
void PopParameters(IEnumerable< ParameterExpression > parameters)
override Expression VisitBlock(BlockExpression node)
void PushParameters(IEnumerable< ParameterExpression > parameters)
override Expression VisitLambda< T >(Expression< T > node)
readonly Dictionary< ParameterExpression, int > _definedParameters
override Expression VisitParameter(ParameterExpression node)
void CompileIntSwitchExpression< T >(SwitchExpression node)
LightDelegateCreator CompileTop(LambdaExpression node)
void CompileSetVariable(ParameterExpression variable, bool isVoid)
void CompileNotEqual(Expression left, Expression right, bool liftedToNull)
readonly Stack< ParameterExpression > _exceptionForRethrowStack
void CompileMethodCallExpression(Expression @object, MethodInfo method, IArgumentProvider arguments)
ByRefUpdater CompileArrayIndexAddress(Expression array, Expression index, int argumentIndex)
void CompileBlockEnd(LocalDefinition[] locals)
static readonly LocalDefinition[] s_emptyLocals
void CompileMember(Expression from, MemberInfo member, bool forBinding)
void CompileMemberAssignment(BinaryExpression node, bool asVoid)
void CompileVariableAssignment(BinaryExpression node, bool asVoid)
LocalVariable EnsureAvailableForClosure(ParameterExpression expr)
void CompileStringSwitchExpression(SwitchExpression node)
Interpreter MakeInterpreter(string lambdaName)
void CompileThrowUnaryExpression(Expression expr, bool asVoid)
void CompileBlockExpression(Expression expr, bool asVoid)
readonly HybridReferenceDictionary< LabelTarget, LabelInfo > _treeLabels
void CompileGetBoxedVariable(ParameterExpression variable)
void Compile(Expression expr, bool asVoid)
void CompileConvertToType(Type typeFrom, Type typeTo, bool isChecked, bool isLiftedToNull)
void CompileConditionalExpression(Expression expr, bool asVoid)
void CompileMemberAssignment(bool asVoid, MemberInfo refMember, Expression value, bool forBinding)
ByRefUpdater CompileAddress(Expression node, int index)
void CompileMemberInit(ReadOnlyCollection< MemberBinding > bindings)
void CompileLogicalBinaryExpression(BinaryExpression b, bool andAlso)
void CompileListInit(ReadOnlyCollection< ElementInit > initializers)
LocalVariable ResolveLocal(ParameterExpression variable)
void CompileUnliftedLogicalBinaryExpression(BinaryExpression expr, bool andAlso)
void CompileMethodLogicalBinaryExpression(BinaryExpression expr, bool andAlso)
void CompileLiftedLogicalBinaryExpression(BinaryExpression node, bool andAlso)
void CompileIndexAssignment(BinaryExpression node, bool asVoid)
void CompileAssignBinaryExpression(Expression expr, bool asVoid)
LocalDefinition[] CompileBlockStart(BlockExpression node)
ByRefUpdater CompileMultiDimArrayAccess(Expression array, IArgumentProvider arguments, int index)
void LoadLocalNoValueTypeCopy(ParameterExpression variable)
void CompileEqual(Expression left, Expression right, bool liftedToNull)
void CompileArithmetic(ExpressionType nodeType, Expression left, Expression right)
void CompileGetVariable(ParameterExpression variable)
void Box(ParameterExpression variable, InstructionList instructions)
bool TryGetLocalOrClosure(ParameterExpression var, [NotNullWhen(true)] out LocalVariable local)
LocalVariable AddClosureVariable(ParameterExpression variable)
void UndefineLocal(LocalDefinition definition, int end)
LocalDefinition DefineLocal(ParameterExpression variable, int start)
static MethodInfo GetCompileMethod(Type lambdaExpressionType)
ReadOnlyCollection< Expression > TestValues
Definition SwitchCase.cs:11
static readonly object BoxedTrue
Definition Utils.cs:10
static readonly object BoxedFalse
Definition Utils.cs:8
static readonly DefaultExpression Empty
Definition Utils.cs:60
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string UnsupportedExpressionType
Definition SR.cs:180
Definition SR.cs:7
TypeCode
Definition TypeCode.cs:4