Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
f19bce6
fix: honor selected increment methods during assignment
jogibear9988 Oct 18, 2026
42324a1
fix: preserve jump values across inlined lambda boundaries
jogibear9988 Oct 18, 2026
345f639
fix: honor selected binary methods and compound assignment conversions
jogibear9988 Oct 18, 2026
ae1cc3f
fix: preserve lifted operand evaluation and verify compiler layouts
jogibear9988 Oct 18, 2026
d369108
fix: preserve operand stacks and filter state across exception regions
jogibear9988 Oct 18, 2026
b7a33e2
test: verify behavior behind compiler layout exclusions
jogibear9988 Oct 18, 2026
bcf5852
test: verify closure and stack behavior for compatibility exclusions
jogibear9988 Oct 18, 2026
77f3d5c
test: verify nested-binding layout exclusions on Framework
jogibear9988 Oct 18, 2026
5ea697f
fix: validate scoped label definitions before emission
jogibear9988 Oct 18, 2026
9fd8e97
fix: validate exception-region jumps and preserve assignment stacks
jogibear9988 Oct 18, 2026
e76b72e
feat: support runtime expression ref arguments and escaping jumps
jogibear9988 Oct 18, 2026
88f98f9
fix: bind reused labels within lexical and invocation scopes
jogibear9988 Oct 18, 2026
7e089dc
feat: preserve per-occurrence dynamic sites and inlined invocation bo…
jogibear9988 Oct 18, 2026
e9bdf18
fix: preserve physical method-tail returns with portable regressions
jogibear9988 Oct 18, 2026
e0a2208
feat: share typed cells between captures quotes and runtime variables
jogibear9988 Oct 18, 2026
5776d59
fix: validate lexical jumps and verify runtime-variable spill behavior
jogibear9988 Oct 18, 2026
e66e05d
test: cover value contexts for captured and quoted operands
jogibear9988 Oct 18, 2026
b0e594a
test: verify compiled behavior for interpreter-specific cases
jogibear9988 Oct 18, 2026
2e74002
fix: match non-Exception catch policy in generated methods
jogibear9988 Oct 18, 2026
43068ed
fix: keep Framework boxed receivers verifiable during argument spills
jogibear9988 Oct 18, 2026
a122bdd
perf: avoid eager scope and exception metadata allocations on label-f…
jogibear9988 Oct 19, 2026
019b464
test: cover reduction reuse in dynamic and quoted expressions
jogibear9988 Nov 4, 2026
54fe4b2
perf: reuse hoisted capture reflection metadata within each compilation
jogibear9988 Oct 19, 2026
3682fc4
fix: keep lazy JIT with anonymous catch policy on modern runtimes
jogibear9988 Oct 19, 2026
ce867d7
perf: keep provably readonly captures in existing value closure slots
jogibear9988 Oct 19, 2026
bce2d0b
perf: reuse transient scope buffers and skip terminal-node scope trac…
jogibear9988 Oct 19, 2026
c11ecdc
perf: analyze capture storage mutations once per compilation root
jogibear9988 Oct 19, 2026
6369a62
perf: reuse capture call signatures and avoid cells for value arguments
jogibear9988 Oct 19, 2026
f72fcf7
perf: collect switch test values without enumerator allocations
jogibear9988 Oct 19, 2026
b3db489
perf: allocate hoisted type cache only for actual shared cells
jogibear9988 Oct 19, 2026
a4beecb
perf: keep lexical and exception ancestry in inline indexed metadata
jogibear9988 Oct 19, 2026
39a0afb
perf: collect terminal expression nodes before tracking lexical scopes
jogibear9988 Oct 19, 2026
0f67f5e
perf: allocate optional emission metadata lazily
jogibear9988 Oct 19, 2026
851adc5
fix: preserve readonly capture layout through control flow and initia…
jogibear9988 Oct 19, 2026
b0f7561
perf: keep primitive arithmetic emission outside lifted-operation han…
jogibear9988 Oct 19, 2026
45e2a4f
perf: track capture slot writes precisely and scan simple initializer…
jogibear9988 Oct 19, 2026
099d324
perf: reuse cleared capture metadata with indexed-property coverage
jogibear9988 Oct 19, 2026
ec49945
perf: skip scoped label helpers while emitting label-free blocks
jogibear9988 Oct 19, 2026
7a7f51e
perf: share root capture analysis before propagating nested parameters
jogibear9988 Oct 19, 2026
d0ce98e
perf: remove exception cleanup regions from internal collector recursion
jogibear9988 Oct 19, 2026
a211586
perf: keep common scope compression and unchanged-depth returns inline
jogibear9988 Oct 19, 2026
ad86ec3
perf: avoid primitive arithmetic spills for atomic operands after EH
jogibear9988 Oct 19, 2026
206e09f
perf: inline the empty capture-parameter cache path
jogibear9988 Oct 19, 2026
fd72d08
perf: reuse operand types in scalar arithmetic emission
jogibear9988 Oct 19, 2026
80a6076
perf: keep private mutable reference captures in their sole child val…
jogibear9988 Oct 19, 2026
155a611
fix: preserve native boxed capture storage and Framework typed-cell s…
jogibear9988 Oct 19, 2026
5859d82
perf: batch collection of consecutive single-expression block scopes
jogibear9988 Oct 19, 2026
9cdaa3e
perf: reuse the initial node type during collection
jogibear9988 Oct 19, 2026
2c6ad0a
perf: avoid root capture scans when typed storage is already required
jogibear9988 Oct 19, 2026
28640c1
perf: reuse private reference slots through constructor and array con…
jogibear9988 Oct 19, 2026
326a75c
perf: establish the actual capture-analysis root before intrinsic col…
jogibear9988 Oct 19, 2026
c457ebe
perf: avoid materializing Light array operands during private capture…
jogibear9988 Oct 19, 2026
40d1deb
fix: restore typed reference loads for verified Framework closure slots
jogibear9988 Oct 19, 2026
5fcd971
perf: defer quote metadata with its trimming contract
jogibear9988 Oct 19, 2026
57bbb9f
perf: keep scope overflow arrays in compact geometric pool buckets
jogibear9988 Oct 19, 2026
738ee21
perf: skip empty jump validators on jump-free expression trees
jogibear9988 Oct 19, 2026
55a7d0e
perf: reduce Framework capture constructor metadata allocations
jogibear9988 Oct 19, 2026
071e629
perf: type Framework capture parameters in existing rented signatures
jogibear9988 Oct 19, 2026
f3d4fd3
perf: avoid the full collector for terminal binary roots
jogibear9988 Oct 19, 2026
bf8c37a
perf: use boxed Framework value cells in proven owned roots
jogibear9988 Oct 19, 2026
6ce7768
perf: avoid redundant Framework delegate casts in proven owned roots
jogibear9988 Oct 19, 2026
92c2b0f
fix: restore owned Framework capture slot loads without extra casts
jogibear9988 Oct 19, 2026
3fa08da
perf: avoid arithmetic operand spills when the right side cannot ente…
jogibear9988 Oct 19, 2026
0ad27bd
perf: use the supported anonymous DynamicMethod constructor for excep…
jogibear9988 Oct 19, 2026
632c2f5
fix: preserve opaque capture and intrinsic arithmetic boundaries
jogibear9988 Oct 19, 2026
8cb5f80
docs: describe current expression compatibility and limits
jogibear9988 Nov 11, 2026
5367516
refactor: use argument views in capture analysis and prepared calls
jogibear9988 Nov 11, 2026
80e6fbf
perf: use proven SmallList bounds during collection and emission
jogibear9988 Nov 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Moreover the compiled delegate may be slower than the manually created delegate
_TL;DR;_
> Expression.Compile creates a DynamicMethod and associates it with an anonymous assembly to run it in a sand-boxed environment. This makes it safe for a dynamic method to be emitted and executed by partially trusted code but adds some run-time overhead.

FEC keeps owned DynamicMethods for ordinary lambdas. Methods containing exception regions use anonymous hosting to match System's non-Exception throw and catch policy. The APIs that skip collection also use anonymous hosting, because their exception regions are unknown before emission. Anonymous hosting adds eager JIT work when creating the delegate. `CompileFastToIL` inherits the host policy of the caller's method.

See also [a deep dive to Delegate internals](https://mattwarren.org/2017/01/25/How-do-.NET-delegates-work/#different-types-of-delegates).


Expand Down Expand Up @@ -263,17 +265,34 @@ var x = f(new B());
The idea is to provide the fast compilation for the supported expression types
and fallback to the system `Expression.Compile()` for the not supported types:

Invoking a runtime `System.Linq.Expressions.Expression<TDelegate>` value compiles that value
with its `Compile()` method before invoking the resulting delegate, as the system compiler does.
This runtime operation is distinct from compilation fallback: with
`CompileFast(ifFastFailedReturnNull: true)`, FEC still compiles the surrounding lambda directly.
Errors from compiling or executing the runtime expression propagate to its caller.
Ref-property arguments retain FEC's normal setter copyback after successful invocation.
The system compiler can lose this copyback when another argument contains an exception
block; FEC preserves the property mutation instead of reproducing that behavior.

Dynamic expressions use ordinary DLR call sites: each emitted occurrence has its own site,
reuses binding rules, and reads the current mutable `Target` for every invocation.
Runtime binder rule compilation is intrinsic DLR behavior; the outer lambda still compiles directly with FEC.

Quoted lambdas and `RuntimeVariables` share live typed cells with compiled outer and sibling lambdas.
Mutations remain visible after the creating method returns; independent activations keep separate storage.
Capture-free quoted trees retain their original identity. The closure arrays and direct IL emitter remain in use.

### What's not supported yet

**FEC does not support yet:**

- `Quote`
- `Dynamic`
- `RuntimeVariables`
- Captures of by-ref parameters, pointer types, or byref-like values that cannot be stored in a heap cell
- Reused physical method-tail labels reached with pending operand values or from protected exception regions (strict null / `NotSupported_MethodReturn_Context`)
- `DebugInfo`
- `MemberInit` with the `MemberMemberBinding` and the `ListMemberBinding` binding types
- `NewArrayInit` multi-dimensional array initializer is not supported yet

Nested `MemberInit` member and list bindings are supported. Very deep expression trees still have a known recursive traversal limit; see the [runtime compatibility results](test/FastExpressionCompiler.DotNetRuntimeTests/results/current-compatibility.md).

To find what nodes are not supported in your expression you may use the technic described below in the [Diagnostics](#diagnostics) section.

The compilation is done by traversing the expression nodes and emitting the IL.
Expand Down
1 change: 0 additions & 1 deletion src/FastExpressionCompiler.LightExpression/Expression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6081,7 +6081,6 @@ internal TypedReturnManyParametersExpression(Expression body, IReadOnlyList<Para
: base(body, parameters) => ReturnType = returnType;
}

// todo: @feature is not supported yet
public sealed class DynamicExpression : Expression
{
public override ExpressionType NodeType => ExpressionType.Dynamic;
Expand Down
3,177 changes: 2,436 additions & 741 deletions src/FastExpressionCompiler/FastExpressionCompiler.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public static void Right_InvalidType_ThrowsArgumentException(Type type)
AssertExtensions.Throws<ArgumentException>("right", () => Expression.Assign(Expression.Variable(typeof(object)), right));
}

[Theory]
[SystemAssignmentDisagreementTheory("VerifiedCompilerCompatibilityBehaviorTests.ConstantValueTypeAssignmentsFollowSystemCompiled")]
[ClassData(typeof(CompilationTypes))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/19094")]
public static void Left_ValueTypeContainsChildTryExpression(bool useInterpreter)
Expand All @@ -302,7 +302,7 @@ public static void Left_ValueTypeContainsChildTryExpression(bool useInterpreter)
Assert.True(func.CompileForFec(useInterpreter)());
}

[Theory]
[SystemAssignmentDisagreementTheory("VerifiedCompilerCompatibilityBehaviorTests.ConstantValueTypeAssignmentsFollowSystemCompiled")]
[ClassData(typeof(CompilationTypes))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/19094")]
public static void ValueTypeIndexAssign(bool useInterpreter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ public static void CoalesceReferenceToValueType(bool useInterpreter)
Assert.Equal(1, func());
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))]
[VerifiedCompilerLayoutFact("CoalesceValueConversionRegressionTests.Nullable_numeric_coalesce_matches_system: int?/int? values and nulls")]
[ActiveIssue("https://github.com/mono/mono/issues/14919", TestRuntimes.Mono)]
public static void VerifyIL_NullableIntCoalesceToNullableInt()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public static void ToStringTest()
Assert.Equal("{var x;var y; ... }", e3.ToString());
}

[Fact]
[VerifiedCompilerLayoutFact("AdditionalCompilerLayoutBehaviorRegressionTests.Insignificant_blocks_preserve_action_behavior")]
[ActiveIssue("https://github.com/mono/mono/issues/14919", TestRuntimes.Mono)]
public static void InsignificantBlock()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace System.Linq.Expressions.Tests
{
public static class CompilerTests
{
[Theory]
[KnownFecCrashTheory("10,000-deep expression traversal overflows the stack; requires a broader traversal/emission change. No stack-size workaround. Re-enable after a structural fix.")]
[ClassData(typeof(CompilationTypes))]
[OuterLoop("Takes over a minute to complete")]
// Compiling a 10,000-deep expression tree takes hours on the single-threaded wasm
Expand All @@ -31,7 +31,7 @@ public static void CompileDeepTree_NoStackOverflow(bool useInterpreter)
Assert.Equal(n, f());
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))]
[VerifiedCompilerLayoutFact("VerifiedCompilerRepresentationBehaviorTests.NonNullableConstants", "private closure layout")]
public static void EmitConstantsToIL_NonNullableValueTypes()
{
VerifyEmitConstantsToIL((bool)true);
Expand All @@ -52,7 +52,7 @@ public static void EmitConstantsToIL_NonNullableValueTypes()
VerifyEmitConstantsToIL((decimal)49.95m);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))]
[VerifiedCompilerLayoutFact("VerifiedCompilerRepresentationBehaviorTests.NullableConstants", "private closure layout")]
public static void EmitConstantsToIL_NullableValueTypes()
{
VerifyEmitConstantsToIL((bool?)null);
Expand Down Expand Up @@ -88,29 +88,29 @@ public static void EmitConstantsToIL_NullableValueTypes()
VerifyEmitConstantsToIL((DateTime?)null);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))]
[VerifiedCompilerLayoutFact("VerifiedCompilerRepresentationBehaviorTests.ReferenceConstants", "private closure layout")]
public static void EmitConstantsToIL_ReferenceTypes()
{
VerifyEmitConstantsToIL((string)null);
VerifyEmitConstantsToIL((string)"bar");
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))]
[VerifiedCompilerLayoutFact("VerifiedCompilerRepresentationBehaviorTests.EnumConstants", "private closure layout")]
public static void EmitConstantsToIL_Enums()
{
VerifyEmitConstantsToIL(ConstantsEnum.A);
VerifyEmitConstantsToIL((ConstantsEnum?)null);
VerifyEmitConstantsToIL((ConstantsEnum?)ConstantsEnum.A);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))]
[VerifiedCompilerLayoutFact("VerifiedCompilerRepresentationBehaviorTests.SharedConstantReferences", "private closure layout")]
public static void EmitConstantsToIL_ShareReferences()
{
var o = new object();
VerifyEmitConstantsToIL(Expression.Equal(Expression.Constant(o), Expression.Constant(o)), 1, true);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))]
[VerifiedCompilerLayoutFact("VerifiedCompilerRepresentationBehaviorTests.CapturedConstants", "private closure layout")]
public static void EmitConstantsToIL_LiftedToClosure()
{
VerifyEmitConstantsToIL(DateTime.Now, 1);
Expand Down Expand Up @@ -145,7 +145,7 @@ public static void VariableBinder_CatchBlock_Filter2()
);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))]
[VerifiedCompilerLayoutFact("RuntimeCompilerLayoutBehaviorRegressionTests.VerifyIL_Simple_behavior")]
[ActiveIssue("https://github.com/mono/mono/issues/14919", TestRuntimes.Mono)]
public static void VerifyIL_Simple()
{
Expand All @@ -162,7 +162,7 @@ .maxstack 1
}");
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))]
[VerifiedCompilerLayoutFact("RuntimeCompilerLayoutBehaviorRegressionTests.VerifyIL_Exceptions_behavior")]
[ActiveIssue("https://github.com/mono/mono/issues/14919", TestRuntimes.Mono)]
public static void VerifyIL_Exceptions()
{
Expand Down Expand Up @@ -223,7 +223,7 @@ [0] int32
}");
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))]
[VerifiedCompilerLayoutFact("RuntimeCompilerLayoutBehaviorRegressionTests.VerifyIL_Closure1_behavior")]
[ActiveIssue("https://github.com/mono/mono/issues/14919", TestRuntimes.Mono)]
public static void VerifyIL_Closure1()
{
Expand Down Expand Up @@ -258,7 +258,7 @@ .maxstack 1
appendInnerLambdas: true);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))]
[VerifiedCompilerLayoutFact("RuntimeCompilerLayoutBehaviorRegressionTests.VerifyIL_Closure2_behavior")]
[ActiveIssue("https://github.com/mono/mono/issues/14919", TestRuntimes.Mono)]
public static void VerifyIL_Closure2()
{
Expand Down Expand Up @@ -316,7 +316,7 @@ [0] object[]
appendInnerLambdas: true);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))]
[VerifiedCompilerLayoutFact("RuntimeCompilerLayoutBehaviorRegressionTests.VerifyIL_Closure3_behavior")]
[ActiveIssue("https://github.com/mono/mono/issues/14919", TestRuntimes.Mono)]
public static void VerifyIL_Closure3()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ public void ExceptionThrownInFilter(bool useInterpreter)
Assert.Equal(9, func());
}

[Theory, InlineData(true)]
[SystemInterpreterOnlyFilterTheory("VerifiedCompilerCompatibilityBehaviorTests.NestedFilterRegionsAreRejectedByCompiledBackends"), InlineData(true)]
public void TryFinallyWithinFilter(bool useInterpreter)
{
TryExpression tryExp = Expression.TryCatch(
Expand Down Expand Up @@ -1015,7 +1015,7 @@ public void TryFinallyWithinFilterCompiledProhibited()
}
}

[Theory, InlineData(true)]
[SystemInterpreterOnlyFilterTheory("VerifiedCompilerCompatibilityBehaviorTests.NestedFilterRegionsAreRejectedByCompiledBackends"), InlineData(true)]
public void TryCatchWithinFilter(bool useInterpreter)
{
TryExpression tryExp = Expression.TryCatch(
Expand Down Expand Up @@ -1045,7 +1045,7 @@ public void TryCatchWithinFilterCompiled()
TryCatchWithinFilter(false);
}

[Theory, InlineData(true)]
[SystemInterpreterOnlyFilterTheory("VerifiedCompilerCompatibilityBehaviorTests.NestedFilterRegionsAreRejectedByCompiledBackends"), InlineData(true)]
public void TryCatchThrowingWithinFilter(bool useInterpreter)
{
TryExpression tryExp = Expression.TryCatch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,16 +374,38 @@ public void ConfirmCanWrite(Expression writableExpression)
public void CompileIrreduciebleExtension(bool useInterpreter)
{
Expression<Action> exp = Expression.Lambda<Action>(new IrreducibleWithTypeAndNodeType());
AssertExtensions.Throws<ArgumentException>(null, () => exp.CompileForFec(useInterpreter));
if (Environment.GetEnvironmentVariable("FEC_TEST_COMPILER") == "system")
AssertExtensions.Throws<ArgumentException>(null, () => exp.CompileForFec(useInterpreter));
else
AssertFecIrreducibleNodeContract(exp);
}

[Theory, ClassData(typeof(CompilationTypes))]
public void CompileIrreduciebleStrangeNodeTypeExtension(bool useInterpreter)
{
Expression<Action> exp = Expression.Lambda<Action>(new IrreduceibleWithTypeAndStrangeNodeType());
AssertExtensions.Throws<ArgumentException>(null, () => exp.CompileForFec(useInterpreter));
}

if (Environment.GetEnvironmentVariable("FEC_TEST_COMPILER") == "system")
AssertExtensions.Throws<ArgumentException>(null, () => exp.CompileForFec(useInterpreter));
else
AssertFecIrreducibleNodeContract(exp);
}

private static void AssertFecIrreducibleNodeContract(Expression<Action> expression)
{
foreach (var flags in new[] { FastExpressionCompiler.CompilerFlags.Default,
FastExpressionCompiler.CompilerFlags.NoInvocationLambdaInlining,
FastExpressionCompiler.CompilerFlags.EnableDelegateDebugInfo })
{
CompilationObservationAttribute.Record();
Assert.Null(FastExpressionCompiler.ExpressionCompiler.CompileFast<Action>(expression, true, flags));
CompilationObservationAttribute.Record();
var error = Assert.Throws<FastExpressionCompiler.NotSupportedExpressionException>(() =>
FastExpressionCompiler.ExpressionCompiler.CompileFast<Action>(expression, true,
flags | FastExpressionCompiler.CompilerFlags.ThrowOnNotSupportedExpression));
Assert.Equal(FastExpressionCompiler.ExpressionCompiler.Result.NotSupported_UnknownExpression, error.Reason);
}
}

[Theory, ClassData(typeof(CompilationTypes))]
public void CompileReducibleStrangeNodeTypeExtension(bool useInterpreter)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,10 @@ public void TailCallThenReturn(bool useInterpreter)
true);
Action act = lambda.CompileForFec(useInterpreter);
act();
lambda.Verify(@"
// Both rows execute FEC above; its IL differs and it has no interpreter instruction layout.
// Keep the upstream IL and interpreter layout assertions in the System compiler control run.
if (Environment.GetEnvironmentVariable("FEC_TEST_COMPILER") == "system")
lambda.Verify(@"
.method void ::lambda_method(class [System.Linq.Expressions]System.Runtime.CompilerServices.Closure)
{
.maxstack 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static class InterpreterTests

// IsNotLinqExpressionsBuiltWithIsInterpretingOnly is not directly required,
// but this functionality relies on private reflection and that would not work with AOT
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))]
[VerifiedCompilerLayoutFact("VerifiedCompilerRepresentationBehaviorTests.InterpreterInstructionSimpleBehavior", "interpreter instruction representation")]
public static void VerifyInstructions_Simple()
{
// Using an unchecked multiplication to ensure that a mul instruction is emitted (and not mul.ovf)
Expand Down Expand Up @@ -46,7 +46,7 @@ .maxcontinuation 0

// IsNotLinqExpressionsBuiltWithIsInterpretingOnly is not directly required,
// but this functionality relies on private reflection and that would not work with AOT
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))]
[VerifiedCompilerLayoutFact("VerifiedCompilerRepresentationBehaviorTests.InterpreterInstructionExceptionBehavior", "interpreter instruction representation")]
public static void VerifyInstructions_Exceptions()
{
ParameterExpression x = Expression.Parameter(typeof(int), "x");
Expand Down Expand Up @@ -101,7 +101,7 @@ .maxcontinuation 1
}");
}

[Fact]
[VerifiedCompilerLayoutFact("VerifiedCompilerRepresentationBehaviorTests.InlinedThrowingConstructorBehavior", "interpreter constructor stack trace representation")]
[ActiveIssue ("https://github.com/dotnet/runtime/issues/53599", platforms: TestPlatforms.MacCatalyst, runtimes: TestRuntimes.Mono)]
public static void ConstructorThrows_StackTrace()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ public void AboveByteMaxArityArg(bool useInterpreter)
Assert.Equal(23, result);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))]
[VerifiedCompilerLayoutFact("RuntimeCompilerLayoutBehaviorRegressionTests.AboveByteMaxArityArgIL_behavior")]
public void AboveByteMaxArityArgIL()
{
ParameterExpression[] pars = Enumerable.Range(0, 300)
Expand Down Expand Up @@ -882,7 +882,7 @@ public void AboveByteMaxArityArgAddress(bool useInterpreter)
Assert.True(result.Mutated);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))]
[VerifiedCompilerLayoutFact("RuntimeCompilerLayoutBehaviorRegressionTests.AboveByteMaxArityArgAddressIL_behavior")]
public void AboveByteMaxArityArgAddressIL()
{
ParameterExpression parToMutate = Expression.Parameter(typeof(Mutable));
Expand Down Expand Up @@ -941,7 +941,7 @@ public void PrivateDelegate(bool useInterpreter)
Assert.Equal(42, del.DynamicInvoke());
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoRuntime), nameof(PlatformDetection.IsNotNativeAot))]
[VerifiedCompilerLayoutFact("VerifiedCompilerRepresentationBehaviorTests.InterpreterThunkActionAndResultBehavior", "interpreter delegate thunk representation")]
public void ValidateThatInterpreterWithSimpleTypeUsesNonDynamicThunk()
{
Expression<Action> action = () => Console.WriteLine("");
Expand Down
Loading
Loading