Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make LambdaCompiler prefer interpretation to compilation on iOS #54970

Merged
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f4d448c
Make LambdaCompiler prefer interpretation to compilation on iOS
MaximLipnin Jun 30, 2021
c05dfd5
Simplify the condition
MaximLipnin Jun 30, 2021
bdac243
Merge branch 'main' into prefer_interp_for_lambda_compiler_on_ios
MaximLipnin Jul 1, 2021
c6ebcfd
Extend the IsInterpreting condition to the other apple mobile platforms
MaximLipnin Jul 1, 2021
dac905e
Extract a separate functional test
MaximLipnin Jul 1, 2021
0987d1f
Set the right condition for IsInterpreting property in the test cspro…
MaximLipnin Jul 2, 2021
ae5d13d
Merge branch 'main' into prefer_interp_for_lambda_compiler_on_ios
MaximLipnin Jul 2, 2021
79e2afd
Disable a couple of tests
MaximLipnin Jul 2, 2021
4f94240
Use PlatformDetection to check that System.Linq.Expressions was compi…
MaximLipnin Jul 2, 2021
01068dd
Disable failing System.Dynamic.Runtime library tests
MaximLipnin Jul 3, 2021
21e7084
Merge branch 'main' into prefer_interp_for_lambda_compiler_on_ios
MaximLipnin Jul 3, 2021
2520971
Address issue with Microsoft.VisualBasic.CompilerServices.Tests
MaximLipnin Jul 5, 2021
bb5abac
Merge branch 'main' into prefer_interp_for_lambda_compiler_on_ios
MaximLipnin Jul 5, 2021
9fa02a6
Fix build issue
MaximLipnin Jul 5, 2021
940a10d
Merge branch 'main' into prefer_interp_for_lambda_compiler_on_ios
MaximLipnin Jul 5, 2021
a4813f9
Revert the test
MaximLipnin Jul 5, 2021
c3a3530
Update the invariant functional test for ios simulator
MaximLipnin Jul 6, 2021
ab03032
Re-enable some SLE tests on tvOS
MaximLipnin Jul 6, 2021
7c6ee4f
Merge branch 'main' into prefer_interp_for_lambda_compiler_on_ios
MaximLipnin Jul 6, 2021
038b4d5
Disable Microsoft.CSharp library test suite due to app crash in CI
MaximLipnin Jul 6, 2021
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
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<FeatureInterpret>true</FeatureInterpret>
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-MacCatalyst</TargetFrameworks>
<Nullable>enable</Nullable>
<IsInterpreting>false</IsInterpreting>
<IsInterpreting Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true'">true</IsInterpreting>
MaximLipnin marked this conversation as resolved.
Show resolved Hide resolved
<DefineConstants> $(DefineConstants);FEATURE_DLG_INVOKE;FEATURE_FAST_CREATE</DefineConstants>
<DefineConstants Condition=" '$(IsInterpreting)' != 'true' ">$(DefineConstants);FEATURE_COMPILE</DefineConstants>
<DefineConstants Condition=" '$(FeatureInterpret)' == 'true' ">$(DefineConstants);FEATURE_INTERPRET</DefineConstants>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ internal static Expression<TDelegate> Create(Expression body, string? name, bool

#if !FEATURE_COMPILE
// Separate expression creation class to hide the CreateExpressionFunc function from users reflecting on Expression<T>
public class ExpressionCreator<TDelegate>
internal static class ExpressionCreator<TDelegate>
{
public static Expression<TDelegate> CreateExpressionFunc(Expression body, string? name, bool tailCall, ReadOnlyCollection<ParameterExpression> parameters)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public static IEnumerable<object[]> ObjectArguments()
yield return new[] {new object()};
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/55070", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
MaximLipnin marked this conversation as resolved.
Show resolved Hide resolved
[Theory, MemberData(nameof(ObjectArguments))]
public void InvokeVirtualMethod(object value)
{
Expand Down Expand Up @@ -411,6 +412,7 @@ public Func<TResult> Delegate
public OutAction OutDelegate;
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/55071", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
[Fact]
public void InvokeFuncMember()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
<PropertyGroup>
<FeatureInterpret>true</FeatureInterpret>
<IsInterpreting>false</IsInterpreting>
<IsInterpreting Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true'">true</IsInterpreting>
<DefineConstants Condition=" '$(IsInterpreting)' != 'true' ">$(DefineConstants);FEATURE_COMPILE</DefineConstants>
<DefineConstants Condition=" '$(FeatureInterpret)' == 'true' ">$(DefineConstants);FEATURE_INTERPRET</DefineConstants>
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-MacCatalyst</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<AssembliesBeingTested Include="Microsoft.CSharp" />
Expand Down
3 changes: 2 additions & 1 deletion src/tests/FunctionalTests/iOS/Simulator/AOT/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using System.Runtime.InteropServices;

public static class Program
{
Expand All @@ -14,6 +14,7 @@ public static class Program
public static async Task<int> Main(string[] args)
{
mono_ios_set_summary($"Starting functional test");

Console.WriteLine("Done!");
await Task.Delay(5000);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;

public static class Program
{
[DllImport("__Internal")]
public static extern void mono_ios_set_summary (string value);

public static async Task<int> Main(string[] args)
{
mono_ios_set_summary($"Starting functional test");

// https://github.com/dotnet/runtime/issues/47112
var foos = new string [] { "hi", "bye" };
string f = foos.AsQueryable ().First ();

Console.WriteLine("Done!");
await Task.Delay(5000);

return 42;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk" TreatAsLocalProperty="MonoForceInterpreter">

<PropertyGroup>
<OutputType>Exe</OutputType>
<MonoForceInterpreter>false</MonoForceInterpreter>
<RunAOTCompilation>true</RunAOTCompilation>
<TestRuntime>true</TestRuntime>
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
<TargetOS Condition="'$(TargetOS)' == ''">iOSSimulator</TargetOS>
<MainLibraryFileName>iOS.Simulator.LambdaCompilerAot.Test.dll</MainLibraryFileName>
<IncludesTestRunner>false</IncludesTestRunner>
<ExpectedExitCode>42</ExpectedExitCode>
<EnableAggressiveTrimming>true</EnableAggressiveTrimming>
</PropertyGroup>

<ItemGroup>
<Compile Include="Program.cs" />
</ItemGroup>
</Project>